diff options
author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-08 23:37:11 +0000 |
---|---|---|
committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-08 23:37:11 +0000 |
commit | 5ded8c6f262065518f04c441d1ea847fa38c5b38 (patch) | |
tree | e8e5667e9ce5aa5fc7514d5caa37a74c88e3f391 /gcc/tree.h | |
parent | 6c3c4d74d98659fda5994e5b843fa6b6842ce8aa (diff) | |
download | gcc-5ded8c6f262065518f04c441d1ea847fa38c5b38.tar.gz |
2005-07-08 Daniel Berlin <dberlin@dberlin.org>
* Makefile.in (TREE_H): Add treestruct.def.
(c-decl.o): Add pointer-set.h
* c-decl.c (diagnose_mismatched_decls): Don't attempt to look at
visibility on regular DECL's.
(merge_decls): Fix the copying of decl nodes of various types for
the new structures. Don't update RTL, section name, weak status,
etc, on DECL's without RTL.
(grokdeclarator): DECL_ARG_TYPE_AS_WRITTEN is gone.
Don't check volatile on non-variable types.
(store_parm_decls_oldstyle): Use pointer_set instead of DECL_WEAK
to check whether we have seen arguments.
* c-objc-common.c (c_tree_printer): Reverse order of tests so that
flag is checked before field (flag is common, field is not).
* dwarf2out.c (decl_ultimate_origin): Only DECL's with
TS_DECL_COMMON could have an origin.
(add_location_or_const_value_attribute): Don't check section name
on non-var/function decls.
(dwarf2out_var_location): Reverse order of tests.
* emit-rtl.c (set_reg_attrs_for_parm): DECL_CHECK is dead, replace
with DECL_WRTL_CHECK.
* expmed.c (make_tree): rtl is now in decl_with_rtl.
* fold-const.c (fold_binary): Don't check weakness on
non-var/function decls.
(tree_expr_nonzero_p): Ditto.
(fold_checksum_tree): Use tree_decl_extra as sizeof
buffer.
* ggc-page.c (extra_order_size_table): Add sizes for
tree_decl_non_common, tree_parm_decl, tree_var_decl, and
tree_field_decl.
* gimplify.c (gimplify_bind_expr): Only set
DECL_SEEN_IN_BIND_EXPR_P on VAR_DECL.
* integrate.c (copy_decl_for_inlining): Don't set RTL on decl's
without RTL.
* langhooks-def.h (LANG_HOOK_INIT_TS): New.
* langhooks.h (init_ts). New langhook.
* passes.c (rest_of_decl_compilation): Reverse order of tests.
* print-tree.c (print_node): Update to only print fields that
exist in the structures the passed decl has.
* toplev.c (wrapup_global_declarations): Don't reset
DECL_DEFER_OUTPUT on DECL's that don't contain it.
* tree-browser.c (browse_tree): DECL_ARG_TYPE_AS_WRITTEN removed.
* tree-inline.c (remap_decl): Ditto.
* tree-outof-ssa.c (create_temp): Reverse order of tests.
* tree-pretty-print.c (print_declaration): Don't print
DECL_REGISTER on things that don't contain it.
* tree-vrp.c (expr_computes_nonzero): Don't check weakness on
non-var/function decls.
* tree.c (tree_contains_struct): New structure.
(init_priority_for_decl): New hashtable.
(tree_int_map): New structure.
(tree_int_map_eq): New function.
(tree_int_map_marked_p): Ditto.
(tree_int_map_hash): Ditto.
(tree_map): Move to tree.h.
(tree_map_eq): Externalize.
(tree_map_hash): Ditto.
(tree_map_marked_p): Ditto.
(init_ttree): Set up tree_contains_struct and call langhook.
(decl_assembler_name): Use DECL_NON_COMMON_CHECK..
(tree_code_size): Update for new structures.
(tree_node_structure): Update for new structures.
(make_node_stat): Don't try to set DECL_IN_SYSTEM_HEADER on decls
without the field.
(copy_node_stat): Copy init priority.
(build_decl_stat): Ditto for visibility.
(ts_enum_names): New.
(tree_contains_struct_check_failed): New function.
(decl_init_priority_lookup): Ditto.
(decl_init_priority_insert): Ditto.
* treestruct.def: New file.
* tree.h (CODE_CONTAINS_STRUCT): New macro.
(CONTAINS_STRUCT_CHECK): Ditto.
(tree_contains_struct_check_failed): New prototype.
(DECL_CHECK): Removed.
(DECL_MINIMAL_CHECK): New.
(DECL_COMMON_CHECK): Ditto.
(DECL_WRTL_CHECK): Ditto.
(DECL_NON_COMMON_CHECK): Ditto.
(DECL_WITH_VIS_CHECK): Ditto.
(VAR_OR_FUNCTION_DECL_P): Ditto
(struct tree_decl_minimal): New structure.
(struct tree_decl_common): Ditto.
(struct tree_decl_with_rtl): Ditto.
(struct tree_decl_with_vis): Ditto.
(struct tree_decl_non_common): Ditto.
(struct tree_field_decl): Ditto.
(struct tree_parm_decl): Ditto.
(struct tree_var_decl): Ditto.
(struct tree_function_decl): Ditto.
(struct tree_const_decl): Ditto.
(struct tree_result_decl): Ditto.
(union tree_node): Add new structures.
* var-tracking.c (track_expr_p): Reverse order of tests.
* doc/c-tree.texi: Add documentation on DECL node internal structure.
2005-07-08 Daniel Berlin <dberlin@dberlin.org>
* utils.c (create_param_decl): DECL_ARG_TYPE_AS_WRITTEN is
removed.
2005-07-08 Daniel Berlin <dberlin@dberlin.org>
* Make-lang.in: Add gt-cp-lang.h.
(cp-lang.o): Ditto.
* class.c (create_vtable_ptr): Stop setting DECL_ASSEMBLER_NAME on
the field.
* config-lang.in: Add cp-lang.c to gtfiles.
* cp-lang.c: Include hashtab.h.
(cp_init_ts): New function.
(LANG_HOOK_INIT_TS): Use macro.
(decl_shadowed_for_var_lookup): New function.
(decl_shadowed_for_var_insert): Ditto.
* cp-tree.h (THUNK_FUNCTION_CHECK): Use decl_common.
(NON_THUNK_FUNCTION_CHECK): Ditto.
(DECL_NAMESPACE_ASSOCIATIONS): Use decl_non_common.
(DECL_INIT_PRIORITY): Ditto.
(DECL_HAS_SHADOWED_FOR_VAR_P): Ditto.
(DECL_SHADOWED_FOR_VAR): Use hashtable.
(SET_DECL_SHADOWED_FOR_VAR): Ditto.
* decl.c (duplicate_decls): Update for new/updated structures.
(poplevel): Use SET_DECL_SHADOWED_FOR_VAR.
* decl2.c (start_static_initialization_or_destruction): Deal with
priority.
* pt.c (tsubst_decl): Check TS_DECL_WRTL before doing
SET_DECL_RTL.
* tree.c (handle_init_priority_attribute): Handle priority.
2005-07-08 Daniel Berlin <dberlin@dberlin.org>
* objc-act.c (objc_push_parm): DECL_ARG_TYPE_AS_WRITTEN is
removed.
* objc-act.h (KEYWORD_ARG_NAME): Use decl_non_common.
(KEYWORD_KEY_NAME): Use decl_minimal.
(METHOD_SEL_NAME): Ditto..
(METHOD_SEL_ARGS): Use decl_non_common.
(METHOD_ADD_ARGS): Ditto.
(METHOD_ADD_ARGS_ELLIPSIS_P): Use decl_common.
(METHOD_DEFINITION): Ditto.
(METHOD_ENCODING): Ditto.
* objc-lang.c: (objc_init_ts): New function.
2005-07-08 Daniel Berlin <dberlin@dberlin.org>
* trans-decl.c (create_function_arglist): DECL_ARG_TYPE_AS_WRITTEN
is removed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101799 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 1138 |
1 files changed, 658 insertions, 480 deletions
diff --git a/gcc/tree.h b/gcc/tree.h index 1d5567cfc79..eb9ebdcd05d 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -40,6 +40,9 @@ enum tree_code { #undef DEFTREECODE +extern unsigned char tree_contains_struct[256][64]; +#define CODE_CONTAINS_STRUCT(CODE, STRUCT) (tree_contains_struct[(CODE)][(STRUCT)]) + /* Number of language-independent tree codes. */ #define NUM_TREE_CODES ((int) LAST_AND_UNUSED_TREE_CODE) @@ -97,8 +100,14 @@ extern const enum tree_code_class tree_code_type[]; #define DECL_P(CODE)\ (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_declaration) +/* Nonzero if DECL represents a VAR_DECL or FUNCTION_DECL. */ + +#define VAR_OR_FUNCTION_DECL_P(DECL)\ + (TREE_CODE (DECL) == VAR_DECL || TREE_CODE (DECL) == FUNCTION_DECL) + /* Nonzero if CODE represents a INDIRECT_REF. Keep these checks in ascending code order. */ + #define INDIRECT_REF_P(CODE)\ (TREE_CODE (CODE) == INDIRECT_REF \ || TREE_CODE (CODE) == ALIGN_INDIRECT_REF \ @@ -433,6 +442,13 @@ struct tree_common GTY(()) TREE_NO_WARNING in ... any expr or decl node */ +#undef DEFTREESTRUCT +#define DEFTREESTRUCT(ENUM, NAME) ENUM, +enum tree_node_structure_enum { +#include "treestruct.def" + LAST_TS_ENUM +}; +#undef DEFTREESTRUCT /* Define accessors for the fields that all tree nodes have (though some fields are not used for all kinds of nodes). */ @@ -536,6 +552,13 @@ struct tree_common GTY(()) (CODE1), (CODE2), (CODE3), (CODE4), (CODE5), 0);\ __t; }) +#define CONTAINS_STRUCT_CHECK(T, STRUCT) __extension__ \ +({ const tree __t = (T); \ + if (tree_contains_struct[TREE_CODE(__t)][(STRUCT)] != 1) \ + tree_contains_struct_check_failed (__t, (STRUCT), __FILE__, __LINE__, \ + __FUNCTION__); \ + __t; }) + #define TREE_CLASS_CHECK(T, CLASS) __extension__ \ ({ const tree __t = (T); \ if (TREE_CODE_CLASS (TREE_CODE(__t)) != (CLASS)) \ @@ -612,6 +635,11 @@ struct tree_common GTY(()) __FILE__, __LINE__, __FUNCTION__); \ &__t->exp.operands[__i]; })) +extern void tree_contains_struct_check_failed (const tree, + const enum tree_node_structure_enum, + const char *, int, const char *) + ATTRIBUTE_NORETURN; + extern void tree_check_failed (const tree, const char *, int, const char *, ...) ATTRIBUTE_NORETURN; extern void tree_not_check_failed (const tree, const char *, int, const char *, @@ -631,6 +659,7 @@ extern void tree_operand_check_failed (int, enum tree_code, #else /* not ENABLE_TREE_CHECKING, or not gcc */ +#define CONTAINS_STRUCT_CHECK(T, ENUM) (T) #define TREE_CHECK(T, CODE) (T) #define TREE_NOT_CHECK(T, CODE) (T) #define TREE_CHECK2(T, CODE1, CODE2) (T) @@ -657,7 +686,11 @@ extern void tree_operand_check_failed (int, enum tree_code, #include "tree-check.h" #define TYPE_CHECK(T) TREE_CLASS_CHECK (T, tcc_type) -#define DECL_CHECK(T) TREE_CLASS_CHECK (T, tcc_declaration) +#define DECL_MINIMAL_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_MINIMAL) +#define DECL_COMMON_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_COMMON) +#define DECL_WRTL_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_WRTL) +#define DECL_WITH_VIS_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_WITH_VIS) +#define DECL_NON_COMMON_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_NON_COMMON) #define CST_CHECK(T) TREE_CLASS_CHECK (T, tcc_constant) #define STMT_CHECK(T) TREE_CLASS_CHECK (T, tcc_statement) #define FUNC_OR_METHOD_CHECK(T) TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE) @@ -946,7 +979,7 @@ extern void tree_operand_check_failed (int, enum tree_code, #define TYPE_SIZES_GIMPLIFIED(NODE) (TYPE_CHECK (NODE)->common.constant_flag) /* In a decl (most significantly a FIELD_DECL), means an unsigned field. */ -#define DECL_UNSIGNED(NODE) (DECL_CHECK (NODE)->common.unsigned_flag) +#define DECL_UNSIGNED(NODE) (DECL_COMMON_CHECK (NODE)->common.unsigned_flag) /* In a BIT_FIELD_REF, means the bitfield is to be interpreted as unsigned. */ #define BIT_FIELD_REF_UNSIGNED(NODE) \ @@ -986,7 +1019,7 @@ extern void tree_operand_check_failed (int, enum tree_code, /* In a RESULT_DECL or PARM_DECL, means that it is passed by invisible reference (and the TREE_TYPE is a pointer to the true type). */ -#define DECL_BY_REFERENCE(NODE) (DECL_CHECK (NODE)->common.private_flag) +#define DECL_BY_REFERENCE(NODE) (DECL_COMMON_CHECK (NODE)->common.private_flag) /* In a CALL_EXPR, means that the call is the jump from a thunk to the thunked-to function. */ @@ -1884,43 +1917,44 @@ struct tree_binfo GTY (()) || TREE_CODE (SSA_NAME_VAR (DECL)) == PARM_DECL \ || TREE_CODE (SSA_NAME_VAR (DECL)) == RESULT_DECL))) -/* This is the name of the object as written by the user. - It is an IDENTIFIER_NODE. */ -#define DECL_NAME(NODE) (DECL_CHECK (NODE)->decl.name) -/* The name of the object as the assembler will see it (but before any - translations made by ASM_OUTPUT_LABELREF). Often this is the same - as DECL_NAME. It is an IDENTIFIER_NODE. */ -#define DECL_ASSEMBLER_NAME(NODE) decl_assembler_name (NODE) -/* Returns nonzero if the DECL_ASSEMBLER_NAME for NODE has been set. If zero, - the NODE might still have a DECL_ASSEMBLER_NAME -- it just hasn't been set - yet. */ -#define DECL_ASSEMBLER_NAME_SET_P(NODE) \ - (DECL_CHECK (NODE)->decl.assembler_name != NULL_TREE) -/* Set the DECL_ASSEMBLER_NAME for NODE to NAME. */ -#define SET_DECL_ASSEMBLER_NAME(NODE, NAME) \ - (DECL_CHECK (NODE)->decl.assembler_name = (NAME)) +/* Enumerate visibility settings. */ +#ifndef SYMBOL_VISIBILITY_DEFINED +#define SYMBOL_VISIBILITY_DEFINED +enum symbol_visibility +{ + VISIBILITY_DEFAULT, + VISIBILITY_INTERNAL, + VISIBILITY_HIDDEN, + VISIBILITY_PROTECTED +}; +#endif -/* Copy the DECL_ASSEMBLER_NAME from DECL1 to DECL2. Note that if DECL1's - DECL_ASSEMBLER_NAME has not yet been set, using this macro will not cause - the DECL_ASSEMBLER_NAME of either DECL to be set. In other words, the - semantics of using this macro, are different than saying: +struct function; - SET_DECL_ASSEMBLER_NAME(DECL2, DECL_ASSEMBLER_NAME (DECL1)) - which will try to set the DECL_ASSEMBLER_NAME for DECL1. */ +/* This is the name of the object as written by the user. + It is an IDENTIFIER_NODE. */ +#define DECL_NAME(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.name) -#define COPY_DECL_ASSEMBLER_NAME(DECL1, DECL2) \ - (DECL_ASSEMBLER_NAME_SET_P (DECL1) \ - ? (void) SET_DECL_ASSEMBLER_NAME (DECL2, \ - DECL_ASSEMBLER_NAME (DECL1)) \ - : (void) 0) +/* Every ..._DECL node gets a unique number. */ +#define DECL_UID(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.uid) -/* Records the section name in a section attribute. Used to pass - the name from decl_attributes to make_function_rtl and make_decl_rtl. */ -#define DECL_SECTION_NAME(NODE) (DECL_CHECK (NODE)->decl.section_name) +/* These two fields describe where in the source code the declaration + was. If the declaration appears in several places (as for a C + function that is declared first and then defined later), this + information should refer to the definition. */ +#define DECL_SOURCE_LOCATION(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.locus) +#define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE)) +#define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE)) +#ifdef USE_MAPPED_LOCATION +#define DECL_IS_BUILTIN(DECL) \ + (DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION) +#else +#define DECL_IS_BUILTIN(DECL) (DECL_SOURCE_LINE(DECL) == 0) +#endif /* For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node that the field is a member of. For VAR_DECL, @@ -1929,172 +1963,81 @@ struct tree_binfo GTY (()) the RECORD_TYPE or UNION_TYPE for the containing type, or NULL_TREE or a TRANSLATION_UNIT_DECL if the given decl has "file scope". */ -#define DECL_CONTEXT(NODE) (DECL_CHECK (NODE)->decl.context) -#define DECL_FIELD_CONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->decl.context) +#define DECL_CONTEXT(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.context) +#define DECL_FIELD_CONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->decl_minimal.context) +struct tree_decl_minimal GTY(()) +{ + struct tree_common common; + location_t locus; + unsigned int uid; + tree name; + tree context; +}; + +/* For any sort of a ..._DECL node, this points to the original (abstract) + decl node which this decl is an instance of, or else it is NULL indicating + that this decl is not an instance of some other decl. For example, + in a nested declaration of an inline function, this points back to the + definition. */ +#define DECL_ABSTRACT_ORIGIN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.abstract_origin) + +/* Like DECL_ABSTRACT_ORIGIN, but returns NODE if there's no abstract + origin. This is useful when setting the DECL_ABSTRACT_ORIGIN. */ +#define DECL_ORIGIN(NODE) \ + (DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : (NODE)) + +/* Nonzero for any sort of ..._DECL node means this decl node represents an + inline instance of some original (abstract) decl from an inline function; + suppress any warnings about shadowing some other variable. FUNCTION_DECL + nodes can also have their abstract origin set to themselves. */ +#define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != NULL_TREE \ + && DECL_ABSTRACT_ORIGIN (NODE) != (NODE)) + /* In a DECL this is the field where attributes are stored. */ -#define DECL_ATTRIBUTES(NODE) (DECL_CHECK (NODE)->decl.attributes) -/* In a FIELD_DECL, this is the field position, counting in bytes, of the - byte containing the bit closest to the beginning of the structure. */ -#define DECL_FIELD_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->decl.arguments) -/* In a FIELD_DECL, this is the offset, in bits, of the first bit of the - field from DECL_FIELD_OFFSET. */ -#define DECL_FIELD_BIT_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->decl.u2.t) -/* In a FIELD_DECL, this indicates whether the field was a bit-field and - if so, the type that was originally specified for it. - TREE_TYPE may have been modified (in finish_struct). */ -#define DECL_BIT_FIELD_TYPE(NODE) (FIELD_DECL_CHECK (NODE)->decl.result) -/* In FUNCTION_DECL, a chain of ..._DECL nodes. - VAR_DECL and PARM_DECL reserve the arguments slot for language-specific - uses. */ -#define DECL_ARGUMENTS(NODE) (DECL_CHECK (NODE)->decl.arguments) -/* This field is used to reference anything in decl.result and is meant only - for use by the garbage collector. */ -#define DECL_RESULT_FLD(NODE) (DECL_CHECK (NODE)->decl.result) -/* In FUNCTION_DECL, holds the decl for the return value. */ -#define DECL_RESULT(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.result) -/* For a TYPE_DECL, holds the "original" type. (TREE_TYPE has the copy.) */ -#define DECL_ORIGINAL_TYPE(NODE) (TYPE_DECL_CHECK (NODE)->decl.result) -/* In PARM_DECL, holds the type as written (perhaps a function or array). */ -#define DECL_ARG_TYPE_AS_WRITTEN(NODE) (PARM_DECL_CHECK (NODE)->decl.result) +#define DECL_ATTRIBUTES(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.attributes) + /* For a FUNCTION_DECL, holds the tree of BINDINGs. For a TRANSLATION_UNIT_DECL, holds the namespace's BLOCK. For a VAR_DECL, holds the initial value. For a PARM_DECL, not used--default values for parameters are encoded in the type of the function, not in the PARM_DECL slot. + For a FIELD_DECL, this is used for enumeration values and the C + frontend uses it for temporarily storing bitwidth of bitfields. ??? Need to figure out some way to check this isn't a PARM_DECL. */ -#define DECL_INITIAL(NODE) (DECL_CHECK (NODE)->decl.initial) -/* For a PARM_DECL, records the data type used to pass the argument, - which may be different from the type seen in the program. */ -#define DECL_ARG_TYPE(NODE) (PARM_DECL_CHECK (NODE)->decl.initial) -/* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which - if nonzero, indicates that the field occupies the type. */ -#define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->decl.initial) -/* These two fields describe where in the source code the declaration - was. If the declaration appears in several places (as for a C - function that is declared first and then defined later), this - information should refer to the definition. */ -#define DECL_SOURCE_LOCATION(NODE) (DECL_CHECK (NODE)->decl.locus) -#define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE)) -#define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE)) -#ifdef USE_MAPPED_LOCATION -#define DECL_IS_BUILTIN(DECL) \ - (DECL_SOURCE_LOCATION (DECL) <= BUILTINS_LOCATION) -#else -#define DECL_IS_BUILTIN(DECL) (DECL_SOURCE_LINE(DECL) == 0) -#endif +#define DECL_INITIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.initial) + /* Holds the size of the datum, in bits, as a tree expression. Need not be constant. */ -#define DECL_SIZE(NODE) (DECL_CHECK (NODE)->decl.size) +#define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size) /* Likewise for the size in bytes. */ -#define DECL_SIZE_UNIT(NODE) (DECL_CHECK (NODE)->decl.size_unit) +#define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit) /* Holds the alignment required for the datum, in bits. */ -#define DECL_ALIGN(NODE) (DECL_CHECK (NODE)->decl.u1.a.align) +#define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.u1.a.align) /* The alignment of NODE, in bytes. */ #define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT) /* For FIELD_DECLs, off_align holds the number of low-order bits of DECL_FIELD_OFFSET which are known to be always zero. DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET has. */ -#define DECL_OFFSET_ALIGN(NODE) \ - (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl.u1.a.off_align) -/* Specify that DECL_ALIGN(NODE) is a multiple of X. */ -#define SET_DECL_OFFSET_ALIGN(NODE, X) \ - (FIELD_DECL_CHECK (NODE)->decl.u1.a.off_align = exact_log2 ((X) & -(X))) -/* 1 if the alignment for this type was requested by "aligned" attribute, - 0 if it is the default for this type. */ -#define DECL_USER_ALIGN(NODE) (DECL_CHECK (NODE)->decl.user_align) +#define DECL_USER_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.user_align) /* Holds the machine mode corresponding to the declaration of a variable or field. Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a FIELD_DECL. */ -#define DECL_MODE(NODE) (DECL_CHECK (NODE)->decl.mode) -/* Holds the RTL expression for the value of a variable or function. - This value can be evaluated lazily for functions, variables with - static storage duration, and labels. */ -#define DECL_RTL(NODE) \ - (DECL_CHECK (NODE)->decl.rtl \ - ? (NODE)->decl.rtl \ - : (make_decl_rtl (NODE), (NODE)->decl.rtl)) -/* Set the DECL_RTL for NODE to RTL. */ -#define SET_DECL_RTL(NODE, RTL) set_decl_rtl (NODE, RTL) -/* Returns nonzero if the DECL_RTL for NODE has already been set. */ -#define DECL_RTL_SET_P(NODE) (DECL_CHECK (NODE)->decl.rtl != NULL) -/* Copy the RTL from NODE1 to NODE2. If the RTL was not set for - NODE1, it will not be set for NODE2; this is a lazy copy. */ -#define COPY_DECL_RTL(NODE1, NODE2) \ - (DECL_CHECK (NODE2)->decl.rtl = DECL_CHECK (NODE1)->decl.rtl) -/* The DECL_RTL for NODE, if it is set, or NULL, if it is not set. */ -#define DECL_RTL_IF_SET(NODE) (DECL_RTL_SET_P (NODE) ? DECL_RTL (NODE) : NULL) - -/* For PARM_DECL, holds an RTL for the stack slot or register - where the data was actually passed. */ -#define DECL_INCOMING_RTL(NODE) (PARM_DECL_CHECK (NODE)->decl.u2.r) - -/* For FUNCTION_DECL, this holds a pointer to a structure ("struct function") - that describes the status of this function. */ -#define DECL_STRUCT_FUNCTION(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.u2.f) +#define DECL_MODE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.mode) /* For FUNCTION_DECL, if it is built-in, this identifies which built-in operation it is. Note, however, that this field is overloaded, with DECL_BUILT_IN_CLASS as the discriminant, so the latter must always be checked before any access to the former. */ -#define DECL_FUNCTION_CODE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.u1.f) - -/* The DECL_VINDEX is used for FUNCTION_DECLS in two different ways. - Before the struct containing the FUNCTION_DECL is laid out, - DECL_VINDEX may point to a FUNCTION_DECL in a base class which - is the FUNCTION_DECL which this FUNCTION_DECL will replace as a virtual - function. When the class is laid out, this pointer is changed - to an INTEGER_CST node which is suitable for use as an index - into the virtual function table. */ -#define DECL_VINDEX(NODE) (DECL_CHECK (NODE)->decl.vindex) - -/* For FIELD_DECLS, DECL_FCONTEXT is the *first* baseclass in - which this FIELD_DECL is defined. This information is needed when - writing debugging information about vfield and vbase decls for C++. */ -#define DECL_FCONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->decl.vindex) - -extern tree decl_debug_expr_lookup (tree); -extern void decl_debug_expr_insert (tree, tree); - -/* For VAR_DECL, this is set to either an expression that it was split - from (if DECL_DEBUG_EXPR_IS_FROM is true), otherwise a tree_list of - subexpressions that it was split into. */ -#define DECL_DEBUG_EXPR(NODE) \ - (decl_debug_expr_lookup (VAR_DECL_CHECK (NODE))) - -#define SET_DECL_DEBUG_EXPR(NODE, VAL) \ - (decl_debug_expr_insert (VAR_DECL_CHECK (NODE), (VAL))) - +#define DECL_FUNCTION_CODE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_common.u1.f) #define DECL_DEBUG_EXPR_IS_FROM(NODE) \ - (DECL_CHECK (NODE)->decl.debug_expr_is_from) - -/* Every ..._DECL node gets a unique number. */ -#define DECL_UID(NODE) (DECL_CHECK (NODE)->decl.uid) - -/* For any sort of a ..._DECL node, this points to the original (abstract) - decl node which this decl is an instance of, or else it is NULL indicating - that this decl is not an instance of some other decl. For example, - in a nested declaration of an inline function, this points back to the - definition. */ -#define DECL_ABSTRACT_ORIGIN(NODE) (DECL_CHECK (NODE)->decl.abstract_origin) - -/* Like DECL_ABSTRACT_ORIGIN, but returns NODE if there's no abstract - origin. This is useful when setting the DECL_ABSTRACT_ORIGIN. */ -#define DECL_ORIGIN(NODE) \ - (DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : (NODE)) - -/* Nonzero for any sort of ..._DECL node means this decl node represents an - inline instance of some original (abstract) decl from an inline function; - suppress any warnings about shadowing some other variable. FUNCTION_DECL - nodes can also have their abstract origin set to themselves. */ -#define DECL_FROM_INLINE(NODE) (DECL_ABSTRACT_ORIGIN (NODE) != NULL_TREE \ - && DECL_ABSTRACT_ORIGIN (NODE) != (NODE)) + (DECL_COMMON_CHECK (NODE)->decl_common.debug_expr_is_from) /* Nonzero for a given ..._DECL node means that the name of this node should be ignored for symbolic debug purposes. */ -#define DECL_IGNORED_P(NODE) (DECL_CHECK (NODE)->decl.ignored_flag) +#define DECL_IGNORED_P(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag) /* Nonzero for a given ..._DECL node means that this node represents an "abstract instance" of the given declaration (e.g. in the original @@ -2102,25 +2045,14 @@ extern void decl_debug_expr_insert (tree, tree); information, we mustn't try to generate any address information for nodes marked as "abstract instances" because we don't actually generate any code or allocate any data space for such instances. */ -#define DECL_ABSTRACT(NODE) (DECL_CHECK (NODE)->decl.abstract_flag) - -/* Nonzero for a given ..._DECL node means that no warnings should be - generated just because this node is unused. */ -#define DECL_IN_SYSTEM_HEADER(NODE) \ - (DECL_CHECK (NODE)->decl.in_system_header_flag) - -/* Nonzero for a given ..._DECL node means that this node should be - put in .common, if possible. If a DECL_INITIAL is given, and it - is not error_mark_node, then the decl cannot be put in .common. */ -#define DECL_COMMON(NODE) (DECL_CHECK (NODE)->decl.common_flag) +#define DECL_ABSTRACT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.abstract_flag) /* Language-specific decl information. */ -#define DECL_LANG_SPECIFIC(NODE) (DECL_CHECK (NODE)->decl.lang_specific) +#define DECL_LANG_SPECIFIC(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_specific) -/* In a VAR_DECL or FUNCTION_DECL, - nonzero means external reference: +/* In a VAR_DECL or FUNCTION_DECL, nonzero means external reference: do not allocate storage, and refer to a definition elsewhere. */ -#define DECL_EXTERNAL(NODE) (DECL_CHECK (NODE)->decl.external_flag) +#define DECL_EXTERNAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.decl_flag_2) /* In a VAR_DECL for a RECORD_TYPE, sets number for non-init_priority initializations. */ @@ -2128,27 +2060,6 @@ extern void decl_debug_expr_insert (tree, tree); #define MAX_INIT_PRIORITY 65535 #define MAX_RESERVED_INIT_PRIORITY 100 -/* In a TYPE_DECL - nonzero means the detail info about this type is not dumped into stabs. - Instead it will generate cross reference ('x') of names. - This uses the same flag as DECL_EXTERNAL. */ -#define TYPE_DECL_SUPPRESS_DEBUG(NODE) \ - (TYPE_DECL_CHECK (NODE)->decl.external_flag) - -/* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */ -#define DECL_REGISTER(NODE) (DECL_CHECK (NODE)->decl.regdecl_flag) - -/* In LABEL_DECL nodes, nonzero means that an error message about - jumping into such a binding contour has been printed for this label. */ -#define DECL_ERROR_ISSUED(NODE) (LABEL_DECL_CHECK (NODE)->decl.regdecl_flag) - -/* In a FIELD_DECL, indicates this field should be bit-packed. */ -#define DECL_PACKED(NODE) (FIELD_DECL_CHECK (NODE)->decl.regdecl_flag) - -/* In a FUNCTION_DECL with a nonzero DECL_CONTEXT, indicates that a - static chain is not needed. */ -#define DECL_NO_STATIC_CHAIN(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->decl.regdecl_flag) /* Nonzero in a ..._DECL means this variable is ref'd from a nested function. For VAR_DECL nodes, PARM_DECL nodes, and FUNCTION_DECL nodes. @@ -2157,51 +2068,120 @@ extern void decl_debug_expr_insert (tree, tree); Also set in some languages for variables, etc., outside the normal lexical scope, such as class instance variables. */ -#define DECL_NONLOCAL(NODE) (DECL_CHECK (NODE)->decl.nonlocal_flag) +#define DECL_NONLOCAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.nonlocal_flag) -/* Nonzero in a FUNCTION_DECL means this function can be substituted - where it is called. */ -#define DECL_INLINE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.inline_flag) +/* Used in VAR_DECLs to indicate that the variable is a vtable. + Used in FIELD_DECLs for vtable pointers. + Used in FUNCTION_DECLs to indicate that the function is virtual. */ +#define DECL_VIRTUAL_P(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.virtual_flag) -/* Nonzero in a FUNCTION_DECL means that this function was declared inline, - such as via the `inline' keyword in C/C++. This flag controls the linkage - semantics of 'inline'; whether or not the function is inlined is - controlled by DECL_INLINE. */ -#define DECL_DECLARED_INLINE_P(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->decl.declared_inline_flag) +/* Used to indicate that this DECL represents a compiler-generated entity. */ +#define DECL_ARTIFICIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.artificial_flag) -/* Nonzero in a decl means that the gimplifier has seen (or placed) - this variable in a BIND_EXPR. */ -#define DECL_SEEN_IN_BIND_EXPR_P(NODE) \ - (DECL_CHECK (NODE)->decl.seen_in_bind_expr) +/* Additional flags for language-specific uses. */ +#define DECL_LANG_FLAG_0(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_0) +#define DECL_LANG_FLAG_1(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_1) +#define DECL_LANG_FLAG_2(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_2) +#define DECL_LANG_FLAG_3(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_3) +#define DECL_LANG_FLAG_4(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_4) +#define DECL_LANG_FLAG_5(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_5) +#define DECL_LANG_FLAG_6(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_6) +#define DECL_LANG_FLAG_7(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_7) -/* In a VAR_DECL, nonzero if the decl is a register variable with - an explicit asm specification. */ -#define DECL_HARD_REGISTER(NODE) (VAR_DECL_CHECK (NODE)->decl.inline_flag) +/* Used to indicate an alias set for the memory pointed to by this + particular FIELD_DECL, PARM_DECL, or VAR_DECL, which must have + pointer (or reference) type. */ +#define DECL_POINTER_ALIAS_SET(NODE) \ + (DECL_COMMON_CHECK (NODE)->decl_common.pointer_alias_set) -/* Value of the decls's visibility attribute */ -#define DECL_VISIBILITY(NODE) (DECL_CHECK (NODE)->decl.visibility) +/* Nonzero if an alias set has been assigned to this declaration. */ +#define DECL_POINTER_ALIAS_SET_KNOWN_P(NODE) \ + (DECL_POINTER_ALIAS_SET (NODE) != - 1) -/* Nonzero means that the decl had its visibility specified rather than - being inferred. */ -#define DECL_VISIBILITY_SPECIFIED(NODE) \ - (DECL_CHECK (NODE)->decl.visibility_specified) +/* Nonzero for a decl which is at file scope. */ +#define DECL_FILE_SCOPE_P(EXP) \ + (! DECL_CONTEXT (EXP) \ + || TREE_CODE (DECL_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL) -/* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */ -#define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.uninlinable) +/* Nonzero for a decl that is decorated using attribute used. + This indicates compiler tools that this decl needs to be preserved. */ +#define DECL_PRESERVE_P(DECL) \ + DECL_COMMON_CHECK (DECL)->decl_common.preserve_flag + +/* For function local variables of COMPLEX type, indicates that the + variable is not aliased, and that all modifications to the variable + have been adjusted so that they are killing assignments. Thus the + variable may now be treated as a GIMPLE register, and use real + instead of virtual ops in SSA form. */ +#define DECL_COMPLEX_GIMPLE_REG_P(DECL) \ + DECL_COMMON_CHECK (DECL)->decl_common.gimple_reg_flag -/* In a VAR_DECL, the model to use if the data should be allocated from - thread-local storage. */ -#define DECL_TLS_MODEL(NODE) (VAR_DECL_CHECK (NODE)->decl.tls_model) +struct tree_decl_common GTY(()) +{ + struct tree_decl_minimal common; + tree size; -/* In a VAR_DECL, nonzero if the data should be allocated from - thread-local storage. */ -#define DECL_THREAD_LOCAL_P(NODE) \ - (VAR_DECL_CHECK (NODE)->decl.tls_model != TLS_MODEL_NONE) + ENUM_BITFIELD(machine_mode) mode : 8; -/* In a FUNCTION_DECL, the saved representation of the body of the - entire function. */ -#define DECL_SAVED_TREE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.saved_tree) + unsigned nonlocal_flag : 1; + unsigned virtual_flag : 1; + unsigned ignored_flag : 1; + unsigned abstract_flag : 1; + unsigned artificial_flag : 1; + unsigned user_align : 1; + unsigned preserve_flag: 1; + unsigned debug_expr_is_from : 1; + + unsigned lang_flag_0 : 1; + unsigned lang_flag_1 : 1; + unsigned lang_flag_2 : 1; + unsigned lang_flag_3 : 1; + unsigned lang_flag_4 : 1; + unsigned lang_flag_5 : 1; + unsigned lang_flag_6 : 1; + unsigned lang_flag_7 : 1; + + /* In LABEL_DECL, this is DECL_ERROR_ISSUED. + In VAR_DECL and PARM_DECL, this is DECL_REGISTER. */ + unsigned decl_flag_0 : 1; + /* In FIELD_DECL, this is DECL_PACKED + In PARM_DECL, this is DECL_TRANSPARENT_UNION. */ + unsigned decl_flag_1 : 1; + /* In FIELD_DECL, this is DECL_BIT_FIELD + In VAR_DECL and FUNCTION_DECL, this is DECL_EXTERNAL. + In TYPE_DECL, this is TYPE_DECL_SUPRESS_DEBUG*/ + unsigned decl_flag_2 : 1; + /* In FIELD_DECL, this is DECL_NONADDRESSABLE_P + In VAR_DECL and PARM_DECL, this is DECL_HAS_VALUE_EXPR. */ + unsigned decl_flag_3 : 1; + /* Logically, this would go in a theoretical base shared by var and parm + decl. */ + unsigned gimple_reg_flag : 1; + + union tree_decl_u1 { + /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is + DECL_FUNCTION_CODE. */ + enum built_in_function f; + /* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this + is used by language-dependent code. */ + HOST_WIDE_INT i; + /* DECL_ALIGN and DECL_OFFSET_ALIGN. (These are not used for + FUNCTION_DECLs). */ + struct tree_decl_u1_a { + unsigned int align : 24; + unsigned int off_align : 8; + } a; + } GTY ((skip)) u1; + + tree size_unit; + tree initial; + tree attributes; + tree abstract_origin; + + HOST_WIDE_INT pointer_alias_set; + /* Points to a structure whose details depend on the language in use. */ + struct lang_decl *lang_specific; +}; extern tree decl_value_expr_lookup (tree); extern void decl_value_expr_insert (tree, tree); @@ -2211,80 +2191,185 @@ extern void decl_value_expr_insert (tree, tree); decl itself. This should only be used for debugging; once this field has been set, the decl itself may not legitimately appear in the function. */ #define DECL_HAS_VALUE_EXPR_P(NODE) \ - (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL)->decl.has_value_expr) + (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL)->decl_common.decl_flag_3) #define DECL_VALUE_EXPR(NODE) \ - (decl_value_expr_lookup (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL))) + (decl_value_expr_lookup (DECL_WRTL_CHECK (NODE))) #define SET_DECL_VALUE_EXPR(NODE, VAL) \ - (decl_value_expr_insert (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL), VAL)) + (decl_value_expr_insert (DECL_WRTL_CHECK (NODE), VAL)) -/* Nonzero in a FUNCTION_DECL means this function should be treated - as if it were a malloc, meaning it returns a pointer that is - not an alias. */ -#define DECL_IS_MALLOC(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.malloc_flag) +/* Holds the RTL expression for the value of a variable or function. + This value can be evaluated lazily for functions, variables with + static storage duration, and labels. */ +#define DECL_RTL(NODE) \ + (DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl \ + ? (NODE)->decl_with_rtl.rtl \ + : (make_decl_rtl (NODE), (NODE)->decl_with_rtl.rtl)) -/* Nonzero in a FUNCTION_DECL means this function may return more - than once. */ -#define DECL_IS_RETURNS_TWICE(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->decl.returns_twice_flag) +/* Set the DECL_RTL for NODE to RTL. */ +#define SET_DECL_RTL(NODE, RTL) set_decl_rtl (NODE, RTL) -/* Nonzero in a FUNCTION_DECL means this function should be treated - as "pure" function (like const function, but may read global memory). */ -#define DECL_IS_PURE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.pure_flag) +/* Returns nonzero if NODE is a tree node that can contain RTL. */ +#define HAS_RTL_P(NODE) (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WRTL)) + +/* Returns nonzero if the DECL_RTL for NODE has already been set. */ +#define DECL_RTL_SET_P(NODE) (HAS_RTL_P (NODE) && DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl != NULL) + +/* Copy the RTL from NODE1 to NODE2. If the RTL was not set for + NODE1, it will not be set for NODE2; this is a lazy copy. */ +#define COPY_DECL_RTL(NODE1, NODE2) \ + (DECL_WRTL_CHECK (NODE2)->decl_with_rtl.rtl = DECL_WRTL_CHECK (NODE1)->decl_with_rtl.rtl) + +/* The DECL_RTL for NODE, if it is set, or NULL, if it is not set. */ +#define DECL_RTL_IF_SET(NODE) (DECL_RTL_SET_P (NODE) ? DECL_RTL (NODE) : NULL) + +/* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */ +#define DECL_REGISTER(NODE) (DECL_WRTL_CHECK (NODE)->decl_common.decl_flag_0) + +struct tree_decl_with_rtl GTY(()) +{ + struct tree_decl_common common; + rtx rtl; +}; + +/* In a FIELD_DECL, this is the field position, counting in bytes, of the + byte containing the bit closest to the beginning of the structure. */ +#define DECL_FIELD_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.offset) + +/* In a FIELD_DECL, this is the offset, in bits, of the first bit of the + field from DECL_FIELD_OFFSET. */ +#define DECL_FIELD_BIT_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.bit_offset) + +/* In a FIELD_DECL, this indicates whether the field was a bit-field and + if so, the type that was originally specified for it. + TREE_TYPE may have been modified (in finish_struct). */ +#define DECL_BIT_FIELD_TYPE(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.bit_field_type) + +/* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which + if nonzero, indicates that the field occupies the type. */ +#define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.qualifier) + +/* For FIELD_DECLs, off_align holds the number of low-order bits of + DECL_FIELD_OFFSET which are known to be always zero. + DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET + has. */ +#define DECL_OFFSET_ALIGN(NODE) \ + (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.u1.a.off_align) + +/* Specify that DECL_ALIGN(NODE) is a multiple of X. */ +#define SET_DECL_OFFSET_ALIGN(NODE, X) \ + (FIELD_DECL_CHECK (NODE)->decl_common.u1.a.off_align = exact_log2 ((X) & -(X))) +/* 1 if the alignment for this type was requested by "aligned" attribute, + 0 if it is the default for this type. */ + +/* For FIELD_DECLS, DECL_FCONTEXT is the *first* baseclass in + which this FIELD_DECL is defined. This information is needed when + writing debugging information about vfield and vbase decls for C++. */ +#define DECL_FCONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.fcontext) + +/* In a FIELD_DECL, indicates this field should be bit-packed. */ +#define DECL_PACKED(NODE) (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_1) -/* Nonzero in a FUNCTION_DECL means this function should be treated - as "novops" function (function that does not read global memory, - but may have arbitrary side effects). */ -#define DECL_IS_NOVOPS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.novops_flag) - /* Nonzero in a FIELD_DECL means it is a bit field, and must be accessed specially. */ -#define DECL_BIT_FIELD(NODE) (FIELD_DECL_CHECK (NODE)->decl.bit_field_flag) +#define DECL_BIT_FIELD(NODE) (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_2) -/* Unused in FUNCTION_DECL. */ +/* Used in a FIELD_DECL to indicate that we cannot form the address of + this component. */ +#define DECL_NONADDRESSABLE_P(NODE) \ + (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_3) -/* In a VAR_DECL that's static, - nonzero if the space is in the text section. */ -#define DECL_IN_TEXT_SECTION(NODE) (VAR_DECL_CHECK (NODE)->decl.bit_field_flag) +struct tree_field_decl GTY(()) +{ + struct tree_decl_common common; + + tree offset; + tree bit_field_type; + tree qualifier; + tree bit_offset; + tree fcontext; + +}; -/* In a FUNCTION_DECL, nonzero means a built in function. */ -#define DECL_BUILT_IN(NODE) (DECL_BUILT_IN_CLASS (NODE) != NOT_BUILT_IN) +/* A numeric unique identifier for a LABEL_DECL. The UID allocation is + dense, unique within any one function, and may be used to index arrays. + If the value is -1, then no UID has been assigned. */ +#define LABEL_DECL_UID(NODE) \ + (LABEL_DECL_CHECK (NODE)->decl_common.pointer_alias_set) -/* For a builtin function, identify which part of the compiler defined it. */ -#define DECL_BUILT_IN_CLASS(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->decl.built_in_class) +/* In LABEL_DECL nodes, nonzero means that an error message about + jumping into such a binding contour has been printed for this label. */ +#define DECL_ERROR_ISSUED(NODE) (LABEL_DECL_CHECK (NODE)->decl_common.decl_flag_0) -/* Used in VAR_DECLs to indicate that the variable is a vtable. - Used in FIELD_DECLs for vtable pointers. - Used in FUNCTION_DECLs to indicate that the function is virtual. */ -#define DECL_VIRTUAL_P(NODE) (DECL_CHECK (NODE)->decl.virtual_flag) +struct tree_label_decl GTY(()) +{ + struct tree_decl_with_rtl common; + /* Java's verifier has some need to store information about labels, + and was using fields that no longer exist on labels. + Once the verifier doesn't need these anymore, they should be removed. */ + tree java_field_1; + tree java_field_2; + tree java_field_3; + unsigned int java_field_4; -/* Used to indicate that the linkage status of this DECL is not yet known, - so it should not be output now. */ -#define DECL_DEFER_OUTPUT(NODE) (DECL_CHECK (NODE)->decl.defer_output) +}; + +struct tree_result_decl GTY(()) +{ + struct tree_decl_with_rtl common; +}; + +struct tree_const_decl GTY(()) +{ + struct tree_decl_with_rtl common; +}; + +/* For a PARM_DECL, records the data type used to pass the argument, + which may be different from the type seen in the program. */ +#define DECL_ARG_TYPE(NODE) (PARM_DECL_CHECK (NODE)->decl_common.initial) + +/* For PARM_DECL, holds an RTL for the stack slot or register + where the data was actually passed. */ +#define DECL_INCOMING_RTL(NODE) (PARM_DECL_CHECK (NODE)->parm_decl.incoming_rtl) /* Used in PARM_DECLs whose type are unions to indicate that the argument should be passed in the same way that the first union alternative would be passed. */ #define DECL_TRANSPARENT_UNION(NODE) \ - (PARM_DECL_CHECK (NODE)->decl.transparent_union) + (PARM_DECL_CHECK (NODE)->decl_common.decl_flag_1) -/* Used in FUNCTION_DECLs to indicate that they should be run automatically - at the beginning or end of execution. */ -#define DECL_STATIC_CONSTRUCTOR(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->decl.static_ctor_flag) +struct tree_parm_decl GTY(()) +{ + struct tree_decl_with_rtl common; + rtx incoming_rtl; +}; -#define DECL_STATIC_DESTRUCTOR(NODE) \ -(FUNCTION_DECL_CHECK (NODE)->decl.static_dtor_flag) -/* Used to indicate that this DECL represents a compiler-generated entity. */ -#define DECL_ARTIFICIAL(NODE) (DECL_CHECK (NODE)->decl.artificial_flag) +/* Nonzero in a decl means that the gimplifier has seen (or placed) + this variable in a BIND_EXPR. */ +#define DECL_SEEN_IN_BIND_EXPR_P(NODE) \ + (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.seen_in_bind_expr) -/* Used to indicate that this DECL has weak linkage. */ -#define DECL_WEAK(NODE) (DECL_CHECK (NODE)->decl.weak_flag) +/* Used to indicate that the linkage status of this DECL is not yet known, + so it should not be output now. */ +#define DECL_DEFER_OUTPUT(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.defer_output) + +/* Nonzero for a given ..._DECL node means that no warnings should be + generated just because this node is unused. */ +#define DECL_IN_SYSTEM_HEADER(NODE) \ + (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.in_system_header_flag) + + /* Used to indicate that this DECL has weak linkage. */ +#define DECL_WEAK(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.weak_flag) + +/* Internal to the gimplifier. Indicates that the value is a formal + temporary controlled by the gimplifier. */ +#define DECL_GIMPLE_FORMAL_TEMP_P(DECL) \ + DECL_WITH_VIS_CHECK (DECL)->decl_with_vis.gimple_formal_temp + +/* Used to indicate that the pointer to this DECL cannot be treated as + an address constant. */ +#define DECL_NON_ADDR_CONST_P(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.non_addr_const_p) -/* Used in TREE_PUBLIC decls to indicate that copies of this DECL in - multiple translation units should be merged. */ -#define DECL_ONE_ONLY(NODE) (DECL_CHECK (NODE)->decl.transparent_union) /* Used in a DECL to indicate that, even if it TREE_PUBLIC, it need not be put out unless it is needed in this translation unit. @@ -2295,210 +2380,300 @@ extern void decl_value_expr_insert (tree, tree); back-end; it is up to front-ends which set this flag to ensure that there will never be any harm, other than bloat, in putting out something which is DECL_COMDAT. */ -#define DECL_COMDAT(NODE) (DECL_CHECK (NODE)->decl.comdat_flag) +#define DECL_COMDAT(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.comdat_flag) -/* Used in FUNCTION_DECLs to indicate that function entry and exit should - be instrumented with calls to support routines. */ -#define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->decl.no_instrument_function_entry_exit) +/* The name of the object as the assembler will see it (but before any + translations made by ASM_OUTPUT_LABELREF). Often this is the same + as DECL_NAME. It is an IDENTIFIER_NODE. */ +#define DECL_ASSEMBLER_NAME(NODE) decl_assembler_name (NODE) -/* Used in FUNCTION_DECLs to indicate that limit-stack-* should be - disabled in this function. */ -#define DECL_NO_LIMIT_STACK(NODE) \ - (FUNCTION_DECL_CHECK (NODE)->decl.no_limit_stack) +/* Return true if NODE is a NODE that can contain a DECL_ASSEMBLER_NAME. + This is true of all DECL nodes except FIELD_DECL. */ +#define HAS_DECL_ASSEMBLER_NAME_P(NODE) \ + (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WITH_VIS)) -/* Additional flags for language-specific uses. */ -#define DECL_LANG_FLAG_0(NODE) (DECL_CHECK (NODE)->decl.lang_flag_0) -#define DECL_LANG_FLAG_1(NODE) (DECL_CHECK (NODE)->decl.lang_flag_1) -#define DECL_LANG_FLAG_2(NODE) (DECL_CHECK (NODE)->decl.lang_flag_2) -#define DECL_LANG_FLAG_3(NODE) (DECL_CHECK (NODE)->decl.lang_flag_3) -#define DECL_LANG_FLAG_4(NODE) (DECL_CHECK (NODE)->decl.lang_flag_4) -#define DECL_LANG_FLAG_5(NODE) (DECL_CHECK (NODE)->decl.lang_flag_5) -#define DECL_LANG_FLAG_6(NODE) (DECL_CHECK (NODE)->decl.lang_flag_6) -#define DECL_LANG_FLAG_7(NODE) (DECL_CHECK (NODE)->decl.lang_flag_7) +/* Returns nonzero if the DECL_ASSEMBLER_NAME for NODE has been set. If zero, + the NODE might still have a DECL_ASSEMBLER_NAME -- it just hasn't been set + yet. */ +#define DECL_ASSEMBLER_NAME_SET_P(NODE) \ + (HAS_DECL_ASSEMBLER_NAME_P (NODE) && DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name != NULL_TREE) -/* Used to indicate that the pointer to this DECL cannot be treated as - an address constant. */ -#define DECL_NON_ADDR_CONST_P(NODE) (DECL_CHECK (NODE)->decl.non_addr_const_p) +/* Set the DECL_ASSEMBLER_NAME for NODE to NAME. */ +#define SET_DECL_ASSEMBLER_NAME(NODE, NAME) \ + (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name = (NAME)) -/* Used in a FIELD_DECL to indicate that we cannot form the address of - this component. */ -#define DECL_NONADDRESSABLE_P(NODE) \ - (FIELD_DECL_CHECK (NODE)->decl.non_addressable) +/* Copy the DECL_ASSEMBLER_NAME from DECL1 to DECL2. Note that if DECL1's + DECL_ASSEMBLER_NAME has not yet been set, using this macro will not cause + the DECL_ASSEMBLER_NAME of either DECL to be set. In other words, the + semantics of using this macro, are different than saying: -/* Used to indicate an alias set for the memory pointed to by this - particular FIELD_DECL, PARM_DECL, or VAR_DECL, which must have - pointer (or reference) type. */ -#define DECL_POINTER_ALIAS_SET(NODE) \ - (DECL_CHECK (NODE)->decl.pointer_alias_set) + SET_DECL_ASSEMBLER_NAME(DECL2, DECL_ASSEMBLER_NAME (DECL1)) + which will try to set the DECL_ASSEMBLER_NAME for DECL1. */ -/* A numeric unique identifier for a LABEL_DECL. The UID allocation is - dense, unique within any one function, and may be used to index arrays. - If the value is -1, then no UID has been assigned. */ -#define LABEL_DECL_UID(NODE) \ - (LABEL_DECL_CHECK (NODE)->decl.pointer_alias_set) +#define COPY_DECL_ASSEMBLER_NAME(DECL1, DECL2) \ + (DECL_ASSEMBLER_NAME_SET_P (DECL1) \ + ? (void) SET_DECL_ASSEMBLER_NAME (DECL2, \ + DECL_ASSEMBLER_NAME (DECL1)) \ + : (void) 0) -/* Nonzero if an alias set has been assigned to this declaration. */ -#define DECL_POINTER_ALIAS_SET_KNOWN_P(NODE) \ - (DECL_POINTER_ALIAS_SET (NODE) != - 1) +/* Records the section name in a section attribute. Used to pass + the name from decl_attributes to make_function_rtl and make_decl_rtl. */ +#define DECL_SECTION_NAME(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.section_name) -/* Nonzero for a decl which is at file scope. */ -#define DECL_FILE_SCOPE_P(EXP) \ - (! DECL_CONTEXT (EXP) \ - || TREE_CODE (DECL_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL) +/* Value of the decls's visibility attribute */ +#define DECL_VISIBILITY(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility) + +/* Nonzero means that the decl had its visibility specified rather than + being inferred. */ +#define DECL_VISIBILITY_SPECIFIED(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility_specified) + +/* Used in TREE_PUBLIC decls to indicate that copies of this DECL in + multiple translation units should be merged. */ +#define DECL_ONE_ONLY(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.one_only) + +struct tree_decl_with_vis GTY(()) +{ + struct tree_decl_with_rtl common; + tree assembler_name; + tree section_name; + + /* Belong to VAR_DECL exclusively. */ + unsigned defer_output:1; + unsigned hard_register:1; + unsigned thread_local:1; + unsigned common_flag:1; + unsigned in_text_section : 1; + unsigned gimple_formal_temp : 1; + unsigned non_addr_const_p : 1; + /* Used by C++. Might become a generic decl flag. */ + unsigned shadowed_for_var_p : 1; + + /* Don't belong to VAR_DECL exclusively. */ + unsigned in_system_header_flag : 1; + unsigned weak_flag:1; + unsigned seen_in_bind_expr : 1; + unsigned comdat_flag : 1; + ENUM_BITFIELD(symbol_visibility) visibility : 2; + unsigned visibility_specified : 1; + /* Belong to FUNCTION_DECL exclusively. */ + unsigned one_only : 1; + unsigned init_priority_p:1; + + /* Belongs to VAR_DECL exclusively. */ + ENUM_BITFIELD(tls_model) tls_model : 3; + /* 13 unused bits. */ +}; + +/* In a VAR_DECL that's static, + nonzero if the space is in the text section. */ +#define DECL_IN_TEXT_SECTION(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.in_text_section) + +/* Nonzero for a given ..._DECL node means that this node should be + put in .common, if possible. If a DECL_INITIAL is given, and it + is not error_mark_node, then the decl cannot be put in .common. */ +#define DECL_COMMON(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.common_flag) + +/* In a VAR_DECL, nonzero if the decl is a register variable with + an explicit asm specification. */ +#define DECL_HARD_REGISTER(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.hard_register) + +extern tree decl_debug_expr_lookup (tree); +extern void decl_debug_expr_insert (tree, tree); +/* For VAR_DECL, this is set to either an expression that it was split + from (if DECL_DEBUG_EXPR_IS_FROM is true), otherwise a tree_list of + subexpressions that it was split into. */ +#define DECL_DEBUG_EXPR(NODE) \ + (decl_debug_expr_lookup (VAR_DECL_CHECK (NODE))) + +#define SET_DECL_DEBUG_EXPR(NODE, VAL) \ + (decl_debug_expr_insert (VAR_DECL_CHECK (NODE), VAL)) + + +extern unsigned short decl_init_priority_lookup (tree); +extern void decl_init_priority_insert (tree, unsigned short); + +/* In a non-local VAR_DECL with static storage duration, this is the + initialization priority. If this value is zero, the NODE will be + initialized at the DEFAULT_INIT_PRIORITY. Only used by C++ FE*/ + +#define DECL_HAS_INIT_PRIORITY_P(NODE) \ + (VAR_DECL_CHECK (NODE)->decl_with_vis.init_priority_p) +#define DECL_INIT_PRIORITY(NODE) \ + (decl_init_priority_lookup (VAR_DECL_CHECK (NODE))) +#define SET_DECL_INIT_PRIORITY(NODE, VAL) \ + (decl_init_priority_insert (VAR_DECL_CHECK (NODE), VAL)) + +/* In a VAR_DECL, the model to use if the data should be allocated from + thread-local storage. */ +#define DECL_TLS_MODEL(NODE) (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model) + +/* In a VAR_DECL, nonzero if the data should be allocated from + thread-local storage. */ +#define DECL_THREAD_LOCAL_P(NODE) \ + (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model != TLS_MODEL_NONE) + +struct tree_var_decl GTY(()) +{ + struct tree_decl_with_vis common; +}; + + +/* This field is used to reference anything in decl.result and is meant only + for use by the garbage collector. */ +#define DECL_RESULT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.result) + +/* The DECL_VINDEX is used for FUNCTION_DECLS in two different ways. + Before the struct containing the FUNCTION_DECL is laid out, + DECL_VINDEX may point to a FUNCTION_DECL in a base class which + is the FUNCTION_DECL which this FUNCTION_DECL will replace as a virtual + function. When the class is laid out, this pointer is changed + to an INTEGER_CST node which is suitable for use as an index + into the virtual function table. + C++ also uses this field in namespaces, hence the DECL_NON_COMMON_CHECK. */ +#define DECL_VINDEX(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.vindex) + +struct tree_decl_non_common GTY(()) + +{ + struct tree_decl_with_vis common; + /* C++ uses this in namespaces. */ + tree saved_tree; + /* C++ uses this in templates. */ + tree arguments; + /* Almost all FE's use this. */ + tree result; + /* C++ uses this in namespaces. */ + tree vindex; +}; + +/* In FUNCTION_DECL, holds the decl for the return value. */ +#define DECL_RESULT(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.result) + +/* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */ +#define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.uninlinable) + +/* In a FUNCTION_DECL, the saved representation of the body of the + entire function. */ +#define DECL_SAVED_TREE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.saved_tree) + +/* Nonzero in a FUNCTION_DECL means this function should be treated + as if it were a malloc, meaning it returns a pointer that is + not an alias. */ +#define DECL_IS_MALLOC(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.malloc_flag) + +/* Nonzero in a FUNCTION_DECL means this function may return more + than once. */ +#define DECL_IS_RETURNS_TWICE(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.returns_twice_flag) + +/* Nonzero in a FUNCTION_DECL means this function should be treated + as "pure" function (like const function, but may read global memory). */ +#define DECL_IS_PURE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.pure_flag) + +/* Nonzero in a FUNCTION_DECL means this function should be treated + as "novops" function (function that does not read global memory, + but may have arbitrary side effects). */ +#define DECL_IS_NOVOPS(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.novops_flag) + +/* Used in FUNCTION_DECLs to indicate that they should be run automatically + at the beginning or end of execution. */ +#define DECL_STATIC_CONSTRUCTOR(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.static_ctor_flag) + +#define DECL_STATIC_DESTRUCTOR(NODE) \ +(FUNCTION_DECL_CHECK (NODE)->function_decl.static_dtor_flag) + +/* Used in FUNCTION_DECLs to indicate that function entry and exit should + be instrumented with calls to support routines. */ +#define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.no_instrument_function_entry_exit) + +/* Used in FUNCTION_DECLs to indicate that limit-stack-* should be + disabled in this function. */ +#define DECL_NO_LIMIT_STACK(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.no_limit_stack) + +/* In a FUNCTION_DECL with a nonzero DECL_CONTEXT, indicates that a + static chain is not needed. */ +#define DECL_NO_STATIC_CHAIN(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.regdecl_flag) /* Nonzero for a decl that cgraph has decided should be inlined into at least one call site. It is not meaningful to look at this directly; always use cgraph_function_possibly_inlined_p. */ #define DECL_POSSIBLY_INLINED(DECL) \ - FUNCTION_DECL_CHECK (DECL)->decl.possibly_inlined + FUNCTION_DECL_CHECK (DECL)->function_decl.possibly_inlined -/* Nonzero for a decl that is decorated using attribute used. - This indicates compiler tools that this decl needs to be preserved. */ -#define DECL_PRESERVE_P(DECL) \ - DECL_CHECK (DECL)->decl.preserve_flag +/* Nonzero in a FUNCTION_DECL means this function can be substituted + where it is called. */ +#define DECL_INLINE(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.inline_flag) -/* Internal to the gimplifier. Indicates that the value is a formal - temporary controlled by the gimplifier. */ -#define DECL_GIMPLE_FORMAL_TEMP_P(DECL) \ - DECL_CHECK (DECL)->decl.gimple_formal_temp +/* Nonzero in a FUNCTION_DECL means that this function was declared inline, + such as via the `inline' keyword in C/C++. This flag controls the linkage + semantics of 'inline'; whether or not the function is inlined is + controlled by DECL_INLINE. */ +#define DECL_DECLARED_INLINE_P(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag) -/* For function local variables of COMPLEX type, indicates that the - variable is not aliased, and that all modifications to the variable - have been adjusted so that they are killing assignments. Thus the - variable may now be treated as a GIMPLE register, and use real - instead of virtual ops in SSA form. */ -#define DECL_COMPLEX_GIMPLE_REG_P(DECL) \ - DECL_CHECK (DECL)->decl.gimple_reg_flag +/* For FUNCTION_DECL, this holds a pointer to a structure ("struct function") + that describes the status of this function. */ +#define DECL_STRUCT_FUNCTION(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.f) -/* Enumerate visibility settings. */ -#ifndef SYMBOL_VISIBILITY_DEFINED -#define SYMBOL_VISIBILITY_DEFINED -enum symbol_visibility -{ - VISIBILITY_DEFAULT, - VISIBILITY_INTERNAL, - VISIBILITY_HIDDEN, - VISIBILITY_PROTECTED -}; -#endif +/* In a FUNCTION_DECL, nonzero means a built in function. */ +#define DECL_BUILT_IN(NODE) (DECL_BUILT_IN_CLASS (NODE) != NOT_BUILT_IN) -struct function; -struct tree_decl GTY(()) -{ - struct tree_common common; - location_t locus; - unsigned int uid; - tree size; +/* For a builtin function, identify which part of the compiler defined it. */ +#define DECL_BUILT_IN_CLASS(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.built_in_class) - /* 32 bits: */ - ENUM_BITFIELD(machine_mode) mode : 8; +/* In FUNCTION_DECL, a chain of ..._DECL nodes. + VAR_DECL and PARM_DECL reserve the arguments slot for language-specific + uses. */ +#define DECL_ARGUMENTS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments) - unsigned external_flag : 1; - unsigned nonlocal_flag : 1; - unsigned regdecl_flag : 1; - unsigned inline_flag : 1; - unsigned bit_field_flag : 1; - unsigned virtual_flag : 1; - unsigned ignored_flag : 1; - unsigned abstract_flag : 1; +/* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the + arguments/result/saved_tree fields by front ends. It was either inherit + FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL, + which seemed a bit strange. */ - unsigned in_system_header_flag : 1; - unsigned common_flag : 1; - unsigned defer_output : 1; - unsigned transparent_union : 1; +struct tree_function_decl GTY(()) +{ + struct tree_decl_non_common common; + unsigned static_ctor_flag : 1; unsigned static_dtor_flag : 1; - unsigned artificial_flag : 1; - unsigned weak_flag : 1; - - unsigned non_addr_const_p : 1; - unsigned no_instrument_function_entry_exit : 1; - unsigned comdat_flag : 1; + unsigned uninlinable : 1; + unsigned possibly_inlined : 1; + unsigned novops_flag : 1; + unsigned returns_twice_flag : 1; unsigned malloc_flag : 1; - unsigned no_limit_stack : 1; - ENUM_BITFIELD(built_in_class) built_in_class : 2; unsigned pure_flag : 1; - - /* 32 bits: */ - unsigned non_addressable : 1; - unsigned user_align : 1; - unsigned uninlinable : 1; - unsigned gimple_reg_flag : 1; + unsigned declared_inline_flag : 1; - ENUM_BITFIELD(symbol_visibility) visibility : 2; - unsigned visibility_specified : 1; + unsigned regdecl_flag : 1; + unsigned inline_flag : 1; + unsigned no_instrument_function_entry_exit : 1; + unsigned no_limit_stack : 1; + ENUM_BITFIELD(built_in_class) built_in_class : 2; - unsigned lang_flag_0 : 1; - unsigned lang_flag_1 : 1; - unsigned lang_flag_2 : 1; - unsigned lang_flag_3 : 1; - unsigned lang_flag_4 : 1; - unsigned lang_flag_5 : 1; - unsigned lang_flag_6 : 1; - unsigned lang_flag_7 : 1; + struct function *f; +}; - unsigned possibly_inlined : 1; - unsigned preserve_flag: 1; - unsigned gimple_formal_temp : 1; - unsigned debug_expr_is_from : 1; - unsigned returns_twice_flag : 1; - unsigned seen_in_bind_expr : 1; - unsigned novops_flag : 1; - unsigned has_value_expr : 1; +/* For a TYPE_DECL, holds the "original" type. (TREE_TYPE has the copy.) */ +#define DECL_ORIGINAL_TYPE(NODE) (TYPE_DECL_CHECK (NODE)->decl_non_common.result) - ENUM_BITFIELD(tls_model) tls_model : 3; - /* 5 unused bits. */ +/* In a TYPE_DECL nonzero means the detail info about this type is not dumped + into stabs. Instead it will generate cross reference ('x') of names. + This uses the same flag as DECL_EXTERNAL. */ +#define TYPE_DECL_SUPPRESS_DEBUG(NODE) \ + (TYPE_DECL_CHECK (NODE)->decl_common.decl_flag_2) - union tree_decl_u1 { - /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is - DECL_FUNCTION_CODE. */ - enum built_in_function f; - /* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this - is used by language-dependent code. */ - HOST_WIDE_INT i; - /* DECL_ALIGN and DECL_OFFSET_ALIGN. (These are not used for - FUNCTION_DECLs). */ - struct tree_decl_u1_a { - unsigned int align : 24; - unsigned int off_align : 8; - } a; - } GTY ((skip)) u1; +struct tree_type_decl GTY(()) +{ + struct tree_decl_non_common common; - tree size_unit; - tree name; - tree context; - tree arguments; /* Also used for DECL_FIELD_OFFSET */ - tree result; /* Also used for DECL_BIT_FIELD_TYPE */ - tree initial; /* Also used for DECL_QUALIFIER */ - tree abstract_origin; - tree assembler_name; - tree section_name; - tree attributes; - rtx rtl; /* RTL representation for object. */ - - /* In FUNCTION_DECL, if it is inline, holds the saved insn chain. - In FIELD_DECL, is DECL_FIELD_BIT_OFFSET. - In PARM_DECL, holds an RTL for the stack slot - of register where the data was actually passed. - Used by Chill and Java in LABEL_DECL and by C++ and Java in VAR_DECL. */ - union tree_decl_u2 { - struct function * GTY ((tag ("FUNCTION_DECL"))) f; - rtx GTY ((tag ("PARM_DECL"))) r; - tree GTY ((tag ("FIELD_DECL"))) t; - int GTY ((tag ("VAR_DECL"))) i; - } GTY ((desc ("TREE_CODE((tree) &(%0))"))) u2; - - /* In a FUNCTION_DECL, this is DECL_SAVED_TREE. - In a VAR_DECL or PARM_DECL, this is DECL_VALUE_EXPR. */ - tree saved_tree; - tree vindex; - HOST_WIDE_INT pointer_alias_set; - /* Points to a structure whose details depend on the language in use. */ - struct lang_decl *lang_specific; }; - /* A STATEMENT_LIST chains statements together in GENERIC and GIMPLE. To reduce overhead, the nodes containing the statements are not trees. @@ -2549,27 +2724,7 @@ struct tree_value_handle GTY(()) unsigned int id; }; -enum tree_node_structure_enum { - TS_COMMON, - TS_INT_CST, - TS_REAL_CST, - TS_VECTOR, - TS_STRING, - TS_COMPLEX, - TS_IDENTIFIER, - TS_DECL, - TS_TYPE, - TS_LIST, - TS_VEC, - TS_EXP, - TS_SSA_NAME, - TS_PHI_NODE, - TS_BLOCK, - TS_BINFO, - TS_STATEMENT_LIST, - TS_VALUE_HANDLE, - LAST_TS_ENUM -}; + /* Define the overall contents of a tree node. It may be any of the structures declared above @@ -2585,7 +2740,19 @@ union tree_node GTY ((ptr_alias (union lang_tree_node), struct tree_string GTY ((tag ("TS_STRING"))) string; struct tree_complex GTY ((tag ("TS_COMPLEX"))) complex; struct tree_identifier GTY ((tag ("TS_IDENTIFIER"))) identifier; - struct tree_decl GTY ((tag ("TS_DECL"))) decl; + struct tree_decl_minimal GTY((tag ("TS_DECL_MINIMAL"))) decl_minimal; + struct tree_decl_common GTY ((tag ("TS_DECL_COMMON"))) decl_common; + struct tree_decl_with_rtl GTY ((tag ("TS_DECL_WRTL"))) decl_with_rtl; + struct tree_decl_non_common GTY ((tag ("TS_DECL_NON_COMMON"))) decl_non_common; + struct tree_parm_decl GTY ((tag ("TS_PARM_DECL"))) parm_decl; + struct tree_decl_with_vis GTY ((tag ("TS_DECL_WITH_VIS"))) decl_with_vis; + struct tree_var_decl GTY ((tag ("TS_VAR_DECL"))) var_decl; + struct tree_field_decl GTY ((tag ("TS_FIELD_DECL"))) field_decl; + struct tree_label_decl GTY ((tag ("TS_LABEL_DECL"))) label_decl; + struct tree_result_decl GTY ((tag ("TS_RESULT_DECL"))) result_decl; + struct tree_const_decl GTY ((tag ("TS_CONST_DECL"))) const_decl; + struct tree_type_decl GTY ((tag ("TS_TYPE_DECL"))) type_decl; + struct tree_function_decl GTY ((tag ("TS_FUNCTION_DECL"))) function_decl; struct tree_type GTY ((tag ("TS_TYPE"))) type; struct tree_list GTY ((tag ("TS_LIST"))) list; struct tree_vec GTY ((tag ("TS_VEC"))) vec; @@ -3933,6 +4100,17 @@ extern tree get_base_address (tree t); /* In tree-vectorizer.c. */ extern void vect_set_verbosity_level (const char *); +struct tree_map GTY(()) +{ + unsigned int hash; + tree from; + tree to; +}; + +extern unsigned int tree_map_hash (const void *); +extern int tree_map_marked_p (const void *); +extern int tree_map_eq (const void *, const void *); + /* In tree-ssa-address.c. */ extern tree tree_mem_ref_addr (tree, tree); extern void copy_mem_ref_info (tree, tree); |