From 604a320594b012c8d2cda2fc5d2bbd3230d034b1 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Wed, 7 Jul 2004 10:21:04 +0000 Subject: tree.h (TYPE_BINFO_OFFSET, [...]): Remove. * tree.h (TYPE_BINFO_OFFSET, TYPE_BINFO_VTABLE, TYPE_BINFO_VIRTUALS, TYPE_BINFO_BASETYPES, TYPE_BINFO_BASETYPE): Remove. (BINFO_BASETYPES, BINFO_N_BASETYPES, BINFO_BASETYPE): Rename to ... (BINFO_BASE_BINFOS, BINFO_N_BASE_BINFOS, BINFO_BASE_BINFO): ... here. (BINFO_BASEACCESSES, BINFO_BASEACCESS): Rename to ... (BINFO_BASE_ACCESSES, BINFO_BASE_ACCESS): ... here. (BINFO_INHERITANCE_CHAIN): Redocument as it is actually used. (struct tree_binfo): Rename base_types to base_binfos. * alias.c (record_component_aliases): Adjust BINFO macros. * dbxout.c (dbxout_type): Likewise. * dwarf2out.c (gen_member_die): Likewise. * sdbout.c (sdbout_one_type): Likewise. * tree-dump.c (deque_and_dump): Likewise. * config/i386/i386.c (classify_argument, contains_128bit_aligned_vector_p): Likewise. * cp/cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove. * cp/class.c (build_primary_vtable, check_bases, determine_primary_base, finish_struct_bits, maybe_warn_about_overly_private_class, dfs_find_final_overrider_q, get_basefndecls, warn_hidden, walk_subobject_offsets, build_base_fields, create_vtable_ptr, propagate_binfo_offsets, layout_virtual_bases, end_of_class, warn_about_ambiguous_bases, finish_struct_1, get_vfield_name, contains_empty_class_p, dump_class_hierarchy_r, finish_vtbls, build_vtt_inits, dfs_ctor_vtable_bases_queue_p, accumulate_vtbl_inits, add_vcall_offset_vtbl_entries_r, cp_fold_obj_type_ref): Adjust BINFO macros. * cp/decl.c (xref_basetypes): Likewise. * cp/dump.c (cp_dump_tree): Likewise. * cp/error.c (dump_expr): Likewise. * cp/init.c (sort_mem_initializers, expand_member_init, push_base_cleanups): Likewise. * cp/method.c (do_build_copy_constructor, do_build_assign_reg, synthesize_exception_spec): Likewise. * cp/name-lookup.c (arg_assoc_class): * cp/pt.c (instantiate_class_template, tsubst, get_template_base_recursive): * cp/ptree.c (cxx_print_type): * cp/rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise. * cp/search.c (lookup_base_r, dynamic_cast_base_recurse, dfs_access_in_type, access_in_type, lookup_field_queue_p, bfs_walk, dfs_walk_real, look_for_overrides, markedp, unmarkedp, marked_pushdecls_p, unmarked_pushdecls_p, dfs_debug_markedp, dfs_debug_unmarkedp, dfs_check_overlap, dfs_no_overlap_yet, binfo_for_vtable, copied_binfo, original_binfo): Likewise * cp/tree.c (copy_base_binfos, make_binfo): Likewise. * cp/typeck.c (commmon_base_type): Likewise * cp/typeck2.c (process_init_constructor): Likewise * java/java-tree.h (CLASSTYPE_SPUER): Adjust BINFO macros. (TYPE_NVIRTUALS, TYPE_VTABLE): Likewise. * java/class.c (set_super_info, class_depth, interface_of_p, maybe_add_interface, add_interface, make_class_data, layout_class, add_miranda_methods): Adjust BINFO macros. * java/expr.c (can_widen_reference_to, lookup_field): Likewise. * java/jcf-write.c (generate_classfile): Likewise. * java/parse.y (patch_anonymous_class, check_inner_circular_reference, check_circular_reference, java_complete_class, check_abstract_method_definitions, java_check_abstract_method_definitions, check_interface_throws_clauses, java_check_abstract_methods, lookup_java_interface_method2, find_applicable_accessible_methods_list): Likewise. * java/typeck.c (find_method_in_interface): Likewise. * java/verify.c (merge_types): Likewise. From-SVN: r84198 --- gcc/tree.h | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) (limited to 'gcc/tree.h') diff --git a/gcc/tree.h b/gcc/tree.h index 51fc2ad..ab22cda 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -202,7 +202,7 @@ struct tree_common GTY(()) TREE_STATIC in VAR_DECL, FUNCTION_DECL, CONSTRUCTOR, ADDR_EXPR - TREE_VIA_VIRTUAL in + BINFO_VIRTUAL_P in TREE_BINFO TREE_CONSTANT_OVERFLOW in INTEGER_CST, REAL_CST, COMPLEX_CST, VECTOR_CST @@ -1616,7 +1616,6 @@ struct tree_type GTY(()) This is always 0 except when there is multiple inheritance. */ #define BINFO_OFFSET(NODE) (TREE_BINFO_CHECK(NODE)->binfo.offset) -#define TYPE_BINFO_OFFSET(NODE) BINFO_OFFSET (TYPE_BINFO (NODE)) #define BINFO_OFFSET_ZEROP(NODE) (integer_zerop (BINFO_OFFSET (NODE))) /* The virtual function table belonging to this basetype. Virtual @@ -1624,13 +1623,11 @@ struct tree_type GTY(()) The entries of a virtual function table are language-dependent. */ #define BINFO_VTABLE(NODE) (TREE_BINFO_CHECK(NODE)->binfo.vtable) -#define TYPE_BINFO_VTABLE(NODE) BINFO_VTABLE (TYPE_BINFO (NODE)) /* The virtual functions in the virtual function table. This is a TREE_LIST that is used as an initial approximation for building a virtual function table for this basetype. */ #define BINFO_VIRTUALS(NODE) (TREE_BINFO_CHECK(NODE)->binfo.virtuals) -#define TYPE_BINFO_VIRTUALS(NODE) BINFO_VIRTUALS (TYPE_BINFO (NODE)) /* A vector of binfos for the direct basetypes inherited by this basetype. @@ -1643,17 +1640,14 @@ struct tree_type GTY(()) base types at the end of this TREE_VEC (instead of using another TREE_VEC). This would simplify the calculation of how many basetypes a given type had. */ -#define BINFO_BASETYPES(NODE) (TREE_BINFO_CHECK(NODE)->binfo.base_types) -#define TYPE_BINFO_BASETYPES(NODE) BINFO_BASETYPES (TYPE_BINFO (NODE)) +#define BINFO_BASE_BINFOS(NODE) (TREE_BINFO_CHECK(NODE)->binfo.base_binfos) /* The number of basetypes for NODE. */ -#define BINFO_N_BASETYPES(NODE) \ - (BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (BINFO_BASETYPES (NODE)) : 0) +#define BINFO_N_BASE_BINFOS(NODE) \ + (BINFO_BASE_BINFOS (NODE) ? TREE_VEC_LENGTH (BINFO_BASE_BINFOS (NODE)) : 0) -/* Accessor macro to get to the Nth basetype of this basetype. */ -#define BINFO_BASETYPE(NODE,N) TREE_VEC_ELT (BINFO_BASETYPES (NODE), (N)) -#define TYPE_BINFO_BASETYPE(NODE,N) \ - BINFO_TYPE (TREE_VEC_ELT (BINFO_BASETYPES (TYPE_BINFO (NODE)), (N))) +/* Accessor macro to get to the Nth base binfo of this binfo. */ +#define BINFO_BASE_BINFO(NODE,N) TREE_VEC_ELT (BINFO_BASE_BINFOS (NODE), (N)) /* For a BINFO record describing a virtual base class, i.e., one where TREE_VIA_VIRTUAL is set, this field assists in locating the virtual @@ -1665,25 +1659,17 @@ struct tree_type GTY(()) /* Indicates the accesses this binfo has to its bases. The values are access_public_node, access_protected_node or access_private_node. If this array is not present, public access is implied. */ -#define BINFO_BASEACCESSES(NODE) (TREE_BINFO_CHECK(NODE)->binfo.base_accesses) -#define BINFO_BASEACCESS(NODE,N) TREE_VEC_ELT (BINFO_BASEACCESSES(NODE), (N)) +#define BINFO_BASE_ACCESSES(NODE) (TREE_BINFO_CHECK(NODE)->binfo.base_accesses) +#define BINFO_BASE_ACCESS(NODE,N) TREE_VEC_ELT (BINFO_BASE_ACCESSES(NODE), (N)) /* Number of language independent elements in a binfo. Languages may add additional trailing elements. */ #define BINFO_LANG_SLOT(NODE,N) (TREE_BINFO_CHECK(NODE)->binfo.lang_slots[N]) -/* Slot used to build a chain that represents a use of inheritance. - For example, if X is derived from Y, and Y is derived from Z, - then this field can be used to link the binfo node for X to - the binfo node for X's Y to represent the use of inheritance - from X to Y. Similarly, this slot of the binfo node for X's Y - can point to the Z from which Y is inherited (in X's inheritance - hierarchy). In this fashion, one can represent and traverse specific - uses of inheritance using the binfo nodes themselves (instead of - consing new space pointing to binfo nodes). - It is up to the language-dependent front-ends to maintain - this information as necessary. */ +/* The BINFO_INHERITANCE_CHAIN points at the binfo for the base + inheriting this base for non-virtual bases. For virtual bases it + points to the binfo of the most derived type. */ #define BINFO_INHERITANCE_CHAIN(NODE) \ (TREE_BINFO_CHECK(NODE)->binfo.inheritance) @@ -1694,7 +1680,7 @@ struct tree_binfo GTY (()) tree offset; tree vtable; tree virtuals; - tree base_types; + tree base_binfos; tree vptr_field; tree base_accesses; tree inheritance; -- cgit v1.1