diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-07-15 12:17:32 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-07-15 10:17:32 +0000 |
commit | ad115a3c32ab0af89b575221f3a8212652a7f948 (patch) | |
tree | c2916073d31a98f423ae5a332f347790559245bb | |
parent | 80def9087092a60b4f5f2ca952b3d0eb8e73cc8d (diff) | |
download | gcc-ad115a3c32ab0af89b575221f3a8212652a7f948.zip gcc-ad115a3c32ab0af89b575221f3a8212652a7f948.tar.gz gcc-ad115a3c32ab0af89b575221f3a8212652a7f948.tar.bz2 |
tree.c (tree_code_size): Add TRANSLATION_UNIT_DECL, NAMESPACE_DECL, IMPORTED_DECL and NAMELIST_DECL...
* tree.c (tree_code_size): Add TRANSLATION_UNIT_DECL,
NAMESPACE_DECL, IMPORTED_DECL and NAMELIST_DECL;
call langhook for unknown declaration.
(find_decls_types_r): Do not walk DECL_ARGUMENT_FLD.
* tree.h (DECL_ARGUMENTS): Update.
* print-tree.c (print_node): Update.
* tree-core.h (tree_decl_non_common): Remove arguments.
(tree_function_decl): Add arguments.
* class.c (build_clone): Do not clear assembler names of
templates.
* decl.c (cp_tree_node_structure): Add TEMPLATE_DECL.
* cp-objcp-common.c (cp_tree_size): Add TEMPLATE_DECL
as a special case return sizeof (struct tree_decl_non_common)
for other decls.
(cp_common_init_ts): Do not initialize NAMESPACE_DECL;
initialize TEMPLATE_DECL as MARK_TS_DECL_COMMON.
* cp/cp-tree.h (tree_template_decl): New structure.
(cp_tree_node_structure_enum): Add TS_CP_TEMPLATE_DECL.
(union cp_lang_tree_node): Add template_decl.
(DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT): Update.
* lto/lto.c (mentions_vars_p_decl_non_common): Skip
DECL_ARGUMENT_FLD.
mentions_vars_p_function): Do DECL_ARGUMENTS.
(lto_fixup_prevailing_decls): Update.
* objc-act.c (objc_common_tree_size): New function.
* objc-act.h (KEYWORD_KEY_NAME, KEYWORD_ARG_NAME): Add type
checking.
(INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK): New macro.
(METHOD_SEL_NAME, METHOD_SEL_ARGS, METHOD_ADD_ARGS,
METHOD_ADD_ARGS_ELLIPSIS_P, METHOD_DEFINITION, METHOD_ENCODING,
METHOD_TYPE_ATTRIBUTES, METHOD_PROPERTY_CONTEXT): Add type checking.
(METHOD_SEL_ARGS): Use decl_common.size instead of
decl_non_common.result.
(PROPERTY_NAME, PROPERTY_GETTER_NAME, PROPERTY_SETTER_NAME,
PROPERTY_READONLY, PROPERTY_NONATOMIC, PROPERTY_ASSIGN_SEMANTICS,
PROPERTY_IVAR_NAME, PROPERTY_DYNAMIC, PROPERTY_HAS_NO_GETTER,
PROPERTY_HAS_NO_SETTER, PROPERTY_OPTIONAL): Add type checking.
(objc_common_tree_size): Declare.
* objc/objc-lang.c (LANG_HOOKS_TREE_SIZE): New macro.
From-SVN: r212549
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/cp/class.c | 2 | ||||
-rw-r--r-- | gcc/cp/cp-objcp-common.c | 7 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 22 | ||||
-rw-r--r-- | gcc/cp/decl.c | 1 | ||||
-rw-r--r-- | gcc/lto/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/lto/lto.c | 4 | ||||
-rw-r--r-- | gcc/objc/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 17 | ||||
-rw-r--r-- | gcc/objc/objc-act.h | 67 | ||||
-rw-r--r-- | gcc/objc/objc-lang.c | 2 | ||||
-rw-r--r-- | gcc/print-tree.c | 2 | ||||
-rw-r--r-- | gcc/tree-core.h | 4 | ||||
-rw-r--r-- | gcc/tree.c | 9 | ||||
-rw-r--r-- | gcc/tree.h | 8 |
16 files changed, 155 insertions, 41 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f86acf..5a83e0e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2014-07-14 Jan Hubicka <hubicka@ucw.cz> + + * tree.c (tree_code_size): Add TRANSLATION_UNIT_DECL, + NAMESPACE_DECL, IMPORTED_DECL and NAMELIST_DECL; + call langhook for unknown declaration. + (find_decls_types_r): Do not walk DECL_ARGUMENT_FLD. + * tree.h (DECL_ARGUMENTS): Update. + * print-tree.c (print_node): Update. + * tree-core.h (tree_decl_non_common): Remove arguments. + (tree_function_decl): Add arguments. + 2014-07-14 Richard Earnshaw <rearnsha@arm.com> * aarch64.md (add_losym_<mode>): Set type to alu_imm. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0d66bb3..9ffee53 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,18 @@ +2014-07-14 Jan Hubicka <hubicka@ucw.cz> + + * class.c (build_clone): Do not clear assembler names of + templates. + * decl.c (cp_tree_node_structure): Add TEMPLATE_DECL. + * cp-objcp-common.c (cp_tree_size): Add TEMPLATE_DECL + as a special case return sizeof (struct tree_decl_non_common) + for other decls. + (cp_common_init_ts): Do not initialize NAMESPACE_DECL; + initialize TEMPLATE_DECL as MARK_TS_DECL_COMMON. + * cp/cp-tree.h (tree_template_decl): New structure. + (cp_tree_node_structure_enum): Add TS_CP_TEMPLATE_DECL. + (union cp_lang_tree_node): Add template_decl. + (DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT): Update. + 2014-07-14 Jason Merrill <jason@redhat.com> PR c++/61445 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index d0eb103..dbd8d3d 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -4388,7 +4388,6 @@ build_clone (tree fn, tree name) clone = copy_decl (fn); /* Reset the function name. */ DECL_NAME (clone) = name; - SET_DECL_ASSEMBLER_NAME (clone, NULL_TREE); /* Remember where this function came from. */ DECL_ABSTRACT_ORIGIN (clone) = fn; /* Make it easy to find the CLONE given the FN. */ @@ -4406,6 +4405,7 @@ build_clone (tree fn, tree name) return clone; } + SET_DECL_ASSEMBLER_NAME (clone, NULL_TREE); DECL_CLONED_FUNCTION (clone) = fn; /* There's no pending inline data for this function. */ DECL_PENDING_INLINE_INFO (clone) = NULL; diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c index 78dddef..0c50f40 100644 --- a/gcc/cp/cp-objcp-common.c +++ b/gcc/cp/cp-objcp-common.c @@ -103,7 +103,11 @@ cp_tree_size (enum tree_code code) case USERDEF_LITERAL: return sizeof (struct tree_userdef_literal); + case TEMPLATE_DECL: return sizeof (struct tree_template_decl); + default: + if (TREE_CODE_CLASS (code) == tcc_declaration) + return sizeof (struct tree_decl_non_common); gcc_unreachable (); } /* NOTREACHED */ @@ -245,9 +249,8 @@ cxx_block_may_fallthru (const_tree stmt) void cp_common_init_ts (void) { - MARK_TS_DECL_NON_COMMON (NAMESPACE_DECL); MARK_TS_DECL_NON_COMMON (USING_DECL); - MARK_TS_DECL_NON_COMMON (TEMPLATE_DECL); + MARK_TS_DECL_COMMON (TEMPLATE_DECL); MARK_TS_COMMON (TEMPLATE_TEMPLATE_PARM); MARK_TS_COMMON (TEMPLATE_TYPE_PARM); diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 091d20f..0c0d804 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -362,6 +362,12 @@ struct GTY(()) tree_overload { tree function; }; +struct GTY(()) tree_template_decl { + struct tree_decl_common common; + tree arguments; + tree result; +}; + /* Returns true iff NODE is a BASELINK. */ #define BASELINK_P(NODE) \ (TREE_CODE (NODE) == BASELINK) @@ -796,6 +802,7 @@ enum cp_tree_node_structure_enum { TS_CP_BINDING, TS_CP_OVERLOAD, TS_CP_BASELINK, + TS_CP_TEMPLATE_DECL, TS_CP_WRAPPER, TS_CP_DEFAULT_ARG, TS_CP_DEFERRED_NOEXCEPT, @@ -817,6 +824,7 @@ union GTY((desc ("cp_tree_node_structure (&%h)"), struct ptrmem_cst GTY ((tag ("TS_CP_PTRMEM"))) ptrmem; struct tree_overload GTY ((tag ("TS_CP_OVERLOAD"))) overload; struct tree_baselink GTY ((tag ("TS_CP_BASELINK"))) baselink; + struct tree_template_decl GTY ((tag ("TS_CP_TEMPLATE_DECL"))) template_decl; struct tree_default_arg GTY ((tag ("TS_CP_DEFAULT_ARG"))) default_arg; struct tree_deferred_noexcept GTY ((tag ("TS_CP_DEFERRED_NOEXCEPT"))) deferred_noexcept; struct lang_identifier GTY ((tag ("TS_CP_IDENTIFIER"))) identifier; @@ -3753,16 +3761,22 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter) parameter). The TREE_PURPOSE is the default value, if any. The TEMPLATE_PARM_INDEX for the parameter is available as the DECL_INITIAL (for a PARM_DECL) or as the TREE_TYPE (for a - TYPE_DECL). */ + TYPE_DECL). + + FIXME: CONST_CAST_TREE is a hack that hopefully will go away after + tree is converted to C++ class hiearchy. */ #define DECL_TEMPLATE_PARMS(NODE) \ - TEMPLATE_DECL_CHECK (NODE)->decl_non_common.arguments + ((struct tree_template_decl *)CONST_CAST_TREE (TEMPLATE_DECL_CHECK (NODE)))->arguments #define DECL_INNERMOST_TEMPLATE_PARMS(NODE) \ INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (NODE)) #define DECL_NTPARMS(NODE) \ TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE)) -/* For function, method, class-data templates. */ +/* For function, method, class-data templates. + + FIXME: CONST_CAST_TREE is a hack that hopefully will go away after + tree is converted to C++ class hiearchy. */ #define DECL_TEMPLATE_RESULT(NODE) \ - DECL_RESULT_FLD (TEMPLATE_DECL_CHECK (NODE)) + ((struct tree_template_decl *)CONST_CAST_TREE(TEMPLATE_DECL_CHECK (NODE)))->result /* For a function template at namespace scope, DECL_TEMPLATE_INSTANTIATIONS lists all instantiations and specializations of the function so that tsubst_friend_function can reassign them to another template if we find diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9d3fbb2..87249a0 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -14482,6 +14482,7 @@ cp_tree_node_structure (union lang_tree_node * t) case TEMPLATE_PARM_INDEX: return TS_CP_TPI; case PTRMEM_CST: return TS_CP_PTRMEM; case BASELINK: return TS_CP_BASELINK; + case TEMPLATE_DECL: return TS_CP_TEMPLATE_DECL; case STATIC_ASSERT: return TS_CP_STATIC_ASSERT; case ARGUMENT_PACK_SELECT: return TS_CP_ARGUMENT_PACK_SELECT; case TRAIT_EXPR: return TS_CP_TRAIT_EXPR; diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 194acba..8fd21ea 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,10 @@ +2014-07-14 Jan Hubicka <hubicka@ucw.cz> + + * lto.c (mentions_vars_p_decl_non_common): Skip + DECL_ARGUMENT_FLD. + mentions_vars_p_function): Do DECL_ARGUMENTS. + (lto_fixup_prevailing_decls): Update. + 2014-07-12 Jan Hubicka <hubicka@ucw.cz> * lto.c (read_cgraph_and_symbols): Do not push DECL_INIT_IO diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index dc30884..5056915 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -775,7 +775,6 @@ mentions_vars_p_decl_non_common (tree t) { if (mentions_vars_p_decl_with_vis (t)) return true; - CHECK_NO_VAR (DECL_ARGUMENT_FLD (t)); CHECK_NO_VAR (DECL_RESULT_FLD (t)); return false; } @@ -787,6 +786,7 @@ mentions_vars_p_function (tree t) { if (mentions_vars_p_decl_non_common (t)) return true; + CHECK_NO_VAR (DECL_ARGUMENTS (t)); CHECK_NO_VAR (DECL_VINDEX (t)); CHECK_VAR (DECL_FUNCTION_PERSONALITY (t)); return false; @@ -2711,11 +2711,11 @@ lto_fixup_prevailing_decls (tree t) } if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON)) { - LTO_NO_PREVAIL (DECL_ARGUMENT_FLD (t)); LTO_NO_PREVAIL (DECL_RESULT_FLD (t)); } if (CODE_CONTAINS_STRUCT (code, TS_FUNCTION_DECL)) { + LTO_NO_PREVAIL (DECL_ARGUMENTS (t)); LTO_SET_PREVAIL (DECL_FUNCTION_PERSONALITY (t)); LTO_NO_PREVAIL (DECL_VINDEX (t)); } diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index b1f3d9e..b9b1fdc 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,21 @@ +2014-07-14 Jan Hubicka <hubicka@ucw.cz> + + * objc-act.c (objc_common_tree_size): New function. + * objc-act.h (KEYWORD_KEY_NAME, KEYWORD_ARG_NAME): Add type + checking. + (INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK): New macro. + (METHOD_SEL_NAME, METHOD_SEL_ARGS, METHOD_ADD_ARGS, + METHOD_ADD_ARGS_ELLIPSIS_P, METHOD_DEFINITION, METHOD_ENCODING, + METHOD_TYPE_ATTRIBUTES, METHOD_PROPERTY_CONTEXT): Add type checking. + (METHOD_SEL_ARGS): Use decl_common.size instead of + decl_non_common.result. + (PROPERTY_NAME, PROPERTY_GETTER_NAME, PROPERTY_SETTER_NAME, + PROPERTY_READONLY, PROPERTY_NONATOMIC, PROPERTY_ASSIGN_SEMANTICS, + PROPERTY_IVAR_NAME, PROPERTY_DYNAMIC, PROPERTY_HAS_NO_GETTER, + PROPERTY_HAS_NO_SETTER, PROPERTY_OPTIONAL): Add type checking. + (objc_common_tree_size): Declare. + * objc-lang.c (LANG_HOOKS_TREE_SIZE): New macro. + 2014-06-24 Jan Hubicka <hubicka@ucw.cz> * objc-act.c (objc_xref_basetypes): Set TYPE_BINFO of type variants, diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index ef11052..16a015b 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -10115,4 +10115,21 @@ objc_common_init_ts (void) MARK_TS_TYPED (PROPERTY_REF); } +size_t +objc_common_tree_size (enum tree_code code) +{ + switch (code) + { + case CLASS_METHOD_DECL: + case INSTANCE_METHOD_DECL: + case KEYWORD_DECL: + case PROPERTY_DECL: + return sizeof (struct tree_decl_non_common); + default: + gcc_unreachable (); + + } +} + + #include "gt-objc-objc-act.h" diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h index 7e1e265..cb01e1a 100644 --- a/gcc/objc/objc-act.h +++ b/gcc/objc/objc-act.h @@ -38,18 +38,29 @@ void objc_common_init_ts (void); #define OBJC_INFO_SLOT_ELTS 2 /* KEYWORD_DECL */ -#define KEYWORD_KEY_NAME(DECL) ((DECL)->decl_minimal.name) -#define KEYWORD_ARG_NAME(DECL) ((DECL)->decl_non_common.arguments) +#define KEYWORD_KEY_NAME(DECL) (KEYWORD_DECL_CHECK (DECL)->decl_minimal.name) +#define KEYWORD_ARG_NAME(DECL) (KEYWORD_DECL_CHECK (DECL)->decl_common.size) + +#define INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK(NODE) \ + TREE_CHECK2(NODE,INSTANCE_METHOD_DECL,CLASS_METHOD_DECL) /* INSTANCE_METHOD_DECL, CLASS_METHOD_DECL */ -#define METHOD_SEL_NAME(DECL) ((DECL)->decl_minimal.name) -#define METHOD_SEL_ARGS(DECL) ((DECL)->decl_non_common.arguments) -#define METHOD_ADD_ARGS(DECL) ((DECL)->decl_non_common.result) -#define METHOD_ADD_ARGS_ELLIPSIS_P(DECL) ((DECL)->decl_common.lang_flag_0) -#define METHOD_DEFINITION(DECL) ((DECL)->decl_common.initial) -#define METHOD_ENCODING(DECL) ((DECL)->decl_minimal.context) -#define METHOD_TYPE_ATTRIBUTES(DECL) ((DECL)->decl_common.abstract_origin) -#define METHOD_PROPERTY_CONTEXT(DECL) ((DECL)->decl_common.size_unit) +#define METHOD_SEL_NAME(DECL) \ + (INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK (DECL)->decl_minimal.name) +#define METHOD_SEL_ARGS(DECL) \ + (INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK (DECL)->decl_common.size) +#define METHOD_ADD_ARGS(DECL) \ + (INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK (DECL)->decl_non_common.result) +#define METHOD_ADD_ARGS_ELLIPSIS_P(DECL) \ + (INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK (DECL)->decl_common.lang_flag_0) +#define METHOD_DEFINITION(DECL) \ + (INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK (DECL)->decl_common.initial) +#define METHOD_ENCODING(DECL) \ + (INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK (DECL)->decl_minimal.context) +#define METHOD_TYPE_ATTRIBUTES(DECL) \ + (INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK (DECL)->decl_common.abstract_origin) +#define METHOD_PROPERTY_CONTEXT(DECL) \ + (INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK (DECL)->decl_common.size_unit) /* PROPERTY_DECL. A PROPERTY_DECL repesents a @property declaration @@ -65,19 +76,24 @@ void objc_common_init_ts (void); valid getter/setter. */ /* PROPERTY_NAME is the name of the property. */ -#define PROPERTY_NAME(DECL) DECL_NAME(DECL) +#define PROPERTY_NAME(DECL) \ + DECL_NAME(PROPERTY_DECL_CHECK (DECL)) /* PROPERTY_GETTER_NAME is the identifier of the getter method. */ -#define PROPERTY_GETTER_NAME(DECL) ((DECL)->decl_non_common.arguments) +#define PROPERTY_GETTER_NAME(DECL)\ + (PROPERTY_DECL_CHECK (DECL)->decl_common.size) /* PROPERTY_SETTER_NAME is the identifier of the setter method. */ -#define PROPERTY_SETTER_NAME(DECL) ((DECL)->decl_non_common.result) +#define PROPERTY_SETTER_NAME(DECL) \ + (PROPERTY_DECL_CHECK (DECL)->decl_non_common.result) /* PROPERTY_READONLY can be 0 or 1. */ -#define PROPERTY_READONLY(DECL) DECL_LANG_FLAG_0 (DECL) +#define PROPERTY_READONLY(DECL) \ + DECL_LANG_FLAG_0 (PROPERTY_DECL_CHECK (DECL)) /* PROPERTY_NONATOMIC can be 0 or 1. */ -#define PROPERTY_NONATOMIC(DECL) DECL_LANG_FLAG_1 (DECL) +#define PROPERTY_NONATOMIC(DECL) \ + DECL_LANG_FLAG_1 (PROPERTY_DECL_CHECK (DECL)) typedef enum objc_property_assign_semantics { OBJC_PROPERTY_ASSIGN = 1, @@ -89,31 +105,37 @@ typedef enum objc_property_assign_semantics { OBJC_PROPERTY_RETAIN or OBJC_PROPERTY_COPY. We need an integer to store it, so we hijack the alignment, that properties don't have. */ -#define PROPERTY_ASSIGN_SEMANTICS(DECL) ((DECL)->decl_common.align) +#define PROPERTY_ASSIGN_SEMANTICS(DECL) \ + (PROPERTY_DECL_CHECK (DECL)->decl_common.align) /* PROPERTY_IVAR_NAME is the identifier of the instance variable. This is set only if the PROPERTY_DECL represents a @synthesize; otherwise, it is set to TREE_NULL. */ -#define PROPERTY_IVAR_NAME(DECL) ((DECL)->decl_common.initial) +#define PROPERTY_IVAR_NAME(DECL) \ + (PROPERTY_DECL_CHECK (DECL)->decl_common.initial) /* PROPERTY_DYNAMIC can be 0 or 1. This is 1 if the PROPERTY_DECL represents a @dynamic; otherwise, it is set to 0. */ -#define PROPERTY_DYNAMIC(DECL) DECL_LANG_FLAG_2 (DECL) +#define PROPERTY_DYNAMIC(DECL) \ + DECL_LANG_FLAG_2 (PROPERTY_DECL_CHECK (DECL)) /* PROPERTY_HAS_NO_GETTER can be 0 or 1. Normally it is 0, but if this is an artificial PROPERTY_DECL that we generate even without a getter, it is set to 1. */ -#define PROPERTY_HAS_NO_GETTER(DECL) DECL_LANG_FLAG_3 (DECL) +#define PROPERTY_HAS_NO_GETTER(DECL) \ + DECL_LANG_FLAG_3 (PROPERTY_DECL_CHECK (DECL)) /* PROPERTY_HAS_NO_SETTER can be 0 or 1. Normally it is 0, but if this is an artificial PROPERTY_DECL that we generate even without a setter, it is set to 1. */ -#define PROPERTY_HAS_NO_SETTER(DECL) DECL_LANG_FLAG_4 (DECL) +#define PROPERTY_HAS_NO_SETTER(DECL) \ + DECL_LANG_FLAG_4 (PROPERTY_DECL_CHECK (DECL)) /* PROPERTY_OPTIONAL can be 0 or 1. Normally it is 0, but if this is a property declared as @optional in a @protocol, then it is set to 1. */ -#define PROPERTY_OPTIONAL(DECL) DECL_LANG_FLAG_5 (DECL) +#define PROPERTY_OPTIONAL(DECL) \ + DECL_LANG_FLAG_5 (PROPERTY_DECL_CHECK (DECL)) /* PROPERTY_REF. A PROPERTY_REF represents an 'object.property' expression. It is normally used for property access, but when @@ -693,6 +715,9 @@ struct objc_try_context extern tree objc_create_temporary_var (tree, const char *); +size_t objc_common_tree_size (enum tree_code code); + + #define objc_is_object_id(TYPE) (OBJC_TYPE_NAME (TYPE) == objc_object_id) #define objc_is_class_id(TYPE) (OBJC_TYPE_NAME (TYPE) == objc_class_id) diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c index c9c5a29..ba06f46 100644 --- a/gcc/objc/objc-lang.c +++ b/gcc/objc/objc-lang.c @@ -49,6 +49,8 @@ enum c_language_kind c_language = clk_objc; #define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr #undef LANG_HOOKS_INIT_TS #define LANG_HOOKS_INIT_TS objc_common_init_ts +#undef LANG_HOOKS_TREE_SIZE +#define LANG_HOOKS_TREE_SIZE objc_common_tree_size /* Each front end provides its own lang hook initializer. */ struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 91d88c2..eee0df9 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -514,7 +514,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent) } if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON)) { - print_node (file, "arguments", DECL_ARGUMENT_FLD (node), indent + 4); print_node (file, "result", DECL_RESULT_FLD (node), indent + 4); } @@ -540,6 +539,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent) else if (code == FUNCTION_DECL && DECL_STRUCT_FUNCTION (node) != 0) { + print_node (file, "arguments", DECL_ARGUMENTS (node), indent + 4); indent_to (file, indent + 4); dump_addr (file, "struct-function ", DECL_STRUCT_FUNCTION (node)); } diff --git a/gcc/tree-core.h b/gcc/tree-core.h index 78067d5..34c48fa 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -1494,8 +1494,6 @@ struct GTY(()) tree_var_decl { struct GTY(()) tree_decl_non_common { struct tree_decl_with_vis common; - /* C++ uses this in templates. */ - tree arguments; /* Almost all FE's use this. */ tree result; }; @@ -1510,6 +1508,8 @@ struct GTY(()) tree_function_decl { struct function *f; + /* Arguments of the function. */ + tree arguments; /* The personality function. Used for stack unwinding. */ tree personality; @@ -707,8 +707,14 @@ tree_code_size (enum tree_code code) return sizeof (struct tree_function_decl); case DEBUG_EXPR_DECL: return sizeof (struct tree_decl_with_rtl); - default: + case TRANSLATION_UNIT_DECL: + return sizeof (struct tree_translation_unit_decl); + case NAMESPACE_DECL: + case IMPORTED_DECL: + case NAMELIST_DECL: return sizeof (struct tree_decl_non_common); + default: + return lang_hooks.tree_size (code); } } @@ -5304,7 +5310,6 @@ find_decls_types_r (tree *tp, int *ws, void *data) } else if (TREE_CODE (t) == TYPE_DECL) { - fld_worklist_push (DECL_ARGUMENT_FLD (t), fld); fld_worklist_push (DECL_ORIGINAL_TYPE (t), fld); } else if (TREE_CODE (t) == FIELD_DECL) @@ -2621,13 +2621,9 @@ extern vec<tree, va_gc> **decl_debug_args_insert (tree); #define DECL_BUILT_IN_CLASS(NODE) \ (FUNCTION_DECL_CHECK (NODE)->function_decl.built_in_class) -/* In FUNCTION_DECL, a chain of ..._DECL nodes. - VAR_DECL and PARM_DECL reserve the arguments slot for language-specific - uses. */ +/* In FUNCTION_DECL, a chain of ..._DECL nodes. */ #define DECL_ARGUMENTS(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments) -#define DECL_ARGUMENT_FLD(NODE) \ - (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments) + (FUNCTION_DECL_CHECK (NODE)->function_decl.arguments) /* In FUNCTION_DECL, the function specific target options to use when compiling this function. */ |