+1999-09-07 Jason Merrill <jason@yorick.cygnus.com>
+
+ * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT.
+ (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove.
+
1999-09-07 Mark Mitchell <mark@codesourcery.com>
* Makefile.in (tree.o): Depend on ggc.h.
1999-08-13 Gavin Romig-Koch <gavin@cygnus.com>
- cp-tree.h (init_cplus_unsave): New.
+ * cp-tree.h (init_cplus_unsave): New.
(cplus_unsave_expr_now): New.
- lex.c (init_parse): Call init_cplus_unsave.
- tree.c (init_cplus_unsave): New.
+ * lex.c (init_parse): Call init_cplus_unsave.
+ * tree.c (init_cplus_unsave): New.
(cplus_unsave_expr_now): New.
1999-08-13 Mark Mitchell <mark@codesourcery.com>
1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * decl.c: Remove redundant prototype for `print_error_function'.
- (lang_print_error_function): Constify a char*.
-
* lex.c (lang_identify): Likewise.
1999-08-09 Bernd Schmidt <bernds@cygnus.co.uk>
1999-07-24 Richard Henderson <rth@cygnus.com>
- * decl.c (ptr_type_node, va_list_type_node): New.
* gxx.gperf (__builtin_va_arg): New.
* parse.y (VA_ARG): New token.
(unary_expr): Recognize it.
tree (*) (tree, void *),
tree (*) (tree, void *),
void *));
-static tree dfs_bfv_queue_p PROTO ((tree, void *));
-static tree dfs_bfv_helper PROTO ((tree, void *));
static tree get_virtuals_named_this_r PROTO ((tree, void *));
static tree context_for_name_lookup PROTO ((tree));
static tree canonical_binfo PROTO ((tree));
return oi.found_overlap;
}
-struct bfv_info {
- tree vbases;
- tree var;
-};
-
-static tree
-dfs_bfv_queue_p (binfo, data)
- tree binfo;
- void *data;
-{
- struct bfv_info *bfvi = (struct bfv_info *) data;
-
- /* Use the real virtual base class objects, not the placeholders in
- the usual hierarchy. */
- if (TREE_VIA_VIRTUAL (binfo))
- return binfo_member (BINFO_TYPE (binfo), bfvi->vbases);
-
- return binfo;
-}
-
-/* Passed to dfs_walk_real by binfo_for_vtable; determine if bvtable
- comes from BINFO. */
-
-static tree
-dfs_bfv_helper (binfo, data)
- tree binfo;
- void *data;
-{
- struct bfv_info *bfvi = (struct bfv_info *) data;
-
- if (BINFO_VTABLE (binfo) == bfvi->var)
- return binfo;
- return NULL_TREE;
-}
-
/* Given a vtable VAR, determine which binfo it comes from. */
tree
binfo_for_vtable (var)
tree var;
{
- tree type;
- struct bfv_info bfvi;
+ tree binfo = TYPE_BINFO (DECL_CONTEXT (var));
+ tree binfos;
+ int i;
- type = DECL_CONTEXT (var);
- bfvi.vbases = CLASSTYPE_VBASECLASSES (type);
- bfvi.var = var;
- return dfs_walk_real (TYPE_BINFO (type),
- 0, dfs_bfv_helper, dfs_bfv_queue_p, &bfvi);
+ while (1)
+ {
+ binfos = BINFO_BASETYPES (binfo);
+ if (binfos == NULL_TREE)
+ break;
+
+ i = CLASSTYPE_VFIELD_PARENT (BINFO_TYPE (binfo));
+ if (i == -1)
+ break;
+
+ binfo = TREE_VEC_ELT (binfos, i);
+ }
+
+ return binfo;
}
/* Returns 1 iff BINFO is from a direct or indirect virtual base. */