]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
class.c (finish_vtbls): Fill in BINFO_VPTR_FIELD in the immediate binfos for our...
authorJason Merrill <jason@redhat.com>
Mon, 3 Dec 2001 02:43:18 +0000 (21:43 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 3 Dec 2001 02:43:18 +0000 (21:43 -0500)
        * class.c (finish_vtbls): Fill in BINFO_VPTR_FIELD in the
        immediate binfos for our virtual bases.

From-SVN: r47543

gcc/cp/ChangeLog
gcc/cp/class.c

index 2b6914bdfd8f6acb7afd3717289558cfb8e66eed..eaa3a9ba4d617d43eaf95c0ce18e3ff60f85c656 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-03  Jason Merrill  <jason@redhat.com>
+
+       * class.c (finish_vtbls): Fill in BINFO_VPTR_FIELD in the
+       immediate binfos for our virtual bases.
+
 2001-12-02  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * call.c (build_java_interface_fn_ref): Similarly.
index 736273b8c96e2252d4a7ed8c1c993b33f1fd0355..0513c7eed28e3c73ec1961fda6cf43f7ab56312c 100644 (file)
@@ -6789,6 +6789,7 @@ finish_vtbls (t)
 {
   tree list;
   tree vbase;
+  int i;
 
   /* We lay out the primary and secondary vtables in one contiguous
      vtable.  The primary vtable is first, followed by the non-virtual
@@ -6813,6 +6814,18 @@ finish_vtbls (t)
                             TYPE_BINFO (t), t, list);
     }
 
+  /* Fill in BINFO_VPTR_FIELD in the immediate binfos for our virtual
+     base classes, for the benefit of the debugging backends.  */
+  for (i = 0; i < BINFO_N_BASETYPES (TYPE_BINFO (t)); ++i)
+    {
+      tree base = BINFO_BASETYPE (TYPE_BINFO (t), i);
+      if (TREE_VIA_VIRTUAL (base))
+       {
+         tree vbase = binfo_for_vbase (BINFO_TYPE (base), t);
+         BINFO_VPTR_FIELD (base) = BINFO_VPTR_FIELD (vbase);
+       }
+    }
+
   if (TYPE_BINFO_VTABLE (t))
     initialize_vtable (TYPE_BINFO (t), TREE_VALUE (list));
 }