diff options
author | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-07-05 09:35:44 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-07-05 09:35:44 +0000 |
commit | 95b4aca6a30bfa889277649da9f092d070a6a687 (patch) | |
tree | 345ee905cf45afd981c579fc9648f137846a592f /gcc/tree.c | |
parent | acf8677f4e8df04a0285d37c653eb69d12e0cb64 (diff) | |
download | gcc-95b4aca6a30bfa889277649da9f092d070a6a687.zip gcc-95b4aca6a30bfa889277649da9f092d070a6a687.tar.gz gcc-95b4aca6a30bfa889277649da9f092d070a6a687.tar.bz2 |
c-tree.h (TYPE_ACTUAL_ARG_TYPES): Use TYPE_LANG_SLOT_1.
* c-tree.h (TYPE_ACTUAL_ARG_TYPES): Use TYPE_LANG_SLOT_1.
* dwarf2out.c (add_data_member_location_attribute): Check for
TREE_BINFO.
* tree.c (tree_node_kinds): Add "binfos".
(binfo_lang_slots): New.
(make_node_stat): Add TREE_BINFO.
(make_tree_binfo_stat): New.
(tree_node_structure): Add TREE_BINFO.
* tree.def (TREE_BINFO): New.
* tree.h (REC_OR_UNION_CHECK): Rename to ...
(RECORD_OR_UNION_CHECK): ... here.
(NOT_RECORD_OR_UNION_CHECK): New.
(TRE_VIA_VIRTUAL): Allow TREE_LIST or TREE_BINFO.
(TYPE_FIELDS, TYPE_METHODS, TYPE_VFIELD): Adjust for
RECORD_OR_UNION_CHECK.
(TYPE_BINFO): Use RECORD_OR_UNION_CHECK.
(TYPE_LANG_SLOT_1): New.
(BINFO_TYPE, BINFO_OFFSET, BINFO_VTABLE, BINFO_VIRTUALS,
BINFO_BASETYPES, TYPE_BINFO_BASETYPES, BINFO_VPTR_FIELD,
BINFO_BASEACCESSES, BINFO_INHERITANCE_CHAIN): Adjust.
(BINFO_ELTS): Remove.
(BINFO_LANG_SLOT): New.
(struct tree_binfo): New.
(binfo_lang_slots): Declare.
(enum tree_node_structure_enum): Add TS_BINFO.
(union tree_node): Add binfo.
(make_tree_binfo_stat): Declare.
(make_tree_binfo): New.
(enum tree_node_kind): Add binfo_kind.
* cp/call.c (enforce_access): Expect TREE_BINFO.
* cp/class.c (binfo_ctor_vtable): Check TREE_BINFO.
* cp/cp-tree.h (RECORD_OR_UNION_TYPE_CHECK): Remove.
(BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF):
Adjust.
(BINFO_LANG_ELTS): Remove.
(BINFO_LANG_SLOTS): New.
(TYPE_RAISES_EXCEPTIONS, ENUM_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1.
(CLASSTYPE_TEMPLATE_INFO): Adjust.
* cp/pt.c (tsubst): Split TREE_BINFO case from TREE_VEC case.
* cp/search.c (lookup_member): Check TREE_BINFO.
* cp/semantics.c (perform_or_defer_access_check): Likewise.
(check_accessibility_of_qualified_id): Check
deferred_access_no_check.
* cp/tree.c (make_binfo): Use make_tree_binfo.
* java/class.c (make_class): Use make_tree_binfo.
(set_super_info, add_interface_do): Likewise.
* java/java-tree.h (CLASS_HAS_SUPER_FLAG): Expect a BINFO.
* objc/objc-act.c (start_class, objc_declare_protocols,
start_protocols): Use TYPE_LANG_SLOT_1.
* objc/objc-act.h (CLASS_BINFO_ELTS, PROTOCOL_BINFO_ELTS): Rename
to ...
(CLASS_LANG_SLOT_ELTS, PROTOCOL_LANG_SLOT_ELTS): ... here.
(CLASS_IVARS, CLASS_RAW_IVARS, CLASS_STATIC_TEMPLATE,
CLASS_CATEGORY_LIST, CLASS_PROTOCOL_LIST, CLASS_OWN_IVARS,
PROTOCOL_LIST, PROTOCOL_FORWARD_DECL): Use TYPE_LANG_SLOT_1.
From-SVN: r84110
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -71,6 +71,7 @@ static const char * const tree_node_kind_names[] = { "perm_tree_lists", "temp_tree_lists", "vecs", + "binfos", "phi_nodes", "ssa names", "random kinds", @@ -93,6 +94,9 @@ struct type_hash GTY(()) tree type; }; +/* Additional language-dependent binfo slots. */ +unsigned binfo_lang_slots; + /* Initial size of the hash table (rounded to next prime). */ #define TYPE_HASH_INITIAL_SIZE 1000 @@ -267,6 +271,8 @@ make_node_stat (enum tree_code code MEM_STAT_DECL) kind = id_kind; else if (code == TREE_VEC) kind = vec_kind; + else if (code == TREE_BINFO) + kind = binfo_kind; else if (code == PHI_NODE) kind = phi_kind; else if (code == SSA_NAME) @@ -573,6 +579,39 @@ build_complex (tree type, tree real, tree imag) return t; } +/* Build a BINFO with LEN language slots. */ + +tree +make_tree_binfo_stat (unsigned lang_slots MEM_STAT_DECL) +{ + tree t; + static unsigned length; + + if (!length) + { + length = (offsetof (struct tree_binfo, lang_slots) + + (sizeof (((struct tree_binfo *)0)->lang_slots[0]) + * lang_slots)); + binfo_lang_slots = lang_slots; + } + else if (binfo_lang_slots != lang_slots) + abort (); + +#ifdef GATHER_STATISTICS + tree_node_counts[(int) binfo_kind]++; + tree_node_sizes[(int) binfo_kind] += length; +#endif + + t = ggc_alloc_zone_stat (length, tree_zone PASS_MEM_STAT); + + memset (t, 0, length); + + TREE_SET_CODE (t, TREE_BINFO); + + return t; +} + + /* Build a newly constructed TREE_VEC node of length LEN. */ tree @@ -1493,6 +1532,7 @@ tree_node_structure (tree t) case PLACEHOLDER_EXPR: return TS_COMMON; case STATEMENT_LIST: return TS_STATEMENT_LIST; case BLOCK: return TS_BLOCK; + case TREE_BINFO: return TS_BINFO; case VALUE_HANDLE: return TS_VALUE_HANDLE; default: |