OSDN Git Service

* search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Sep 1999 01:00:57 +0000 (01:00 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Sep 1999 01:00:57 +0000 (01:00 +0000)
(dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29178 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/search.c

index 6e0fc82..5ee4674 100644 (file)
@@ -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.
index dc81a33..6ce8494 100644 (file)
@@ -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.  */