+2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
+
+ * c-decl.c (union lang_tree_node): Check for TS_COMMON before
+ calling TREE_CHAIN.
+ * print-tree.c (print_node): Likewise.
+ * tree-inline.c (copy_tree_r): Likewise.
+ * c-lang.c (LANG_HOOKS_INIT_TS): Define.
+ * lto-streamer-in.c (lto_input_tree_pointers): Check for TS_TYPED
+ instead of TS_COMMON.
+ * lto-streamer-out.c (lto_output_tree_pointers): Likewise.
+ * tree.c (initialize_tree_contains_struct): Handle TS_TYPED.
+ (copy_node_stat): Zero TREE_CHAIN only if necessary.
+ (MARK_TS_BASE, MARK_TS_TYPED, MARK_TS_COMMON): Move these...
+ (MARK_TS_DECL_COMMON, MARK_TS_DECL_COMMON, MARK_TS_DECL_WRTL):
+ ...and these...
+ (MARK_TS_DECL_WITH_VIS, MARK_TS_DECL_NON_COMMON): ...and these...
+ * tree.h: ...here.
+ (TREE_CHAIN): Check for a TS_COMMON structure.
+ (TREE_TYPE): Check for a TS_TYPED structure.
+
2011-04-12 Pat Haugen <pthaugen@us.ibm.com>
* config/rs6000/rs6000.c (call_ABI_of_interest): Call
+2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
+
+ * gcc-interface/ada-tree.h (union lang_tree_node): Check for
+ TS_COMMON before calling TREE_CHAIN.
+ * gcc-interface/misc.c (gnat_init_ts): New function.
+ (LANG_HOOKS_INIT_TS): Define.
+
2011-04-12 Martin Jambor <mjambor@suse.cz>
* gcc-interface/utils.c (end_subprog_body): Call
/* The resulting tree type. */
union GTY((desc ("0"),
- chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
+ chain_next ("CODE_CONTAINS_STRUCT (TREE_CODE (&%h.generic), TS_COMMON) ? ((union lang_tree_node *) TREE_CHAIN (&%h.generic)) : NULL")))
lang_tree_node
{
union tree_node GTY((tag ("0"),
return gnat_eh_personality_decl;
}
+/* Initialize language-specific bits of tree_contains_struct. */
+
+static void
+gnat_init_ts (void)
+{
+ MARK_TS_COMMON (UNCONSTRAINED_ARRAY_TYPE);
+
+ MARK_TS_TYPED (UNCONSTRAINED_ARRAY_REF);
+ MARK_TS_TYPED (NULL_EXPR);
+ MARK_TS_TYPED (PLUS_NOMOD_EXPR);
+ MARK_TS_TYPED (MINUS_NOMOD_EXPR);
+ MARK_TS_TYPED (ATTR_ADDR_EXPR);
+ MARK_TS_TYPED (STMT_STMT);
+ MARK_TS_TYPED (LOOP_STMT);
+ MARK_TS_TYPED (EXIT_STMT);
+}
+
/* Definitions for our language-specific hooks. */
#undef LANG_HOOKS_NAME
#define LANG_HOOKS_EH_PERSONALITY gnat_eh_personality
#undef LANG_HOOKS_DEEP_UNSHARING
#define LANG_HOOKS_DEEP_UNSHARING true
+#undef LANG_HOOKS_INIT_TS
+#define LANG_HOOKS_INIT_TS gnat_init_ts
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
/* The resulting tree type. */
union GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
- chain_next ("TREE_CODE (&%h.generic) == INTEGER_TYPE ? (union lang_tree_node *) TYPE_NEXT_VARIANT (&%h.generic) : ((union lang_tree_node *) TREE_CHAIN (&%h.generic))"))) lang_tree_node
+ chain_next ("TREE_CODE (&%h.generic) == INTEGER_TYPE ? (union lang_tree_node *) TYPE_NEXT_VARIANT (&%h.generic) : CODE_CONTAINS_STRUCT (TREE_CODE (&%h.generic), TS_COMMON) ? ((union lang_tree_node *) TREE_CHAIN (&%h.generic)) : NULL"))) lang_tree_node
{
union tree_node GTY ((tag ("0"),
desc ("tree_node_structure (&%h)")))
+2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
+
+ * c-common.h (c_common_init_ts): Declare.
+ * c-common.c (c_common_init_ts): Define.
+
2011-04-12 Nicola Pero <nicola.pero@meta-innovation.com>
* c-objc.h (objc_build_message_expr): Updated prototype.
}
}
+/* Initialize language-specific-bits of tree_contains_struct. */
+
+void
+c_common_init_ts (void)
+{
+ MARK_TS_TYPED (C_MAYBE_CONST_EXPR);
+ MARK_TS_TYPED (EXCESS_PRECISION_EXPR);
+}
+
#include "gt-c-family-c-common.h"
extern tree c_common_unsigned_type (tree);
extern tree c_common_signed_type (tree);
extern tree c_common_signed_or_unsigned_type (int, tree);
+extern void c_common_init_ts (void);
extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int);
extern bool decl_with_nonnull_addr_p (const_tree);
extern tree c_fully_fold (tree, bool, bool *);
#define LANG_HOOKS_NAME "GNU C"
#undef LANG_HOOKS_INIT
#define LANG_HOOKS_INIT c_objc_common_init
+#undef LANG_HOOKS_INIT_TS
+#define LANG_HOOKS_INIT_TS c_common_init_ts
/* Each front end provides its own lang hook initializer. */
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
+2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
+
+ * cp-lang.c (cp_init_ts): Call cp_common_init_ts. Move
+ tree_contains_struct initialization to...
+ * cp-objcp-common.c (cp_common_init_ts): ...here. Use MARK_*
+ macros.
+ * cp-objcp-common.h (cp_common_init_ts): Declare.
+ * cp-tree.h (union lang_tree_node): Check for TS_COMMON before
+ calling TREE_CHAIN.
+
2011-04-12 Nicola Pero <nicola.pero@meta-innovation.com>
* parser.c (cp_parser_objc_message_expression): Updated call
return NULL_TREE;
}
-
static void
cp_init_ts (void)
{
- tree_contains_struct[NAMESPACE_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[USING_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[TEMPLATE_DECL][TS_DECL_NON_COMMON] = 1;
-
- tree_contains_struct[NAMESPACE_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[USING_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[TEMPLATE_DECL][TS_DECL_WITH_VIS] = 1;
-
- tree_contains_struct[NAMESPACE_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[USING_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[TEMPLATE_DECL][TS_DECL_WRTL] = 1;
-
- tree_contains_struct[NAMESPACE_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[USING_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[TEMPLATE_DECL][TS_DECL_COMMON] = 1;
-
- tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[USING_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[TEMPLATE_DECL][TS_DECL_MINIMAL] = 1;
+ cp_common_init_ts ();
init_shadowed_var_for_decl ();
-
}
static const char *
tree_decl_map_eq, 0);
}
+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_COMMON (TEMPLATE_TEMPLATE_PARM);
+ MARK_TS_COMMON (TEMPLATE_TYPE_PARM);
+ MARK_TS_COMMON (TEMPLATE_PARM_INDEX);
+ MARK_TS_COMMON (OVERLOAD);
+ MARK_TS_COMMON (TEMPLATE_INFO);
+ MARK_TS_COMMON (FOR_STMT);
+ MARK_TS_COMMON (TYPENAME_TYPE);
+ MARK_TS_COMMON (TYPEOF_TYPE);
+ MARK_TS_COMMON (IF_STMT);
+ MARK_TS_COMMON (BASELINK);
+ MARK_TS_COMMON (SWITCH_STMT);
+ MARK_TS_COMMON (TYPE_PACK_EXPANSION);
+ MARK_TS_COMMON (EXPR_PACK_EXPANSION);
+ MARK_TS_COMMON (DECLTYPE_TYPE);
+ MARK_TS_COMMON (BOUND_TEMPLATE_TEMPLATE_PARM);
+ MARK_TS_COMMON (UNBOUND_CLASS_TEMPLATE);
+ MARK_TS_COMMON (RANGE_FOR_STMT);
+
+ MARK_TS_TYPED (AGGR_INIT_EXPR);
+ MARK_TS_TYPED (EXPR_STMT);
+ MARK_TS_TYPED (EH_SPEC_BLOCK);
+ MARK_TS_TYPED (CLEANUP_STMT);
+ MARK_TS_TYPED (SCOPE_REF);
+ MARK_TS_TYPED (CAST_EXPR);
+ MARK_TS_TYPED (NON_DEPENDENT_EXPR);
+ MARK_TS_TYPED (MODOP_EXPR);
+ MARK_TS_TYPED (TRY_BLOCK);
+ MARK_TS_TYPED (THROW_EXPR);
+ MARK_TS_TYPED (HANDLER);
+ MARK_TS_TYPED (REINTERPRET_CAST_EXPR);
+ MARK_TS_TYPED (CONST_CAST_EXPR);
+ MARK_TS_TYPED (STATIC_CAST_EXPR);
+ MARK_TS_TYPED (DYNAMIC_CAST_EXPR);
+ MARK_TS_TYPED (TEMPLATE_ID_EXPR);
+ MARK_TS_TYPED (ARROW_EXPR);
+ MARK_TS_TYPED (SIZEOF_EXPR);
+ MARK_TS_TYPED (ALIGNOF_EXPR);
+ MARK_TS_TYPED (AT_ENCODE_EXPR);
+ MARK_TS_TYPED (UNARY_PLUS_EXPR);
+ MARK_TS_TYPED (TRAIT_EXPR);
+ MARK_TS_TYPED (TYPE_ARGUMENT_PACK);
+ MARK_TS_TYPED (NOEXCEPT_EXPR);
+ MARK_TS_TYPED (NONTYPE_ARGUMENT_PACK);
+ MARK_TS_TYPED (WHILE_STMT);
+ MARK_TS_TYPED (NEW_EXPR);
+ MARK_TS_TYPED (VEC_NEW_EXPR);
+ MARK_TS_TYPED (BREAK_STMT);
+ MARK_TS_TYPED (MEMBER_REF);
+ MARK_TS_TYPED (DOTSTAR_EXPR);
+ MARK_TS_TYPED (DO_STMT);
+ MARK_TS_TYPED (DELETE_EXPR);
+ MARK_TS_TYPED (VEC_DELETE_EXPR);
+ MARK_TS_TYPED (CONTINUE_STMT);
+ MARK_TS_TYPED (TAG_DEFN);
+ MARK_TS_TYPED (PSEUDO_DTOR_EXPR);
+ MARK_TS_TYPED (TYPEID_EXPR);
+ MARK_TS_TYPED (MUST_NOT_THROW_EXPR);
+ MARK_TS_TYPED (STMT_EXPR);
+ MARK_TS_TYPED (OFFSET_REF);
+ MARK_TS_TYPED (OFFSETOF_EXPR);
+ MARK_TS_TYPED (PTRMEM_CST);
+ MARK_TS_TYPED (EMPTY_CLASS_EXPR);
+ MARK_TS_TYPED (VEC_INIT_EXPR);
+ MARK_TS_TYPED (USING_STMT);
+ MARK_TS_TYPED (LAMBDA_EXPR);
+}
#include "gt-cp-cp-objcp-common.h"
tree, bool);
extern bool cp_function_decl_explicit_p (tree decl);
+extern void cp_common_init_ts (void);
/* Lang hooks that are shared between C++ and ObjC++ are defined here. Hooks
specific to C++ or ObjC++ go in cp/cp-lang.c and objcp/objcp-lang.c,
/* The resulting tree type. */
union GTY((desc ("cp_tree_node_structure (&%h)"),
- chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)"))) lang_tree_node {
+ chain_next ("CODE_CONTAINS_STRUCT (TREE_CODE (&%h.generic), TS_COMMON) ? ((union lang_tree_node *) TREE_CHAIN (&%h.generic)) : NULL"))) lang_tree_node {
union tree_node GTY ((tag ("TS_CP_GENERIC"),
desc ("tree_node_structure (&%h)"))) generic;
struct template_parm_index_s GTY ((tag ("TS_CP_TPI"))) tpi;
+2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
+
+ * f95-lang.c (union lang_tree_node): Check for TS_COMMON before
+ calling TREE_CHAIN.
+
2011-04-12 Paul Thomas <pault@gcc.gnu.org>
PR fortran/48360
/* The resulting tree type. */
union GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
- chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
+ chain_next ("CODE_CONTAINS_STRUCT (TREE_CODE (&%h.generic), TS_COMMON) ? ((union lang_tree_node *) TREE_CHAIN (&%h.generic)) : NULL")))
lang_tree_node {
union tree_node GTY((tag ("0"),
+2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
+
+ * go-lang.c (union lang_tree_node): Check for TS_COMMON before
+ calling TREE_CHAIN.
+
2011-04-06 Ian Lance Taylor <iant@google.com>
* go-gcc.cc (if_statement): Use build3_loc.
/* The resulting tree type. */
union GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
- chain_next ("(union lang_tree_node *) TREE_CHAIN (&%h.generic)")))
+ chain_next ("CODE_CONTAINS_STRUCT (TREE_CODE (&%h.generic), TS_COMMON) ? ((union lang_tree_node *) TREE_CHAIN (&%h.generic)) : NULL")))
lang_tree_node
{
union tree_node GTY((tag ("0"),
+2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
+
+ * java-tree.h (union lang_tree_node): Check for TS_COMMON before
+ calling TREE_CHAIN.
+
2011-04-11 Martin Jambor <mjambor@suse.cz>
* decl.c (java_mark_decl_local): Call cgraph_get_node instead of
/* The resulting tree type. */
union GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
- chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
+ chain_next ("CODE_CONTAINS_STRUCT (TREE_CODE (&%h.generic), TS_COMMON) ? ((union lang_tree_node *) TREE_CHAIN (&%h.generic)) : NULL")))
lang_tree_node {
union tree_node GTY ((tag ("0"),
code = TREE_CODE (expr);
- if (CODE_CONTAINS_STRUCT (code, TS_COMMON))
+ if (CODE_CONTAINS_STRUCT (code, TS_TYPED))
lto_input_ts_common_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_VECTOR))
code = TREE_CODE (expr);
- if (CODE_CONTAINS_STRUCT (code, TS_COMMON))
+ if (CODE_CONTAINS_STRUCT (code, TS_TYPED))
lto_output_ts_common_tree_pointers (ob, expr, ref_p);
if (CODE_CONTAINS_STRUCT (code, TS_VECTOR))
+2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
+
+ * lto-tree.h (union lang_tree_node): Check for TS_COMMON before
+ calling TREE_CHAIN.
+ * lto.c (lto_fixup_common): Likewise.
+
2011-04-08 Nathan Froyd <froydnj@codesourcery.com>
* lto-lang.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES.
};
union GTY((desc ("lto_tree_node_structure (&%h)"),
- chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
+ chain_next ("CODE_CONTAINS_STRUCT (TREE_CODE (&%h.generic), TS_COMMON) ? ((union lang_tree_node *) TREE_CHAIN (&%h.generic)) : NULL")))
lang_tree_node
{
union tree_node GTY ((tag ("TS_LTO_GENERIC"),
/* This is not very efficient because we cannot do tail-recursion with
a long chain of trees. */
- LTO_FIXUP_SUBTREE (TREE_CHAIN (t));
+ if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_COMMON))
+ LTO_FIXUP_SUBTREE (TREE_CHAIN (t));
}
/* Fix up fields of a decl_minimal T. DATA points to fix-up states. */
+2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
+
+ * objc-lang.c (objc_init_ts): Move code for this function...
+ * objc-act.c (objc_common_init_ts): ...here. Define.
+ * objc-act.h (objc_common_init_ts): Declare.
+
2011-04-12 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (objc_build_message_expr): Accept two arguments
return get_identifier (string);
}
+void
+objc_common_init_ts (void)
+{
+ c_common_init_ts ();
+
+ MARK_TS_DECL_NON_COMMON (CLASS_METHOD_DECL);
+ MARK_TS_DECL_NON_COMMON (INSTANCE_METHOD_DECL);
+ MARK_TS_DECL_NON_COMMON (KEYWORD_DECL);
+ MARK_TS_DECL_NON_COMMON (PROPERTY_DECL);
+
+ MARK_TS_COMMON (CLASS_INTERFACE_TYPE);
+ MARK_TS_COMMON (PROTOCOL_INTERFACE_TYPE);
+ MARK_TS_COMMON (CLASS_IMPLEMENTATION_TYPE);
+
+ MARK_TS_TYPED (MESSAGE_SEND_EXPR);
+ MARK_TS_TYPED (PROPERTY_REF);
+}
+
#include "gt-objc-objc-act.h"
const char *objc_printable_name (tree, int);
tree objc_fold_obj_type_ref (tree, tree);
int objc_gimplify_expr (tree *, gimple_seq *, gimple_seq *);
+void objc_common_init_ts (void);
/* NB: The remaining public functions are prototyped in c-common.h, for the
benefit of stub-objc.c and objc-act.c. */
#include "c-lang.h"
enum c_language_kind c_language = clk_objc;
-static void objc_init_ts (void);
/* Lang hooks common to C and ObjC are declared in c-objc-common.h;
consequently, there should be very few hooks below. */
#undef LANG_HOOKS_GIMPLIFY_EXPR
#define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr
#undef LANG_HOOKS_INIT_TS
-#define LANG_HOOKS_INIT_TS objc_init_ts
+#define LANG_HOOKS_INIT_TS objc_common_init_ts
/* Each front end provides its own lang hook initializer. */
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
/* Lang hook routines common to C and ObjC appear in c-objc-common.c;
there should be very few (if any) routines below. */
-static void
-objc_init_ts (void)
-{
- tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[KEYWORD_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[PROPERTY_DECL][TS_DECL_NON_COMMON] = 1;
-
- tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[KEYWORD_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[PROPERTY_DECL][TS_DECL_WITH_VIS] = 1;
-
- tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[KEYWORD_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[PROPERTY_DECL][TS_DECL_WRTL] = 1;
-
- tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[KEYWORD_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[PROPERTY_DECL][TS_DECL_MINIMAL] = 1;
-
- tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[KEYWORD_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[PROPERTY_DECL][TS_DECL_COMMON] = 1;
-}
-
#include "gtype-objc.h"
+2011-04-12 Nathan Froyd <froydnj@codesourcery.com>
+
+ * objcp-lang.c (objcxx_init_ts): Call objc_common_init_ts and
+ cp_common_init_ts.
+
2011-03-21 Nicola Pero <nicola.pero@meta-innovation.com>
PR bootstrap/48167
static void
objcxx_init_ts (void)
{
- /* objc decls */
- tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[KEYWORD_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[PROPERTY_DECL][TS_DECL_NON_COMMON] = 1;
-
- tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[KEYWORD_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[PROPERTY_DECL][TS_DECL_WITH_VIS] = 1;
-
- tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[KEYWORD_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[PROPERTY_DECL][TS_DECL_WRTL] = 1;
-
- tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[KEYWORD_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[PROPERTY_DECL][TS_DECL_MINIMAL] = 1;
-
- tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[KEYWORD_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[PROPERTY_DECL][TS_DECL_COMMON] = 1;
-
- /* C++ decls */
- tree_contains_struct[NAMESPACE_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[USING_DECL][TS_DECL_NON_COMMON] = 1;
- tree_contains_struct[TEMPLATE_DECL][TS_DECL_NON_COMMON] = 1;
-
- tree_contains_struct[NAMESPACE_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[USING_DECL][TS_DECL_WITH_VIS] = 1;
- tree_contains_struct[TEMPLATE_DECL][TS_DECL_WITH_VIS] = 1;
-
- tree_contains_struct[NAMESPACE_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[USING_DECL][TS_DECL_WRTL] = 1;
- tree_contains_struct[TEMPLATE_DECL][TS_DECL_WRTL] = 1;
-
- tree_contains_struct[NAMESPACE_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[USING_DECL][TS_DECL_COMMON] = 1;
- tree_contains_struct[TEMPLATE_DECL][TS_DECL_COMMON] = 1;
-
- tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[USING_DECL][TS_DECL_MINIMAL] = 1;
- tree_contains_struct[TEMPLATE_DECL][TS_DECL_MINIMAL] = 1;
+ objc_common_init_ts ();
+ cp_common_init_ts ();
init_shadowed_var_for_decl ();
}
print_node (file, temp, TREE_OPERAND (node, i), indent + 4);
}
}
- print_node (file, "chain", TREE_CHAIN (node), indent + 4);
+ if (CODE_CONTAINS_STRUCT (code, TS_COMMON))
+ print_node (file, "chain", TREE_CHAIN (node), indent + 4);
break;
case tcc_constant:
here. */
tree chain = NULL_TREE, new_tree;
- chain = TREE_CHAIN (*tp);
+ if (CODE_CONTAINS_STRUCT (code, TS_COMMON))
+ chain = TREE_CHAIN (*tp);
/* Copy the node. */
new_tree = copy_node (*tp);
{
unsigned i;
-#define MARK_TS_BASE(C) \
- do { \
- tree_contains_struct[C][TS_BASE] = 1; \
- } while (0)
-
-#define MARK_TS_TYPED(C) \
- do { \
- MARK_TS_BASE (C); \
- tree_contains_struct[C][TS_TYPED] = 1; \
- } while (0)
-
-#define MARK_TS_COMMON(C) \
- do { \
- MARK_TS_TYPED (C); \
- tree_contains_struct[C][TS_COMMON] = 1; \
- } while (0)
-
-#define MARK_TS_DECL_MINIMAL(C) \
- do { \
- MARK_TS_COMMON (C); \
- tree_contains_struct[C][TS_DECL_MINIMAL] = 1; \
- } while (0)
-
-#define MARK_TS_DECL_COMMON(C) \
- do { \
- MARK_TS_DECL_MINIMAL (C); \
- tree_contains_struct[C][TS_DECL_COMMON] = 1; \
- } while (0)
-
-#define MARK_TS_DECL_WRTL(C) \
- do { \
- MARK_TS_DECL_COMMON (C); \
- tree_contains_struct[C][TS_DECL_WRTL] = 1; \
- } while (0)
-
-#define MARK_TS_DECL_WITH_VIS(C) \
- do { \
- MARK_TS_DECL_WRTL (C); \
- tree_contains_struct[C][TS_DECL_WITH_VIS] = 1; \
- } while (0)
-
-#define MARK_TS_DECL_NON_COMMON(C) \
- do { \
- MARK_TS_DECL_WITH_VIS (C); \
- tree_contains_struct[C][TS_DECL_NON_COMMON] = 1; \
- } while (0)
-
for (i = ERROR_MARK; i < LAST_AND_UNUSED_TREE_CODE; i++)
{
enum tree_code code;
/* Mark all the structures that TS is derived from. */
switch (ts_code)
{
- case TS_COMMON:
+ case TS_TYPED:
MARK_TS_BASE (code);
break;
+ case TS_COMMON:
+ MARK_TS_TYPED (code);
+ break;
+
case TS_INT_CST:
case TS_REAL_CST:
case TS_FIXED_CST:
gcc_assert (tree_contains_struct[FUNCTION_DECL][TS_FUNCTION_DECL]);
gcc_assert (tree_contains_struct[IMPORTED_DECL][TS_DECL_MINIMAL]);
gcc_assert (tree_contains_struct[IMPORTED_DECL][TS_DECL_COMMON]);
-
-#undef MARK_TS_BASE
-#undef MARK_TS_COMMON
-#undef MARK_TS_DECL_MINIMAL
-#undef MARK_TS_DECL_COMMON
-#undef MARK_TS_DECL_WRTL
-#undef MARK_TS_DECL_WITH_VIS
-#undef MARK_TS_DECL_NON_COMMON
}
}
\f
/* Return a new node with the same contents as NODE except that its
- TREE_CHAIN is zero and it has a fresh uid. */
+ TREE_CHAIN, if it has one, is zero and it has a fresh uid. */
tree
copy_node_stat (tree node MEM_STAT_DECL)
t = ggc_alloc_zone_tree_node_stat (&tree_zone, length PASS_MEM_STAT);
memcpy (t, node, length);
- TREE_CHAIN (t) = 0;
+ if (CODE_CONTAINS_STRUCT (code, TS_COMMON))
+ TREE_CHAIN (t) = 0;
TREE_ASM_WRITTEN (t) = 0;
TREE_VISITED (t) = 0;
if (code == VAR_DECL || code == PARM_DECL || code == RESULT_DECL)
extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
#define CODE_CONTAINS_STRUCT(CODE, STRUCT) (tree_contains_struct[(CODE)][(STRUCT)])
+/* Macros for initializing `tree_contains_struct'. */
+#define MARK_TS_BASE(C) \
+ do { \
+ tree_contains_struct[C][TS_BASE] = 1; \
+ } while (0)
+
+#define MARK_TS_TYPED(C) \
+ do { \
+ MARK_TS_BASE (C); \
+ tree_contains_struct[C][TS_TYPED] = 1; \
+ } while (0)
+
+#define MARK_TS_COMMON(C) \
+ do { \
+ MARK_TS_TYPED (C); \
+ tree_contains_struct[C][TS_COMMON] = 1; \
+ } while (0)
+
+#define MARK_TS_DECL_MINIMAL(C) \
+ do { \
+ MARK_TS_COMMON (C); \
+ tree_contains_struct[C][TS_DECL_MINIMAL] = 1; \
+ } while (0)
+
+#define MARK_TS_DECL_COMMON(C) \
+ do { \
+ MARK_TS_DECL_MINIMAL (C); \
+ tree_contains_struct[C][TS_DECL_COMMON] = 1; \
+ } while (0)
+
+#define MARK_TS_DECL_WRTL(C) \
+ do { \
+ MARK_TS_DECL_COMMON (C); \
+ tree_contains_struct[C][TS_DECL_WRTL] = 1; \
+ } while (0)
+
+#define MARK_TS_DECL_WITH_VIS(C) \
+ do { \
+ MARK_TS_DECL_WRTL (C); \
+ tree_contains_struct[C][TS_DECL_WITH_VIS] = 1; \
+ } while (0)
+
+#define MARK_TS_DECL_NON_COMMON(C) \
+ do { \
+ MARK_TS_DECL_WITH_VIS (C); \
+ tree_contains_struct[C][TS_DECL_NON_COMMON] = 1; \
+ } while (0)
+
/* Number of language-independent tree codes. */
#define NUM_TREE_CODES ((int) LAST_AND_UNUSED_TREE_CODE)
are chained together. */
#define TREE_CHAIN(NODE) __extension__ \
-(*({__typeof (NODE) const __t = (NODE); \
+(*({__typeof (NODE) const __t = CONTAINS_STRUCT_CHECK (NODE, TS_COMMON);\
&__t->common.chain; }))
/* In all nodes that are expressions, this is the data type of the expression.
In ARRAY_TYPE nodes, this is the type of the elements.
In VECTOR_TYPE nodes, this is the type of the elements. */
#define TREE_TYPE(NODE) __extension__ \
-(*({__typeof (NODE) const __t = (NODE); \
+(*({__typeof (NODE) const __t = CONTAINS_STRUCT_CHECK (NODE, TS_TYPED); \
&__t->typed.type; }))
extern void tree_contains_struct_check_failed (const_tree,