aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2001-12-02 21:43:18 -0500
committerJason Merrill <jason@gcc.gnu.org>2001-12-02 21:43:18 -0500
commitff6685064f4ecab0bcb1b89bb88f6ed2ef9b4ef1 (patch)
tree4081a8ca590385ff68bd8ce3965d595d7ab0a40b
parent6fa3f289e4fbf8c0cd64e59bb840116f3d8eb72e (diff)
downloadgcc-ff6685064f4ecab0bcb1b89bb88f6ed2ef9b4ef1.zip
gcc-ff6685064f4ecab0bcb1b89bb88f6ed2ef9b4ef1.tar.gz
gcc-ff6685064f4ecab0bcb1b89bb88f6ed2ef9b4ef1.tar.bz2
class.c (finish_vtbls): Fill in BINFO_VPTR_FIELD in the immediate binfos for our virtual bases.
* class.c (finish_vtbls): Fill in BINFO_VPTR_FIELD in the immediate binfos for our virtual bases. From-SVN: r47543
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/class.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2b6914b..eaa3a9b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 736273b..0513c7e 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -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));
}