aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h189
1 files changed, 117 insertions, 72 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 529613c..805fe06 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -68,6 +68,18 @@ extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
tree_contains_struct[C][TS_COMMON] = 1; \
} while (0)
+#define MARK_TS_TYPE_COMMON(C) \
+ do { \
+ MARK_TS_COMMON (C); \
+ tree_contains_struct[C][TS_TYPE_COMMON] = 1; \
+ } while (0)
+
+#define MARK_TS_TYPE_WITH_LANG_SPECIFIC(C) \
+ do { \
+ MARK_TS_TYPE_COMMON (C); \
+ tree_contains_struct[C][TS_TYPE_WITH_LANG_SPECIFIC] = 1; \
+ } while (0)
+
#define MARK_TS_DECL_MINIMAL(C) \
do { \
MARK_TS_COMMON (C); \
@@ -2110,39 +2122,24 @@ struct GTY(()) tree_block {
type. Note also that some of the front-ends also overload these fields,
so they must be checked as well. */
-#define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type.uid)
-#define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type.size)
-#define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type.size_unit)
-#define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type.values)
-#define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type.values)
-#define TYPE_FIELDS(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.values)
-#define TYPE_CACHED_VALUES(NODE) (TYPE_CHECK(NODE)->type.values)
-#define TYPE_METHODS(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.maxval)
-#define TYPE_VFIELD(NODE) (RECORD_OR_UNION_CHECK (NODE)->type.minval)
-#define TYPE_ARG_TYPES(NODE) (FUNC_OR_METHOD_CHECK (NODE)->type.values)
-#define TYPE_METHOD_BASETYPE(NODE) (FUNC_OR_METHOD_CHECK (NODE)->type.maxval)
-#define TYPE_OFFSET_BASETYPE(NODE) (OFFSET_TYPE_CHECK (NODE)->type.maxval)
-#define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type.pointer_to)
-#define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type.reference_to)
-#define TYPE_NEXT_PTR_TO(NODE) (POINTER_TYPE_CHECK (NODE)->type.minval)
-#define TYPE_NEXT_REF_TO(NODE) (REFERENCE_TYPE_CHECK (NODE)->type.minval)
-#define TYPE_MIN_VALUE(NODE) (NUMERICAL_TYPE_CHECK (NODE)->type.minval)
-#define TYPE_MAX_VALUE(NODE) (NUMERICAL_TYPE_CHECK (NODE)->type.maxval)
-#define TYPE_PRECISION(NODE) (TYPE_CHECK (NODE)->type.precision)
-#define TYPE_NAME(NODE) (TYPE_CHECK (NODE)->type.name)
-#define TYPE_NEXT_VARIANT(NODE) (TYPE_CHECK (NODE)->type.next_variant)
-#define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type.main_variant)
-#define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type.context)
-#define TYPE_MAXVAL(NODE) (TYPE_CHECK (NODE)->type.maxval)
-#define TYPE_MINVAL(NODE) (TYPE_CHECK (NODE)->type.minval)
+#define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type_common.uid)
+#define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type_common.size)
+#define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type_common.size_unit)
+#define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type_common.pointer_to)
+#define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type_common.reference_to)
+#define TYPE_PRECISION(NODE) (TYPE_CHECK (NODE)->type_common.precision)
+#define TYPE_NAME(NODE) (TYPE_CHECK (NODE)->type_common.name)
+#define TYPE_NEXT_VARIANT(NODE) (TYPE_CHECK (NODE)->type_common.next_variant)
+#define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type_common.main_variant)
+#define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type_common.context)
/* Vector types need to check target flags to determine type. */
extern enum machine_mode vector_type_mode (const_tree);
#define TYPE_MODE(NODE) \
(TREE_CODE (TYPE_CHECK (NODE)) == VECTOR_TYPE \
- ? vector_type_mode (NODE) : (NODE)->type.mode)
+ ? vector_type_mode (NODE) : (NODE)->type_common.mode)
#define SET_TYPE_MODE(NODE, MODE) \
- (TYPE_CHECK (NODE)->type.mode = (MODE))
+ (TYPE_CHECK (NODE)->type_common.mode = (MODE))
/* The "canonical" type for this type node, which is used by frontends to
compare the type for equality with another type. If two types are
@@ -2160,7 +2157,7 @@ extern enum machine_mode vector_type_mode (const_tree);
to each other without a conversion. The middle-end also makes sure
to assign the same alias-sets to the type partition with equal
TYPE_CANONICAL of their unqualified variants. */
-#define TYPE_CANONICAL(NODE) (TYPE_CHECK (NODE)->type.canonical)
+#define TYPE_CANONICAL(NODE) (TYPE_CHECK (NODE)->type_common.canonical)
/* Indicates that the type node requires structural equality
checks. The compiler will need to look at the composition of the
type to determine whether it is equal to another type, rather than
@@ -2172,35 +2169,28 @@ extern enum machine_mode vector_type_mode (const_tree);
type node requires structural equality. */
#define SET_TYPE_STRUCTURAL_EQUALITY(NODE) (TYPE_CANONICAL (NODE) = NULL_TREE)
-#define TYPE_LANG_SPECIFIC(NODE) (TYPE_CHECK (NODE)->type.lang_specific)
#define TYPE_IBIT(NODE) (GET_MODE_IBIT (TYPE_MODE (NODE)))
#define TYPE_FBIT(NODE) (GET_MODE_FBIT (TYPE_MODE (NODE)))
-/* For record and union types, information about this type, as a base type
- for itself. */
-#define TYPE_BINFO(NODE) (RECORD_OR_UNION_CHECK(NODE)->type.binfo)
-
-/* For non record and union types, used in a language-dependent way. */
-#define TYPE_LANG_SLOT_1(NODE) (NOT_RECORD_OR_UNION_CHECK(NODE)->type.binfo)
-
/* The (language-specific) typed-based alias set for this type.
Objects whose TYPE_ALIAS_SETs are different cannot alias each
other. If the TYPE_ALIAS_SET is -1, no alias set has yet been
assigned to this type. If the TYPE_ALIAS_SET is 0, objects of this
type can alias objects of any type. */
-#define TYPE_ALIAS_SET(NODE) (TYPE_CHECK (NODE)->type.alias_set)
+#define TYPE_ALIAS_SET(NODE) (TYPE_CHECK (NODE)->type_common.alias_set)
/* Nonzero iff the typed-based alias set for this type has been
calculated. */
-#define TYPE_ALIAS_SET_KNOWN_P(NODE) (TYPE_CHECK (NODE)->type.alias_set != -1)
+#define TYPE_ALIAS_SET_KNOWN_P(NODE) \
+ (TYPE_CHECK (NODE)->type_common.alias_set != -1)
/* A TREE_LIST of IDENTIFIER nodes of the attributes that apply
to this type. */
-#define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type.attributes)
+#define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type_common.attributes)
/* The alignment necessary for objects of this type.
The value is an int, measured in bits. */
-#define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type.align)
+#define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type_common.align)
/* 1 if the alignment for this type was requested by "aligned" attribute,
0 if it is the default for this type. */
@@ -2221,7 +2211,8 @@ extern enum machine_mode vector_type_mode (const_tree);
/* In a RECORD_TYPE, UNION_TYPE or QUAL_UNION_TYPE, it means the type
has BLKmode only because it lacks the alignment requirement for
its size. */
-#define TYPE_NO_FORCE_BLK(NODE) (TYPE_CHECK (NODE)->type.no_force_blk_flag)
+#define TYPE_NO_FORCE_BLK(NODE) \
+ (TYPE_CHECK (NODE)->type_common.no_force_blk_flag)
/* In an INTEGER_TYPE, it means the type represents a size. We use
this both for validity checking and to permit optimizations that
@@ -2232,7 +2223,7 @@ extern enum machine_mode vector_type_mode (const_tree);
properties. Expressions whose type have TYPE_IS_SIZETYPE set are
always actual sizes. */
#define TYPE_IS_SIZETYPE(NODE) \
- (INTEGER_TYPE_CHECK (NODE)->type.no_force_blk_flag)
+ (INTEGER_TYPE_CHECK (NODE)->type_common.no_force_blk_flag)
/* Nonzero in a type considered volatile as a whole. */
#define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->base.volatile_flag)
@@ -2242,7 +2233,7 @@ extern enum machine_mode vector_type_mode (const_tree);
/* If nonzero, this type is `restrict'-qualified, in the C sense of
the term. */
-#define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type.restrict_flag)
+#define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type_common.restrict_flag)
/* If nonzero, type's name shouldn't be emitted into debug info. */
#define TYPE_NAMELESS(NODE) (TYPE_CHECK (NODE)->base.nameless_flag)
@@ -2287,13 +2278,13 @@ enum cv_qualifier
| (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT))
/* These flags are available for each language front end to use internally. */
-#define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type.lang_flag_0)
-#define TYPE_LANG_FLAG_1(NODE) (TYPE_CHECK (NODE)->type.lang_flag_1)
-#define TYPE_LANG_FLAG_2(NODE) (TYPE_CHECK (NODE)->type.lang_flag_2)
-#define TYPE_LANG_FLAG_3(NODE) (TYPE_CHECK (NODE)->type.lang_flag_3)
-#define TYPE_LANG_FLAG_4(NODE) (TYPE_CHECK (NODE)->type.lang_flag_4)
-#define TYPE_LANG_FLAG_5(NODE) (TYPE_CHECK (NODE)->type.lang_flag_5)
-#define TYPE_LANG_FLAG_6(NODE) (TYPE_CHECK (NODE)->type.lang_flag_6)
+#define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_0)
+#define TYPE_LANG_FLAG_1(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_1)
+#define TYPE_LANG_FLAG_2(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_2)
+#define TYPE_LANG_FLAG_3(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_3)
+#define TYPE_LANG_FLAG_4(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_4)
+#define TYPE_LANG_FLAG_5(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_5)
+#define TYPE_LANG_FLAG_6(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_6)
/* Used to keep track of visited nodes in tree traversals. This is set to
0 by copy_node and make_node. */
@@ -2302,22 +2293,16 @@ enum cv_qualifier
/* If set in an ARRAY_TYPE, indicates a string type (for languages
that distinguish string from array of char).
If set in a INTEGER_TYPE, indicates a character type. */
-#define TYPE_STRING_FLAG(NODE) (TYPE_CHECK (NODE)->type.string_flag)
-
-/* If non-NULL, this is an upper bound of the size (in bytes) of an
- object of the given ARRAY_TYPE. This allows temporaries to be
- allocated. */
-#define TYPE_ARRAY_MAX_SIZE(ARRAY_TYPE) \
- (ARRAY_TYPE_CHECK (ARRAY_TYPE)->type.maxval)
+#define TYPE_STRING_FLAG(NODE) (TYPE_CHECK (NODE)->type_common.string_flag)
/* For a VECTOR_TYPE, this is the number of sub-parts of the vector. */
#define TYPE_VECTOR_SUBPARTS(VECTOR_TYPE) \
(((unsigned HOST_WIDE_INT) 1) \
- << VECTOR_TYPE_CHECK (VECTOR_TYPE)->type.precision)
+ << VECTOR_TYPE_CHECK (VECTOR_TYPE)->type_common.precision)
/* Set precision to n when we have 2^n sub-parts of the vector. */
#define SET_TYPE_VECTOR_SUBPARTS(VECTOR_TYPE, X) \
- (VECTOR_TYPE_CHECK (VECTOR_TYPE)->type.precision = exact_log2 (X))
+ (VECTOR_TYPE_CHECK (VECTOR_TYPE)->type_common.precision = exact_log2 (X))
/* Nonzero in a VECTOR_TYPE if the frontends should not emit warnings
about missing conversions to other vector types of the same size. */
@@ -2327,20 +2312,20 @@ enum cv_qualifier
/* Indicates that objects of this type must be initialized by calling a
function when they are created. */
#define TYPE_NEEDS_CONSTRUCTING(NODE) \
- (TYPE_CHECK (NODE)->type.needs_constructing_flag)
+ (TYPE_CHECK (NODE)->type_common.needs_constructing_flag)
/* Indicates that a UNION_TYPE object should be passed the same way that
the first union alternative would be passed, or that a RECORD_TYPE
object should be passed the same way that the first (and only) member
would be passed. */
#define TYPE_TRANSPARENT_AGGR(NODE) \
- (RECORD_OR_UNION_CHECK (NODE)->type.transparent_aggr_flag)
+ (RECORD_OR_UNION_CHECK (NODE)->type_common.transparent_aggr_flag)
/* For an ARRAY_TYPE, indicates that it is not permitted to take the
address of a component of the type. This is the counterpart of
DECL_NONADDRESSABLE_P for arrays, see the definition of this flag. */
#define TYPE_NONALIASED_COMPONENT(NODE) \
- (ARRAY_TYPE_CHECK (NODE)->type.transparent_aggr_flag)
+ (ARRAY_TYPE_CHECK (NODE)->type_common.transparent_aggr_flag)
/* Indicated that objects of this type should be laid out in as
compact a way as possible. */
@@ -2350,7 +2335,7 @@ enum cv_qualifier
Values are: 0 (unknown), 1 (false), 2 (true). Never access
this field directly. */
#define TYPE_CONTAINS_PLACEHOLDER_INTERNAL(NODE) \
- (TYPE_CHECK (NODE)->type.contains_placeholder_bits)
+ (TYPE_CHECK (NODE)->type_common.contains_placeholder_bits)
/* The debug output functions use the symtab union field to store
information specific to the debugging format. The different debug
@@ -2361,15 +2346,18 @@ enum cv_qualifier
/* Symtab field as an integer. Used by stabs generator in dbxout.c to
hold the type's number in the generated stabs. */
-#define TYPE_SYMTAB_ADDRESS(NODE) (TYPE_CHECK (NODE)->type.symtab.address)
+#define TYPE_SYMTAB_ADDRESS(NODE) \
+ (TYPE_CHECK (NODE)->type_common.symtab.address)
/* Symtab field as a string. Used by COFF generator in sdbout.c to
hold struct/union type tag names. */
-#define TYPE_SYMTAB_POINTER(NODE) (TYPE_CHECK (NODE)->type.symtab.pointer)
+#define TYPE_SYMTAB_POINTER(NODE) \
+ (TYPE_CHECK (NODE)->type_common.symtab.pointer)
/* Symtab field as a pointer to a DWARF DIE. Used by DWARF generator
in dwarf2out.c to point to the DIE generated for the type. */
-#define TYPE_SYMTAB_DIE(NODE) (TYPE_CHECK (NODE)->type.symtab.die)
+#define TYPE_SYMTAB_DIE(NODE) \
+ (TYPE_CHECK (NODE)->type_common.symtab.die)
/* The garbage collector needs to know the interpretation of the
symtab field. These constants represent the different types in the
@@ -2381,9 +2369,8 @@ enum cv_qualifier
struct die_struct;
-struct GTY(()) tree_type {
+struct GTY(()) tree_type_common {
struct tree_common common;
- tree values;
tree size;
tree size_unit;
tree attributes;
@@ -2417,16 +2404,70 @@ struct GTY(()) tree_type {
struct die_struct * GTY ((tag ("TYPE_SYMTAB_IS_DIE"))) die;
} GTY ((desc ("debug_hooks->tree_type_symtab_field"))) symtab;
tree name;
- tree minval;
- tree maxval;
tree next_variant;
tree main_variant;
- tree binfo;
tree context;
tree canonical;
+};
+
+#define TYPE_LANG_SPECIFIC(NODE) \
+ (TYPE_CHECK (NODE)->type_with_lang_specific.lang_specific)
+
+struct GTY(()) tree_type_with_lang_specific {
+ struct tree_type_common common;
/* Points to a structure whose details depend on the language in use. */
struct lang_type *lang_specific;
};
+
+#define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type_non_common.values)
+#define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type_non_common.values)
+#define TYPE_FIELDS(NODE) \
+ (RECORD_OR_UNION_CHECK (NODE)->type_non_common.values)
+#define TYPE_CACHED_VALUES(NODE) (TYPE_CHECK(NODE)->type_non_common.values)
+#define TYPE_ARG_TYPES(NODE) \
+ (FUNC_OR_METHOD_CHECK (NODE)->type_non_common.values)
+#define TYPE_VALUES_RAW(NODE) (TYPE_CHECK(NODE)->type_non_common.values)
+
+#define TYPE_METHODS(NODE) \
+ (RECORD_OR_UNION_CHECK (NODE)->type_non_common.maxval)
+#define TYPE_VFIELD(NODE) \
+ (RECORD_OR_UNION_CHECK (NODE)->type_non_common.minval)
+#define TYPE_METHOD_BASETYPE(NODE) \
+ (FUNC_OR_METHOD_CHECK (NODE)->type_non_common.maxval)
+#define TYPE_OFFSET_BASETYPE(NODE) \
+ (OFFSET_TYPE_CHECK (NODE)->type_non_common.maxval)
+#define TYPE_MAXVAL(NODE) (TYPE_CHECK (NODE)->type_non_common.maxval)
+#define TYPE_MINVAL(NODE) (TYPE_CHECK (NODE)->type_non_common.minval)
+#define TYPE_NEXT_PTR_TO(NODE) \
+ (POINTER_TYPE_CHECK (NODE)->type_non_common.minval)
+#define TYPE_NEXT_REF_TO(NODE) \
+ (REFERENCE_TYPE_CHECK (NODE)->type_non_common.minval)
+#define TYPE_MIN_VALUE(NODE) \
+ (NUMERICAL_TYPE_CHECK (NODE)->type_non_common.minval)
+#define TYPE_MAX_VALUE(NODE) \
+ (NUMERICAL_TYPE_CHECK (NODE)->type_non_common.maxval)
+
+/* If non-NULL, this is an upper bound of the size (in bytes) of an
+ object of the given ARRAY_TYPE_NON_COMMON. This allows temporaries to be
+ allocated. */
+#define TYPE_ARRAY_MAX_SIZE(ARRAY_TYPE) \
+ (ARRAY_TYPE_CHECK (ARRAY_TYPE)->type_non_common.maxval)
+
+/* For record and union types, information about this type, as a base type
+ for itself. */
+#define TYPE_BINFO(NODE) (RECORD_OR_UNION_CHECK(NODE)->type_non_common.binfo)
+
+/* For non record and union types, used in a language-dependent way. */
+#define TYPE_LANG_SLOT_1(NODE) \
+ (NOT_RECORD_OR_UNION_CHECK(NODE)->type_non_common.binfo)
+
+struct GTY(()) tree_type_non_common {
+ struct tree_type_with_lang_specific with_lang_specific;
+ tree values;
+ tree minval;
+ tree maxval;
+ tree binfo;
+};
/* Define accessor macros for information about type inheritance
and basetypes.
@@ -3584,7 +3625,11 @@ union GTY ((ptr_alias (union lang_tree_node),
struct tree_function_decl GTY ((tag ("TS_FUNCTION_DECL"))) function_decl;
struct tree_translation_unit_decl GTY ((tag ("TS_TRANSLATION_UNIT_DECL")))
translation_unit_decl;
- struct tree_type GTY ((tag ("TS_TYPE"))) type;
+ struct tree_type_common GTY ((tag ("TS_TYPE_COMMON"))) type_common;
+ struct tree_type_with_lang_specific GTY ((tag ("TS_TYPE_WITH_LANG_SPECIFIC")))
+ type_with_lang_specific;
+ struct tree_type_non_common GTY ((tag ("TS_TYPE_NON_COMMON")))
+ type_non_common;
struct tree_list GTY ((tag ("TS_LIST"))) list;
struct tree_vec GTY ((tag ("TS_VEC"))) vec;
struct tree_exp GTY ((tag ("TS_EXP"))) exp;