This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to dwarf2/stabs output for virtual bases
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Nov 2001 13:06:57 +0000
- Subject: Re: PATCH to dwarf2/stabs output for virtual bases
- References: <wvladx5kmu8.fsf@prospero.cambridge.redhat.com>
This should only apply to C++.
2001-11-30 Jason Merrill <jason@redhat.com>
* dwarf2out.c (is_cxx): New fn.
(add_data_member_location_attribute): Check it.
* dbxout.c (dbxout_type): Only look at BINFO_VPTR_FIELD for C++.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.333
diff -c -p -r1.333 dwarf2out.c
*** dwarf2out.c 2001/11/30 02:38:42 1.333
--- dwarf2out.c 2001/11/30 13:07:08
*************** is_c_family ()
*** 4831,4836 ****
--- 4831,4843 ----
}
static inline int
+ is_cxx ()
+ {
+ return (get_AT_unsigned (comp_unit_die, DW_AT_language)
+ == DW_LANG_C_plus_plus);
+ }
+
+ static inline int
is_fortran ()
{
unsigned lang = get_AT_unsigned (comp_unit_die, DW_AT_language);
*************** add_data_member_location_attribute (die,
*** 8414,8420 ****
{
/* We're working on the TAG_inheritance for a base class. */
! if (TREE_VIA_VIRTUAL (decl))
{
/* For C++ virtual bases we can't just use BINFO_OFFSET, as they
aren't at a fixed offset from all (sub)objects of the same
--- 8421,8427 ----
{
/* We're working on the TAG_inheritance for a base class. */
! if (TREE_VIA_VIRTUAL (decl) && is_cxx ())
{
/* For C++ virtual bases we can't just use BINFO_OFFSET, as they
aren't at a fixed offset from all (sub)objects of the same
Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.111
diff -c -p -r1.111 dbxout.c
*** dbxout.c 2001/11/30 02:38:43 1.111
--- dbxout.c 2001/11/30 13:07:10
*************** dbxout_type (type, full)
*** 1492,1498 ****
putc (TREE_VIA_VIRTUAL (child) ? '1' : '0', asmfile);
putc (TREE_VIA_PUBLIC (child) ? '2' : '0', asmfile);
CHARS (2);
! 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. */
--- 1492,1498 ----
putc (TREE_VIA_VIRTUAL (child) ? '1' : '0', asmfile);
putc (TREE_VIA_PUBLIC (child) ? '2' : '0', asmfile);
CHARS (2);
! if (TREE_VIA_VIRTUAL (child) && strcmp (lang_hooks.name, "GNU C++") == 0)
/* For a virtual base, print the (negative) offset within
the vtable where we must look to find the necessary
adjustment. */