+1999-03-15 Mark Mitchell <mark@markmitchell.com>
+
+ * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here.
+ * tree.c (layout_basetypes): Not here.
+ * search.c (dfs_search): Remove; no longer used.
+
1999-03-12 Mark Mitchell <mark@markmitchell.com>
* decl2.c (validate_nonmember_using_decl): Issue sensible
CLEAR_CLASSTYPE_MARKED (BINFO_TYPE (TREE_VEC_ELT (binfos, i)));
CLEAR_CLASSTYPE_MARKED (ref);
+ /* Now that we know all the base-classes, set up the list of virtual
+ bases. */
+ CLASSTYPE_VBASECLASSES (ref) = get_vbase_types (ref);
+
pop_obstacks ();
}
last, 1);
}
-/* Like dfs_walk, but only walk until fn returns something, and return
- that. We also use the real vbase binfos instead of the placeholders
- in the normal binfo hierarchy. START is the most-derived type for this
- hierarchy, so that we can find the vbase binfos. */
-
-static tree
-dfs_search (binfo, fn, start)
- tree binfo, start;
- tree (*fn) PROTO((tree));
-{
- tree binfos = BINFO_BASETYPES (binfo);
- int i, n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
- tree retval;
-
- for (i = 0; i < n_baselinks; i++)
- {
- tree base_binfo = TREE_VEC_ELT (binfos, i);
-
- if (TREE_CODE (BINFO_TYPE (base_binfo)) == TEMPLATE_TYPE_PARM
- || TREE_CODE (BINFO_TYPE (base_binfo)) == TEMPLATE_TEMPLATE_PARM)
- /* Pass */;
- else
- {
- if (TREE_VIA_VIRTUAL (base_binfo) && start)
- base_binfo = binfo_member (BINFO_TYPE (base_binfo),
- CLASSTYPE_VBASECLASSES (start));
- retval = dfs_search (base_binfo, fn, start);
- if (retval)
- return retval;
- }
- }
-
- return fn (binfo);
-}
-
tree markedp (binfo, data)
tree binfo;
void *data ATTRIBUTE_UNUSED;
return binfo;
}
-/* Passed to dfs_search by binfo_for_vtable; determine if bvtable comes
- from BINFO. */
+/* Passed to dfs_walk_real by binfo_for_vtable; determine if bvtable
+ comes from BINFO. */
static tree
dfs_bfv_helper (binfo, data)
TREE_VALUE slot holds the virtual baseclass type. Note that
get_vbase_types makes copies of the virtual base BINFOs, so that
the vbase_types are unshared. */
- CLASSTYPE_VBASECLASSES (rec) = vbase_types = get_vbase_types (rec);
+ vbase_types = CLASSTYPE_VBASECLASSES (rec);
my_friendly_assert (TREE_CODE (TYPE_SIZE (rec)) == INTEGER_CST, 19970302);
const_size = TREE_INT_CST_LOW (TYPE_SIZE (rec));