aboutsummaryrefslogtreecommitdiff
path: root/gcc/dbxout.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2001-11-29 21:38:43 -0500
committerJason Merrill <jason@gcc.gnu.org>2001-11-29 21:38:43 -0500
commit649ce3f25afb756432e9e3c8558bf09f3daef4e5 (patch)
treec86dc6969fd82952537e402e6e79204e43f4aa63 /gcc/dbxout.c
parentc7c737361bb8906ad2b086b971f581546f0297f3 (diff)
downloadgcc-649ce3f25afb756432e9e3c8558bf09f3daef4e5.zip
gcc-649ce3f25afb756432e9e3c8558bf09f3daef4e5.tar.gz
gcc-649ce3f25afb756432e9e3c8558bf09f3daef4e5.tar.bz2
dwarf2out.c (add_data_member_location_attribute): Do the right thing for virtual bases.
* dwarf2out.c (add_data_member_location_attribute): Do the right thing for virtual bases. * dbxout.c (dbxout_type): For a virtual base, print the offset within the vtable. From-SVN: r47469
Diffstat (limited to 'gcc/dbxout.c')
-rw-r--r--gcc/dbxout.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 344ebbe..8b14f5d 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -1492,8 +1492,15 @@ dbxout_type (type, full)
putc (TREE_VIA_VIRTUAL (child) ? '1' : '0', asmfile);
putc (TREE_VIA_PUBLIC (child) ? '2' : '0', asmfile);
CHARS (2);
- print_wide_int (tree_low_cst (BINFO_OFFSET (child), 0)
- * BITS_PER_UNIT);
+ if (TREE_VIA_VIRTUAL (child))
+ /* For a virtual base, print the (negative) offset within
+ the vtable where we must look to find the necessary
+ adjustment. */
+ print_wide_int (tree_low_cst (BINFO_VPTR_FIELD (child), 0)
+ * BITS_PER_UNIT);
+ else
+ print_wide_int (tree_low_cst (BINFO_OFFSET (child), 0)
+ * BITS_PER_UNIT);
putc (',', asmfile);
CHARS (1);
dbxout_type (BINFO_TYPE (child), 0);