aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1999-09-07 21:00:57 -0400
committerJason Merrill <jason@gcc.gnu.org>1999-09-07 21:00:57 -0400
commit5430acc846acabe753e2c7d159aa27673a7daeb6 (patch)
tree502fa12ca8df03ea84b28d6ea04d8c9234a0c248
parentfd59e3a04e282342dc4d5ab878a2df37bd44e2a8 (diff)
downloadgcc-5430acc846acabe753e2c7d159aa27673a7daeb6.zip
gcc-5430acc846acabe753e2c7d159aa27673a7daeb6.tar.gz
gcc-5430acc846acabe753e2c7d159aa27673a7daeb6.tar.bz2
search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT.
* search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT. (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove. From-SVN: r29178
-rw-r--r--gcc/cp/ChangeLog15
-rw-r--r--gcc/cp/search.c61
2 files changed, 25 insertions, 51 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6e0fc82..5ee4674 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+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.
@@ -1010,10 +1015,10 @@ Mon Aug 23 22:17:20 1999 Mumit Khan <khan@xraylith.wisc.edu>
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>
@@ -1195,9 +1200,6 @@ Mon Aug 23 22:17:20 1999 Mumit Khan <khan@xraylith.wisc.edu>
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>
@@ -1614,7 +1616,6 @@ Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com)
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.
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index dc81a33..6ce8494 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -131,8 +131,6 @@ static tree dfs_walk_real PROTO ((tree,
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));
@@ -3270,55 +3268,30 @@ types_overlap_p (empty_type, next_type)
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. */