diff options
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 56ec82d..63c1e8e 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -69,9 +69,8 @@ Boston, MA 02111-1307, USA. */ or FIELD_DECL). NEED_TEMPORARY_P (in REF_BIND, BASE_CONV) IDENTIFIER_TYPENAME_P (in IDENTIFIER_NODE) - 5: BINFO_PRIMARY_MARKED_P (in BINFO) - 6: BINFO_VBASE_PRIMARY_P (in BINFO) - BINFO_ACCESS (in BINFO) + 5: Unused. + 6: BINFO_ACCESS (in BINFO) Usage of TYPE_LANG_FLAG_?: 0: C_TYPE_FIELDS_READONLY (in RECORD_TYPE or UNION_TYPE). @@ -100,7 +99,10 @@ Boston, MA 02111-1307, USA. */ DECL_THUNK_P (in a member FUNCTION_DECL) Usage of language-independent fields in a language-dependent manner: - + + TREE_USED + This field is BINFO_INDIRECT_PRIMARY_P in a BINFO. + TYPE_ALIAS_SET This field is used by TYPENAME_TYPEs, TEMPLATE_TYPE_PARMs, and so forth as a substitute for the mark bits provided in `lang_type'. @@ -1391,8 +1393,8 @@ struct lang_type unsigned dummy : 8; int vsize; - int vfield_parent; + tree primary_base; tree vfields; tree vbases; tree tags; @@ -1562,34 +1564,16 @@ struct lang_type nested member class templates. */ #define CLASSTYPE_TAGS(NODE) (TYPE_LANG_SPECIFIC(NODE)->tags) -/* If this value is non-negative, it is the index (in the - TYPE_BINFO_BASETYPES) for the base-class whose vtable pointer we - are reusing. For example, in D : B1, B2, PARENT would be 0, if D's - vtable came from B1, 1, if D's vtable came from B2. */ -#define CLASSTYPE_VFIELD_PARENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfield_parent) - /* Nonzero if NODE has a primary base class, i.e., a base class with which it shares the virtual fucntion table pointer. */ #define CLASSTYPE_HAS_PRIMARY_BASE_P(NODE) \ - (CLASSTYPE_VFIELD_PARENT (NODE) != -1) + (CLASSTYPE_PRIMARY_BINFO (NODE) != NULL_TREE) /* If non-NULL, this is the binfo for the primary base class, i.e., the base class which contains the virtual function table pointer for this class. */ #define CLASSTYPE_PRIMARY_BINFO(NODE) \ - (BINFO_PRIMARY_BINFO (TYPE_BINFO (NODE))) - -/* If non-NULL, this is the binfo for the primary base of BINFO. Note - that in a complex hierarchy the resulting BINFO may not actually - *be* primary. In particular if the resulting BINFO is a virtual - base, and it occurs elsewhere in the hierarchy, then this - occurrence may not actually be a primary base in the complete - object. Check BINFO_PRIMARY_MARKED_P to be sure. */ -#define BINFO_PRIMARY_BINFO(NODE) \ - (CLASSTYPE_HAS_PRIMARY_BASE_P (BINFO_TYPE (NODE)) \ - ? BINFO_BASETYPE (NODE, \ - CLASSTYPE_VFIELD_PARENT (BINFO_TYPE (NODE))) \ - : NULL_TREE) + (TYPE_LANG_SPECIFIC (NODE)->primary_base) /* The number of virtual functions present in this class' virtual function table. */ @@ -1752,11 +1736,8 @@ struct lang_type class of a non-primary virtual base. This flag is only valid for paths (given by BINFO_INHERITANCE_CHAIN) that really exist in the final object. */ -#define BINFO_PRIMARY_MARKED_P(NODE) TREE_LANG_FLAG_5 (NODE) - -/* Nonzero if the virtual baseclass with the type given by this BINFO - is primary *somewhere* in the hierarchy. */ -#define BINFO_VBASE_PRIMARY_P(NODE) TREE_LANG_FLAG_6 (NODE) +#define BINFO_PRIMARY_MARKED_P(NODE) \ + (BINFO_PRIMARY_BASE_OF (NODE) != NULL_TREE) /* The index in the VTT where this subobject's sub-VTT can be found. NULL_TREE if there is no sub-VTT. */ @@ -1766,10 +1747,21 @@ struct lang_type found. NULL_TREE if there is no secondary vptr in the VTT. */ #define BINFO_VPTR_INDEX(NODE) TREE_VEC_ELT ((NODE), 9) +/* The binfo of which NODE is a primary base. (This is different from + BINFO_INHERITANCE_CHAIN for virtual base because a virtual base is + sometimes a primary base for a class for which it is not an + immediate base.) */ +#define BINFO_PRIMARY_BASE_OF(NODE) TREE_VEC_ELT ((NODE), 10) + /* Nonzero if this binfo declares a virtual function which is overridden along a virtual path. */ #define BINFO_OVERRIDE_ALONG_VIRTUAL_PATH_P(NODE) TREE_LANG_FLAG_2 (NODE) +/* Nonzero if this binfo is an indirect primary base, i.e. a virtual + base that is a primary base of some of other class in the + hierarchy. */ +#define BINFO_INDIRECT_PRIMARY_P(NODE) TREE_USED (NODE) + /* Used by various search routines. */ #define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE) @@ -3844,6 +3836,7 @@ extern void note_name_declared_in_class PARAMS ((tree, tree)); extern tree get_vtbl_decl_for_binfo PARAMS ((tree)); extern tree in_charge_arg_for_name PARAMS ((tree)); extern tree get_vtt_name PARAMS ((tree)); +extern tree get_primary_binfo PARAMS ((tree)); /* in cvt.c */ extern tree convert_to_reference PARAMS ((tree, tree, int, int, tree)); |