aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-07-07 10:21:04 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2004-07-07 10:21:04 +0000
commit604a320594b012c8d2cda2fc5d2bbd3230d034b1 (patch)
treef1107852a967ee8014a46e51df142dd36d2f7735 /gcc/cp
parent6b66447a5241687f20ce263f8e51f5a9950aad97 (diff)
downloadgcc-604a320594b012c8d2cda2fc5d2bbd3230d034b1.zip
gcc-604a320594b012c8d2cda2fc5d2bbd3230d034b1.tar.gz
gcc-604a320594b012c8d2cda2fc5d2bbd3230d034b1.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog36
-rw-r--r--gcc/cp/class.c110
-rw-r--r--gcc/cp/cp-tree.h4
-rw-r--r--gcc/cp/decl.c8
-rw-r--r--gcc/cp/dump.c4
-rw-r--r--gcc/cp/error.c2
-rw-r--r--gcc/cp/init.c22
-rw-r--r--gcc/cp/method.c14
-rw-r--r--gcc/cp/name-lookup.c5
-rw-r--r--gcc/cp/pt.c19
-rw-r--r--gcc/cp/ptree.c2
-rw-r--r--gcc/cp/rtti.c14
-rw-r--r--gcc/cp/search.c54
-rw-r--r--gcc/cp/tree.c8
-rw-r--r--gcc/cp/typeck.c10
-rw-r--r--gcc/cp/typeck2.c2
16 files changed, 178 insertions, 136 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index bde9ccf..488d037 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,39 @@
+2004-07-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ * cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove.
+ * 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.
+ * decl.c (xref_basetypes): Likewise.
+ * dump.c (cp_dump_tree): Likewise.
+ * error.c (dump_expr): Likewise.
+ * init.c (sort_mem_initializers, expand_member_init,
+ push_base_cleanups): Likewise.
+ * method.c (do_build_copy_constructor, do_build_assign_reg,
+ synthesize_exception_spec): Likewise.
+ * name-lookup.c (arg_assoc_class):
+ * pt.c (instantiate_class_template, tsubst,
+ get_template_base_recursive):
+ * ptree.c (cxx_print_type):
+ * rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise.
+ * 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
+ * tree.c (copy_base_binfos, make_binfo): Likewise.
+ * typeck.c (commmon_base_type): Likewise
+ * typeck2.c (process_init_constructor): Likewise
+
2004-07-06 Joseph S. Myers <jsm@polyomino.org.uk>
* decl.c (check_tag_decl): Name redeclared type in diagnostic.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index f3ebb83..4cfa587 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -693,8 +693,8 @@ build_primary_vtable (tree binfo, tree type)
/* Initialize the association list for this type, based
on our first approximation. */
- TYPE_BINFO_VTABLE (type) = decl;
- TYPE_BINFO_VIRTUALS (type) = virtuals;
+ BINFO_VTABLE (TYPE_BINFO (type)) = decl;
+ BINFO_VIRTUALS (TYPE_BINFO (type)) = virtuals;
SET_BINFO_NEW_VTABLE_MARKED (TYPE_BINFO (type));
return 1;
}
@@ -1194,8 +1194,8 @@ check_bases (tree t,
int seen_non_virtual_nearly_empty_base_p;
tree binfos;
- binfos = TYPE_BINFO_BASETYPES (t);
- n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
+ binfos = BINFO_BASE_BINFOS (TYPE_BINFO (t));
+ n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (t));
seen_non_virtual_nearly_empty_base_p = 0;
/* An aggregate cannot have baseclasses. */
@@ -1334,8 +1334,8 @@ set_primary_base (tree t, tree binfo)
CLASSTYPE_PRIMARY_BINFO (t) = binfo;
basetype = BINFO_TYPE (binfo);
- TYPE_BINFO_VTABLE (t) = TYPE_BINFO_VTABLE (basetype);
- TYPE_BINFO_VIRTUALS (t) = TYPE_BINFO_VIRTUALS (basetype);
+ BINFO_VTABLE (TYPE_BINFO (t)) = BINFO_VTABLE (TYPE_BINFO (basetype));
+ BINFO_VIRTUALS (TYPE_BINFO (t)) = BINFO_VIRTUALS (TYPE_BINFO (basetype));
TYPE_VFIELD (t) = TYPE_VFIELD (basetype);
}
@@ -1344,7 +1344,7 @@ set_primary_base (tree t, tree binfo)
static void
determine_primary_base (tree t)
{
- unsigned i, n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
+ unsigned i, n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (t));
tree type_binfo;
tree vbase_binfo;
@@ -1356,7 +1356,7 @@ determine_primary_base (tree t)
for (i = 0; i < n_baseclasses; i++)
{
- tree base_binfo = BINFO_BASETYPE (type_binfo, i);
+ tree base_binfo = BINFO_BASE_BINFO (type_binfo, i);
tree basetype = BINFO_TYPE (base_binfo);
if (TYPE_CONTAINS_VPTR_P (basetype))
@@ -1406,7 +1406,7 @@ determine_primary_base (tree t)
{
unsigned k;
tree base_vbase_binfo;
- tree basetype = TYPE_BINFO_BASETYPE (t, j);
+ tree basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (t), j));
for (k = 0; (base_vbase_binfo = VEC_iterate
(tree, CLASSTYPE_VBASECLASSES (basetype), k)); k++)
@@ -1483,7 +1483,7 @@ determine_primary_base (tree t)
static void
finish_struct_bits (tree t)
{
- int i, n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
+ int i, n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (t));
/* Fix up variants (if any). */
tree variants = TYPE_NEXT_VARIANT (t);
@@ -1525,7 +1525,7 @@ finish_struct_bits (tree t)
{
/* Notice whether this class has type conversion functions defined. */
tree binfo = TYPE_BINFO (t);
- tree binfos = BINFO_BASETYPES (binfo);
+ tree binfos = BINFO_BASE_BINFOS (binfo);
tree basetype;
for (i = n_baseclasses-1; i >= 0; i--)
@@ -1626,8 +1626,8 @@ maybe_warn_about_overly_private_class (tree t)
int i;
tree binfo = TYPE_BINFO (t);
- for (i = 0; i < BINFO_N_BASETYPES (binfo); i++)
- if (BINFO_BASEACCESS (binfo, i) != access_private_node)
+ for (i = 0; i < BINFO_N_BASE_BINFOS (binfo); i++)
+ if (BINFO_BASE_ACCESS (binfo, i) != access_private_node)
{
has_nonprivate_method = 1;
break;
@@ -2005,7 +2005,7 @@ dfs_find_final_overrider (tree binfo, void* data)
static tree
dfs_find_final_overrider_q (tree derived, int ix, void *data)
{
- tree binfo = BINFO_BASETYPE (derived, ix);
+ tree binfo = BINFO_BASE_BINFO (derived, ix);
find_final_overrider_data *ffod = (find_final_overrider_data *) data;
if (BINFO_VIRTUAL_P (binfo))
@@ -2393,7 +2393,7 @@ get_basefndecls (tree name, tree t)
{
tree methods;
tree base_fndecls = NULL_TREE;
- int n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
+ int n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (t));
int i;
/* Find virtual functions in T with the indicated NAME. */
@@ -2415,7 +2415,7 @@ get_basefndecls (tree name, tree t)
for (i = 0; i < n_baseclasses; i++)
{
- tree basetype = TYPE_BINFO_BASETYPE (t, i);
+ tree basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (t), i));
base_fndecls = chainon (get_basefndecls (name, basetype),
base_fndecls);
}
@@ -2480,9 +2480,9 @@ warn_hidden (tree t)
base_fndecls = NULL_TREE;
/* Iterate through all of the base classes looking for possibly
hidden functions. */
- for (j = 0; j < CLASSTYPE_N_BASECLASSES (t); j++)
+ for (j = 0; j < BINFO_N_BASE_BINFOS (TYPE_BINFO (t)); j++)
{
- tree basetype = TYPE_BINFO_BASETYPE (t, j);
+ tree basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (t), j));
base_fndecls = chainon (get_basefndecls (name, basetype),
base_fndecls);
}
@@ -3266,11 +3266,11 @@ walk_subobject_offsets (tree type,
/* Iterate through the direct base classes of TYPE. */
if (!type_binfo)
type_binfo = TYPE_BINFO (type);
- for (i = 0; i < BINFO_N_BASETYPES (type_binfo); ++i)
+ for (i = 0; i < BINFO_N_BASE_BINFOS (type_binfo); ++i)
{
tree binfo_offset;
- binfo = BINFO_BASETYPE (type_binfo, i);
+ binfo = BINFO_BASE_BINFO (type_binfo, i);
if (abi_version_at_least (2)
&& BINFO_VIRTUAL_P (binfo))
@@ -3291,7 +3291,7 @@ walk_subobject_offsets (tree type,
/* We cannot rely on BINFO_OFFSET being set for the base
class yet, but the offsets for direct non-virtual
bases can be calculated by going back to the TYPE. */
- orig_binfo = BINFO_BASETYPE (TYPE_BINFO (type), i);
+ orig_binfo = BINFO_BASE_BINFO (TYPE_BINFO (type), i);
binfo_offset = size_binop (PLUS_EXPR,
offset,
BINFO_OFFSET (orig_binfo));
@@ -3735,7 +3735,7 @@ build_base_fields (record_layout_info rli,
/* Chain to hold all the new FIELD_DECLs which stand in for base class
subobjects. */
tree t = rli->t;
- int n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
+ int n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (t));
int i;
/* The primary base class is always allocated first. */
@@ -3748,7 +3748,7 @@ build_base_fields (record_layout_info rli,
{
tree base_binfo;
- base_binfo = BINFO_BASETYPE (TYPE_BINFO (t), i);
+ base_binfo = BINFO_BASE_BINFO (TYPE_BINFO (t), i);
/* The primary base was already allocated above, so we don't
need to allocate it again here. */
@@ -4281,7 +4281,7 @@ create_vtable_ptr (tree t, tree* virtuals_p)
/* This class is non-empty. */
CLASSTYPE_EMPTY_P (t) = 0;
- if (CLASSTYPE_N_BASECLASSES (t))
+ if (BINFO_N_BASE_BINFOS (TYPE_BINFO (t)))
/* If there were any baseclasses, they can't possibly be at
offset zero any more, because that's where the vtable
pointer is. So, converting to a base class is going to
@@ -4364,7 +4364,7 @@ propagate_binfo_offsets (tree binfo, tree offset)
/* Scan all of the bases, pushing the BINFO_OFFSET adjust
downwards. */
- for (i = -1; i < BINFO_N_BASETYPES (binfo); ++i)
+ for (i = -1; i < BINFO_N_BASE_BINFOS (binfo); ++i)
{
tree base_binfo;
@@ -4380,7 +4380,7 @@ propagate_binfo_offsets (tree binfo, tree offset)
}
else
{
- base_binfo = BINFO_BASETYPE (binfo, i);
+ base_binfo = BINFO_BASE_BINFO (binfo, i);
/* Don't do the primary base twice. */
if (base_binfo == primary_binfo)
continue;
@@ -4407,7 +4407,7 @@ layout_virtual_bases (record_layout_info rli, splay_tree offsets)
bool first_vbase = true;
tree *next_field;
- if (CLASSTYPE_N_BASECLASSES (t) == 0)
+ if (BINFO_N_BASE_BINFOS (TYPE_BINFO (t)) == 0)
return;
if (!abi_version_at_least(2))
@@ -4502,9 +4502,9 @@ end_of_class (tree t, int include_virtuals_p)
tree offset;
int i;
- for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); ++i)
+ for (i = 0; i < BINFO_N_BASE_BINFOS (TYPE_BINFO (t)); ++i)
{
- binfo = BINFO_BASETYPE (TYPE_BINFO (t), i);
+ binfo = BINFO_BASE_BINFO (TYPE_BINFO (t), i);
if (!include_virtuals_p
&& BINFO_VIRTUAL_P (binfo)
@@ -4547,9 +4547,9 @@ warn_about_ambiguous_bases (tree t)
tree binfo;
/* Check direct bases. */
- for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); ++i)
+ for (i = 0; i < BINFO_N_BASE_BINFOS (TYPE_BINFO (t)); ++i)
{
- basetype = TYPE_BINFO_BASETYPE (t, i);
+ basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (t), i));
if (!lookup_base (t, basetype, ba_ignore | ba_quiet, NULL))
warning ("direct base `%T' inaccessible in `%T' due to ambiguity",
@@ -5092,15 +5092,16 @@ finish_struct_1 (tree t)
int vindex;
tree fn;
- if (TYPE_BINFO_VTABLE (t))
- my_friendly_assert (DECL_VIRTUAL_P (TYPE_BINFO_VTABLE (t)),
+ if (BINFO_VTABLE (TYPE_BINFO (t)))
+ my_friendly_assert (DECL_VIRTUAL_P (BINFO_VTABLE (TYPE_BINFO (t))),
20000116);
if (!CLASSTYPE_HAS_PRIMARY_BASE_P (t))
- my_friendly_assert (TYPE_BINFO_VIRTUALS (t) == NULL_TREE,
+ my_friendly_assert (BINFO_VIRTUALS (TYPE_BINFO (t)) == NULL_TREE,
20000116);
/* Add entries for virtual functions introduced by this class. */
- TYPE_BINFO_VIRTUALS (t) = chainon (TYPE_BINFO_VIRTUALS (t), virtuals);
+ BINFO_VIRTUALS (TYPE_BINFO (t))
+ = chainon (BINFO_VIRTUALS (TYPE_BINFO (t)), virtuals);
/* Set DECL_VINDEX for all functions declared in this class. */
for (vindex = 0, fn = BINFO_VIRTUALS (TYPE_BINFO (t));
@@ -6255,10 +6256,10 @@ get_vfield_name (tree type)
tree binfo = TYPE_BINFO (type);
char *buf;
- while (BINFO_BASETYPES (binfo)
- && TYPE_CONTAINS_VPTR_P (BINFO_TYPE (BINFO_BASETYPE (binfo, 0)))
- && ! BINFO_VIRTUAL_P (BINFO_BASETYPE (binfo, 0)))
- binfo = BINFO_BASETYPE (binfo, 0);
+ while (BINFO_BASE_BINFOS (binfo)
+ && TYPE_CONTAINS_VPTR_P (BINFO_TYPE (BINFO_BASE_BINFO (binfo, 0)))
+ && ! BINFO_VIRTUAL_P (BINFO_BASE_BINFO (binfo, 0)))
+ binfo = BINFO_BASE_BINFO (binfo, 0);
type = BINFO_TYPE (binfo);
buf = alloca (sizeof (VFIELD_NAME_FORMAT) + TYPE_NAME_LENGTH (type) + 2);
@@ -6341,8 +6342,9 @@ contains_empty_class_p (tree type)
tree field;
int i;
- for (i = 0; i < CLASSTYPE_N_BASECLASSES (type); ++i)
- if (contains_empty_class_p (TYPE_BINFO_BASETYPE (type, i)))
+ for (i = 0; i < BINFO_N_BASE_BINFOS (TYPE_BINFO (type)); ++i)
+ if (contains_empty_class_p
+ (BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (type), i))))
return true;
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
if (TREE_CODE (field) == FIELD_DECL
@@ -6583,7 +6585,7 @@ dump_class_hierarchy_r (FILE *stream,
fprintf (stream, "\n");
}
- base_binfos = BINFO_BASETYPES (binfo);
+ base_binfos = BINFO_BASE_BINFOS (binfo);
if (base_binfos)
{
int ix, n;
@@ -6770,7 +6772,7 @@ finish_vtbls (tree t)
/* We lay out the primary and secondary vtables in one contiguous
vtable. The primary vtable is first, followed by the non-virtual
secondary vtables in inheritance graph order. */
- list = build_tree_list (TYPE_BINFO_VTABLE (t), NULL_TREE);
+ list = build_tree_list (BINFO_VTABLE (TYPE_BINFO (t)), NULL_TREE);
accumulate_vtbl_inits (TYPE_BINFO (t), TYPE_BINFO (t),
TYPE_BINFO (t), t, list);
@@ -6782,7 +6784,7 @@ finish_vtbls (tree t)
accumulate_vtbl_inits (vbase, vbase, TYPE_BINFO (t), t, list);
}
- if (TYPE_BINFO_VTABLE (t))
+ if (BINFO_VTABLE (TYPE_BINFO (t)))
initialize_vtable (TYPE_BINFO (t), TREE_VALUE (list));
}
@@ -6925,11 +6927,11 @@ build_vtt_inits (tree binfo, tree t, tree* inits, tree* index)
*index = size_binop (PLUS_EXPR, *index, TYPE_SIZE_UNIT (ptr_type_node));
/* Recursively add the secondary VTTs for non-virtual bases. */
- for (i = 0; i < BINFO_N_BASETYPES (binfo); ++i)
+ for (i = 0; i < BINFO_N_BASE_BINFOS (binfo); ++i)
{
- b = BINFO_BASETYPE (binfo, i);
+ b = BINFO_BASE_BINFO (binfo, i);
if (!BINFO_VIRTUAL_P (b))
- inits = build_vtt_inits (BINFO_BASETYPE (binfo, i), t,
+ inits = build_vtt_inits (BINFO_BASE_BINFO (binfo, i), t,
inits, index);
}
@@ -7059,7 +7061,7 @@ static tree
dfs_ctor_vtable_bases_queue_p (tree derived, int ix,
void* data)
{
- tree binfo = BINFO_BASETYPE (derived, ix);
+ tree binfo = BINFO_BASE_BINFO (derived, ix);
if (!BINFO_MARKED (binfo) == VTT_MARKED_BINFO_P ((tree) data))
return NULL_TREE;
@@ -7191,15 +7193,15 @@ accumulate_vtbl_inits (tree binfo,
secondary vtable lies from the primary vtable. We can't use
dfs_walk here because we need to iterate through bases of BINFO
and RTTI_BINFO simultaneously. */
- for (i = 0; i < BINFO_N_BASETYPES (binfo); ++i)
+ for (i = 0; i < BINFO_N_BASE_BINFOS (binfo); ++i)
{
- tree base_binfo = BINFO_BASETYPE (binfo, i);
+ tree base_binfo = BINFO_BASE_BINFO (binfo, i);
/* Skip virtual bases. */
if (BINFO_VIRTUAL_P (base_binfo))
continue;
accumulate_vtbl_inits (base_binfo,
- BINFO_BASETYPE (orig_binfo, i),
+ BINFO_BASE_BINFO (orig_binfo, i),
rtti_binfo, t,
inits);
}
@@ -7683,11 +7685,11 @@ add_vcall_offset_vtbl_entries_r (tree binfo, vtbl_init_data* vid)
add_vcall_offset_vtbl_entries_1 (binfo, vid);
/* Scan the non-primary bases of BINFO. */
- for (i = 0; i < BINFO_N_BASETYPES (binfo); ++i)
+ for (i = 0; i < BINFO_N_BASE_BINFOS (binfo); ++i)
{
tree base_binfo;
- base_binfo = BINFO_BASETYPE (binfo, i);
+ base_binfo = BINFO_BASE_BINFO (binfo, i);
if (base_binfo != primary_binfo)
add_vcall_offset_vtbl_entries_r (base_binfo, vid);
}
@@ -7908,7 +7910,7 @@ cp_fold_obj_type_ref (tree ref, tree known_type)
{
HOST_WIDE_INT index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1);
HOST_WIDE_INT i = 0;
- tree v = TYPE_BINFO_VIRTUALS (known_type);
+ tree v = BINFO_VIRTUALS (TYPE_BINFO (known_type));
tree fndecl;
while (i != index)
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index e1e89c8..87e610e 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1258,10 +1258,6 @@ struct lang_type GTY(())
should be initialized.) */
#define CLASSTYPE_VBASECLASSES(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->vbases)
-/* Number of direct baseclasses of NODE. */
-#define CLASSTYPE_N_BASECLASSES(NODE) \
- (BINFO_N_BASETYPES (TYPE_BINFO (NODE)))
-
/* The type corresponding to NODE when NODE is used as a base class,
i.e., NODE without virtual base classes. */
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 5f3b901..d8feecd 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9082,8 +9082,8 @@ xref_basetypes (tree ref, tree base_list)
tree binfos = make_tree_vec (i);
tree accesses = make_tree_vec (i);
- BINFO_BASETYPES (binfo) = binfos;
- BINFO_BASEACCESSES (binfo) = accesses;
+ BINFO_BASE_BINFOS (binfo) = binfos;
+ BINFO_BASE_ACCESSES (binfo) = accesses;
for (i = 0; base_list; base_list = TREE_CHAIN (base_list))
{
@@ -9178,7 +9178,7 @@ xref_basetypes (tree ref, tree base_list)
if (i)
TREE_VEC_LENGTH (accesses) = TREE_VEC_LENGTH (binfos) = i;
else
- BINFO_BASEACCESSES (binfo) = BINFO_BASETYPES (binfo) = NULL_TREE;
+ BINFO_BASE_ACCESSES (binfo) = BINFO_BASE_BINFOS (binfo) = NULL_TREE;
if (max_vbases)
CLASSTYPE_VBASECLASSES (ref) = VEC_alloc (tree, max_vbases);
@@ -9206,7 +9206,7 @@ xref_basetypes (tree ref, tree base_list)
/* Unmark all the types. */
while (i--)
{
- tree basetype = BINFO_TYPE (BINFO_BASETYPE (TYPE_BINFO (ref), i));
+ tree basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (ref), i));
CLEAR_CLASSTYPE_MARKED (basetype);
if (CLASS_TYPE_P (basetype))
diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c
index f5cc1dd..64a462e 100644
--- a/gcc/cp/dump.c
+++ b/gcc/cp/dump.c
@@ -268,9 +268,9 @@ cp_dump_tree (void* dump_info, tree t)
{
int i;
- for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); ++i)
+ for (i = 0; i < BINFO_N_BASE_BINFOS (TYPE_BINFO (t)); ++i)
{
- tree base_binfo = BINFO_BASETYPE (TYPE_BINFO (t), i);
+ tree base_binfo = BINFO_BASE_BINFO (TYPE_BINFO (t), i);
dump_child ("base", BINFO_TYPE (base_binfo));
if (BINFO_VIRTUAL_P (base_binfo))
dump_string (di, "virtual");
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index e345793..6d57963 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1633,7 +1633,7 @@ dump_expr (tree t, int flags)
t = TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (t)));
t = TYPE_METHOD_BASETYPE (t);
- virtuals = TYPE_BINFO_VIRTUALS (TYPE_MAIN_VARIANT (t));
+ virtuals = BINFO_VIRTUALS (TYPE_BINFO (TYPE_MAIN_VARIANT (t)));
n = tree_low_cst (idx, 0);
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 19e51cd..e899b01 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -475,9 +475,9 @@ sort_mem_initializers (tree t, tree mem_inits)
sorted_inits = tree_cons (base, NULL_TREE, sorted_inits);
/* Process the direct bases. */
- for (i = 0; i < CLASSTYPE_N_BASECLASSES (t); ++i)
+ for (i = 0; i < BINFO_N_BASE_BINFOS (TYPE_BINFO (t)); ++i)
{
- base = BINFO_BASETYPE (TYPE_BINFO (t), i);
+ base = BINFO_BASE_BINFO (TYPE_BINFO (t), i);
if (!BINFO_VIRTUAL_P (base))
sorted_inits = tree_cons (base, NULL_TREE, sorted_inits);
}
@@ -941,14 +941,15 @@ expand_member_init (tree name)
{
/* This is an obsolete unnamed base class initializer. The
parser will already have warned about its use. */
- switch (CLASSTYPE_N_BASECLASSES (current_class_type))
+ switch (BINFO_N_BASE_BINFOS (TYPE_BINFO (current_class_type)))
{
case 0:
error ("unnamed initializer for `%T', which has no base classes",
current_class_type);
return NULL_TREE;
case 1:
- basetype = TYPE_BINFO_BASETYPE (current_class_type, 0);
+ basetype = BINFO_TYPE
+ (BINFO_BASE_BINFO (TYPE_BINFO (current_class_type), 0));
break;
default:
error ("unnamed initializer for `%T', which uses multiple inheritance",
@@ -981,11 +982,12 @@ expand_member_init (tree name)
virtual_binfo = NULL_TREE;
/* Look for a direct base. */
- for (i = 0; i < BINFO_N_BASETYPES (class_binfo); ++i)
- if (same_type_p (basetype,
- TYPE_BINFO_BASETYPE (current_class_type, i)))
+ for (i = 0; i < BINFO_N_BASE_BINFOS (class_binfo); ++i)
+ if (same_type_p
+ (basetype, BINFO_TYPE
+ (BINFO_BASE_BINFO (TYPE_BINFO (current_class_type), i))))
{
- direct_binfo = BINFO_BASETYPE (class_binfo, i);
+ direct_binfo = BINFO_BASE_BINFO (class_binfo, i);
break;
}
/* Look for a virtual base -- unless the direct base is itself
@@ -2910,8 +2912,8 @@ push_base_cleanups (void)
}
}
- binfos = BINFO_BASETYPES (TYPE_BINFO (current_class_type));
- n_baseclasses = CLASSTYPE_N_BASECLASSES (current_class_type);
+ binfos = BINFO_BASE_BINFOS (TYPE_BINFO (current_class_type));
+ n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (current_class_type));
/* Take care of the remaining baseclasses. */
for (i = 0; i < n_baseclasses; i++)
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 436359b..6acf765 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -515,8 +515,8 @@ do_build_copy_constructor (tree fndecl)
else
{
tree fields = TYPE_FIELDS (current_class_type);
- int n_bases = CLASSTYPE_N_BASECLASSES (current_class_type);
- tree binfos = TYPE_BINFO_BASETYPES (current_class_type);
+ int n_bases = BINFO_N_BASE_BINFOS (TYPE_BINFO (current_class_type));
+ tree binfos = BINFO_BASE_BINFOS (TYPE_BINFO (current_class_type));
tree member_init_list = NULL_TREE;
int cvquals = cp_type_quals (TREE_TYPE (parm));
int i;
@@ -623,12 +623,14 @@ do_build_assign_ref (tree fndecl)
int i;
/* Assign to each of the direct base classes. */
- for (i = 0; i < CLASSTYPE_N_BASECLASSES (current_class_type); ++i)
+ for (i = 0;
+ i < BINFO_N_BASE_BINFOS (TYPE_BINFO (current_class_type));
+ ++i)
{
tree binfo;
tree converted_parm;
- binfo = BINFO_BASETYPE (TYPE_BINFO (current_class_type), i);
+ binfo = BINFO_BASE_BINFO (TYPE_BINFO (current_class_type), i);
/* We must convert PARM directly to the base class
explicitly since the base class may be ambiguous. */
converted_parm = build_base_path (PLUS_EXPR, parm, binfo, 1);
@@ -789,8 +791,8 @@ synthesize_exception_spec (tree type, tree (*extractor) (tree, void*),
{
tree raises = empty_except_spec;
tree fields = TYPE_FIELDS (type);
- int i, n_bases = CLASSTYPE_N_BASECLASSES (type);
- tree binfos = TYPE_BINFO_BASETYPES (type);
+ int i, n_bases = BINFO_N_BASE_BINFOS (TYPE_BINFO (type));
+ tree binfos = BINFO_BASE_BINFOS (TYPE_BINFO (type));
for (i = 0; i != n_bases; i++)
{
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index ef16689..7c44c89 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -4313,8 +4313,9 @@ arg_assoc_class (struct arg_lookup *k, tree type)
return true;
/* Process baseclasses. */
- for (i = 0; i < CLASSTYPE_N_BASECLASSES (type); i++)
- if (arg_assoc_class (k, TYPE_BINFO_BASETYPE (type, i)))
+ for (i = 0; i < BINFO_N_BASE_BINFOS (TYPE_BINFO (type)); i++)
+ if (arg_assoc_class
+ (k, BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (type), i))))
return true;
/* Process friends. */
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 0a43ede..20f7a01 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5419,11 +5419,11 @@ instantiate_class_template (tree type)
abort ();
#endif
- if (BINFO_BASETYPES (pbinfo))
+ if (BINFO_BASE_BINFOS (pbinfo))
{
tree base_list = NULL_TREE;
- tree pbases = BINFO_BASETYPES (pbinfo);
- tree paccesses = BINFO_BASEACCESSES (pbinfo);
+ tree pbases = BINFO_BASE_BINFOS (pbinfo);
+ tree paccesses = BINFO_BASE_ACCESSES (pbinfo);
tree context = TYPE_CONTEXT (type);
bool pop_p;
int i;
@@ -6888,7 +6888,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
case TREE_BINFO:
/* A binfo node. We always need to make a copy, of the node
- itself and of its BINFO_BASETYPES. */
+ itself and of its BINFO_BASE_BINFOS. */
my_friendly_assert (type, 20040628);
t = copy_node (t);
@@ -6899,10 +6899,11 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
TREE_TYPE (t) = complete_type (type);
if (IS_AGGR_TYPE (type))
{
- BINFO_VTABLE (t) = TYPE_BINFO_VTABLE (type);
- BINFO_VIRTUALS (t) = TYPE_BINFO_VIRTUALS (type);
- if (TYPE_BINFO_BASETYPES (type) != NULL_TREE)
- BINFO_BASETYPES (t) = copy_node (TYPE_BINFO_BASETYPES (type));
+ BINFO_VTABLE (t) = BINFO_VTABLE (TYPE_BINFO (type));
+ BINFO_VIRTUALS (t) = BINFO_VIRTUALS (TYPE_BINFO (type));
+ if (BINFO_BASE_BINFOS (TYPE_BINFO (type)) != NULL_TREE)
+ BINFO_BASE_BINFOS (t)
+ = copy_node (BINFO_BASE_BINFOS (TYPE_BINFO (type)));
}
return t;
@@ -9402,7 +9403,7 @@ get_template_base_recursive (tree tparms,
rval = r;
}
- binfos = BINFO_BASETYPES (arg_binfo);
+ binfos = BINFO_BASE_BINFOS (arg_binfo);
n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
/* Process base types. */
diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index 1d6861c..c9eccf2 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -128,7 +128,7 @@ cxx_print_type (FILE *file, tree node, int indent)
if (TREE_CODE (node) == RECORD_TYPE)
{
- fprintf (file, " n_parents %d", CLASSTYPE_N_BASECLASSES (node));
+ fprintf (file, " n_parents %d", BINFO_N_BASE_BINFOS (TYPE_BINFO (node)));
fprintf (file, " use_template=%d", CLASSTYPE_USE_TEMPLATE (node));
if (CLASSTYPE_INTERFACE_ONLY (node))
fprintf (file, " interface-only");
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 559d594..c23b186 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1033,7 +1033,7 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
}
else if (var_desc == si_class_desc_type_node)
{
- tree base_binfos = BINFO_BASETYPES (TYPE_BINFO (type));
+ tree base_binfos = BINFO_BASE_BINFOS (TYPE_BINFO (type));
tree base_binfo = TREE_VEC_ELT (base_binfos, 0);
tree tinfo = get_tinfo_ptr (BINFO_TYPE (base_binfo));
tree base_inits = tree_cons (NULL_TREE, tinfo, NULL_TREE);
@@ -1044,9 +1044,9 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
{
int hint = class_hint_flags (type);
tree binfo = TYPE_BINFO (type);
- int nbases = BINFO_N_BASETYPES (binfo);
- tree base_binfos = BINFO_BASETYPES (binfo);
- tree base_accesses = BINFO_BASEACCESSES (binfo);
+ int nbases = BINFO_N_BASE_BINFOS (binfo);
+ tree base_binfos = BINFO_BASE_BINFOS (binfo);
+ tree base_accesses = BINFO_BASE_ACCESSES (binfo);
tree base_inits = NULL_TREE;
int ix;
@@ -1188,13 +1188,13 @@ get_pseudo_ti_desc (tree type)
cxx_incomplete_type_error (NULL_TREE, type);
return class_desc_type_node;
}
- else if (!CLASSTYPE_N_BASECLASSES (type))
+ else if (!BINFO_N_BASE_BINFOS (TYPE_BINFO (type)))
return class_desc_type_node;
else
{
tree binfo = TYPE_BINFO (type);
- tree base_binfos = BINFO_BASETYPES (binfo);
- tree base_accesses = BINFO_BASEACCESSES (binfo);
+ tree base_binfos = BINFO_BASE_BINFOS (binfo);
+ tree base_accesses = BINFO_BASE_ACCESSES (binfo);
tree base_binfo = TREE_VEC_ELT (base_binfos, 0);
int num_bases = TREE_VEC_LENGTH (base_binfos);
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index a3ab7c8..0c9188d 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -185,8 +185,8 @@ lookup_base_r (tree binfo, tree base, base_access access,
return found;
}
- bases = BINFO_BASETYPES (binfo);
- accesses = BINFO_BASEACCESSES (binfo);
+ bases = BINFO_BASE_BINFOS (binfo);
+ accesses = BINFO_BASE_ACCESSES (binfo);
if (!bases)
return bk_not_base;
@@ -363,8 +363,8 @@ dynamic_cast_base_recurse (tree subtype, tree binfo, bool is_via_virtual,
}
}
- binfos = BINFO_BASETYPES (binfo);
- accesses = BINFO_BASEACCESSES (binfo);
+ binfos = BINFO_BASE_BINFOS (binfo);
+ accesses = BINFO_BASE_ACCESSES (binfo);
n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
for (i = 0; i < n_baselinks; i++)
{
@@ -682,8 +682,8 @@ dfs_access_in_type (tree binfo, void *data)
/* Otherwise, scan our baseclasses, and pick the most favorable
access. */
- binfos = BINFO_BASETYPES (binfo);
- accesses = BINFO_BASEACCESSES (binfo);
+ binfos = BINFO_BASE_BINFOS (binfo);
+ accesses = BINFO_BASE_ACCESSES (binfo);
n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
for (i = 0; i < n_baselinks; ++i)
{
@@ -759,14 +759,14 @@ access_in_type (tree type, tree decl)
static tree
dfs_accessible_queue_p (tree derived, int ix, void *data ATTRIBUTE_UNUSED)
{
- tree binfo = BINFO_BASETYPE (derived, ix);
+ tree binfo = BINFO_BASE_BINFO (derived, ix);
if (BINFO_MARKED (binfo))
return NULL_TREE;
/* If this class is inherited via private or protected inheritance,
then we can't see it, unless we are a friend of the derived class. */
- if (BINFO_BASEACCESS (derived, ix) != access_public_node
+ if (BINFO_BASE_ACCESS (derived, ix) != access_public_node
&& !is_friend (BINFO_TYPE (derived), current_scope ()))
return NULL_TREE;
@@ -1021,7 +1021,7 @@ struct lookup_field_info {
static tree
lookup_field_queue_p (tree derived, int ix, void *data)
{
- tree binfo = BINFO_BASETYPE (derived, ix);
+ tree binfo = BINFO_BASE_BINFO (derived, ix);
struct lookup_field_info *lfi = (struct lookup_field_info *) data;
/* Don't look for constructors or destructors in base classes. */
@@ -1595,7 +1595,7 @@ bfs_walk (tree binfo,
if (rval)
goto done;
- n_bases = BINFO_N_BASETYPES (binfo);
+ n_bases = BINFO_N_BASE_BINFOS (binfo);
for (ix = 0; ix != n_bases; ix++)
{
tree base_binfo;
@@ -1603,7 +1603,7 @@ bfs_walk (tree binfo,
if (qfn)
base_binfo = (*qfn) (binfo, ix, data);
else
- base_binfo = BINFO_BASETYPE (binfo, ix);
+ base_binfo = BINFO_BASE_BINFO (binfo, ix);
if (base_binfo)
{
@@ -1657,9 +1657,9 @@ dfs_walk_real (tree binfo,
}
/* Process the basetypes. */
- if (BINFO_BASETYPES (binfo))
+ if (BINFO_BASE_BINFOS (binfo))
{
- int i, n = TREE_VEC_LENGTH (BINFO_BASETYPES (binfo));
+ int i, n = TREE_VEC_LENGTH (BINFO_BASE_BINFOS (binfo));
for (i = 0; i != n; i++)
{
tree base_binfo;
@@ -1667,7 +1667,7 @@ dfs_walk_real (tree binfo,
if (qfn)
base_binfo = (*qfn) (binfo, i, data);
else
- base_binfo = BINFO_BASETYPE (binfo, i);
+ base_binfo = BINFO_BASE_BINFO (binfo, i);
if (base_binfo)
{
@@ -1806,7 +1806,7 @@ int
look_for_overrides (tree type, tree fndecl)
{
tree binfo = TYPE_BINFO (type);
- tree basebinfos = BINFO_BASETYPES (binfo);
+ tree basebinfos = BINFO_BASE_BINFOS (binfo);
int nbasebinfos = basebinfos ? TREE_VEC_LENGTH (basebinfos) : 0;
int ix;
int found = 0;
@@ -1959,7 +1959,7 @@ get_pure_virtuals (tree type)
tree
markedp (tree derived, int ix, void *data ATTRIBUTE_UNUSED)
{
- tree binfo = BINFO_BASETYPE (derived, ix);
+ tree binfo = BINFO_BASE_BINFO (derived, ix);
return BINFO_MARKED (binfo) ? binfo : NULL_TREE;
}
@@ -1967,7 +1967,7 @@ markedp (tree derived, int ix, void *data ATTRIBUTE_UNUSED)
tree
unmarkedp (tree derived, int ix, void *data ATTRIBUTE_UNUSED)
{
- tree binfo = BINFO_BASETYPE (derived, ix);
+ tree binfo = BINFO_BASE_BINFO (derived, ix);
return !BINFO_MARKED (binfo) ? binfo : NULL_TREE;
}
@@ -1975,7 +1975,7 @@ unmarkedp (tree derived, int ix, void *data ATTRIBUTE_UNUSED)
static tree
marked_pushdecls_p (tree derived, int ix, void *data ATTRIBUTE_UNUSED)
{
- tree binfo = BINFO_BASETYPE (derived, ix);
+ tree binfo = BINFO_BASE_BINFO (derived, ix);
return (!BINFO_DEPENDENT_BASE_P (binfo)
&& BINFO_PUSHDECLS_MARKED (binfo)) ? binfo : NULL_TREE;
@@ -1984,7 +1984,7 @@ marked_pushdecls_p (tree derived, int ix, void *data ATTRIBUTE_UNUSED)
static tree
unmarked_pushdecls_p (tree derived, int ix, void *data ATTRIBUTE_UNUSED)
{
- tree binfo = BINFO_BASETYPE (derived, ix);
+ tree binfo = BINFO_BASE_BINFO (derived, ix);
return (!BINFO_DEPENDENT_BASE_P (binfo)
&& !BINFO_PUSHDECLS_MARKED (binfo)) ? binfo : NULL_TREE;
@@ -2067,7 +2067,7 @@ dfs_debug_mark (tree binfo, void *data ATTRIBUTE_UNUSED)
static tree
dfs_debug_unmarkedp (tree derived, int ix, void *data ATTRIBUTE_UNUSED)
{
- tree binfo = BINFO_BASETYPE (derived, ix);
+ tree binfo = BINFO_BASE_BINFO (derived, ix);
return (!CLASSTYPE_DEBUG_REQUESTED (BINFO_TYPE (binfo))
? binfo : NULL_TREE);
@@ -2415,14 +2415,14 @@ dfs_check_overlap (tree empty_binfo, void *data)
tree binfo;
for (binfo = TYPE_BINFO (oi->compare_type);
;
- binfo = BINFO_BASETYPE (binfo, 0))
+ binfo = BINFO_BASE_BINFO (binfo, 0))
{
if (BINFO_TYPE (binfo) == BINFO_TYPE (empty_binfo))
{
oi->found_overlap = 1;
break;
}
- else if (BINFO_BASETYPES (binfo) == NULL_TREE)
+ else if (BINFO_BASE_BINFOS (binfo) == NULL_TREE)
break;
}
@@ -2434,7 +2434,7 @@ dfs_check_overlap (tree empty_binfo, void *data)
static tree
dfs_no_overlap_yet (tree derived, int ix, void *data)
{
- tree binfo = BINFO_BASETYPE (derived, ix);
+ tree binfo = BINFO_BASE_BINFO (derived, ix);
struct overlap_info *oi = (struct overlap_info *) data;
return !oi->found_overlap ? binfo : NULL_TREE;
@@ -2466,8 +2466,8 @@ tree
binfo_for_vtable (tree var)
{
tree main_binfo = TYPE_BINFO (DECL_CONTEXT (var));
- tree binfos = TYPE_BINFO_BASETYPES (BINFO_TYPE (main_binfo));
- int n_baseclasses = CLASSTYPE_N_BASECLASSES (BINFO_TYPE (main_binfo));
+ tree binfos = BINFO_BASE_BINFOS (TYPE_BINFO (BINFO_TYPE (main_binfo)));
+ int n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (BINFO_TYPE (main_binfo)));
int i;
for (i = 0; i < n_baseclasses; i++)
@@ -2540,7 +2540,7 @@ copied_binfo (tree binfo, tree here)
int ix, n;
base_binfos = copied_binfo (BINFO_INHERITANCE_CHAIN (binfo), here);
- base_binfos = BINFO_BASETYPES (base_binfos);
+ base_binfos = BINFO_BASE_BINFOS (base_binfos);
n = TREE_VEC_LENGTH (base_binfos);
for (ix = 0; ix != n; ix++)
{
@@ -2601,7 +2601,7 @@ original_binfo (tree binfo, tree here)
{
int ix, n;
- base_binfos = BINFO_BASETYPES (base_binfos);
+ base_binfos = BINFO_BASE_BINFOS (base_binfos);
n = TREE_VEC_LENGTH (base_binfos);
for (ix = 0; ix != n; ix++)
{
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 0863e29..35679eb 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -584,7 +584,7 @@ canonical_type_variant (tree t)
tree
copy_base_binfos (tree binfo, tree t, tree prev)
{
- tree binfos = BINFO_BASETYPES (binfo);
+ tree binfos = BINFO_BASE_BINFOS (binfo);
int n, ix;
if (prev)
@@ -792,11 +792,11 @@ make_binfo (tree offset, tree binfo, tree vtable, tree virtuals)
BINFO_VIRTUALS (new_binfo) = virtuals;
if (binfo && !BINFO_DEPENDENT_BASE_P (binfo)
- && BINFO_BASETYPES (binfo) != NULL_TREE)
+ && BINFO_BASE_BINFOS (binfo) != NULL_TREE)
{
- BINFO_BASETYPES (new_binfo) = copy_node (BINFO_BASETYPES (binfo));
+ BINFO_BASE_BINFOS (new_binfo) = copy_node (BINFO_BASE_BINFOS (binfo));
/* We do not need to copy the accesses, as they are read only. */
- BINFO_BASEACCESSES (new_binfo) = BINFO_BASEACCESSES (binfo);
+ BINFO_BASE_ACCESSES (new_binfo) = BINFO_BASE_ACCESSES (binfo);
}
return new_binfo;
}
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 4f47350..1588cbc 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1143,10 +1143,11 @@ common_base_type (tree tt1, tree tt2)
/* Otherwise, try to find a unique baseclass of TT1
that is shared by TT2, and follow that down. */
- for (i = CLASSTYPE_N_BASECLASSES (tt1)-1; i >= 0; i--)
+ for (i = BINFO_N_BASE_BINFOS (TYPE_BINFO (tt1))-1; i >= 0; i--)
{
- tree basetype = TYPE_BINFO_BASETYPE (tt1, i);
+ tree basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (tt1), i));
tree trial = common_base_type (basetype, tt2);
+
if (trial)
{
if (trial == error_mark_node)
@@ -1159,10 +1160,11 @@ common_base_type (tree tt1, tree tt2)
}
/* Same for TT2. */
- for (i = CLASSTYPE_N_BASECLASSES (tt2)-1; i >= 0; i--)
+ for (i = BINFO_N_BASE_BINFOS (TYPE_BINFO (tt2))-1; i >= 0; i--)
{
- tree basetype = TYPE_BINFO_BASETYPE (tt2, i);
+ tree basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (tt2), i));
tree trial = common_base_type (tt1, basetype);
+
if (trial)
{
if (trial == error_mark_node)
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 2e08d56..5ddfdd5 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -804,7 +804,7 @@ process_init_constructor (tree type, tree init, tree* elts)
return error_mark_node;
}
- if (TYPE_BINFO_BASETYPES (type))
+ if (BINFO_BASE_BINFOS (TYPE_BINFO (type)))
{
sorry ("initializer list for object of class with base classes");
return error_mark_node;