dwarf2out.c (is_cxx): New fn.
authorJason Merrill <jason@redhat.com>
Fri, 30 Nov 2001 14:00:25 +0000 (09:00 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 30 Nov 2001 14:00:25 +0000 (09:00 -0500)
        * 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++.

From-SVN: r47483

gcc/ChangeLog
gcc/dbxout.c
gcc/dwarf2out.c

index f525d91e42ff7f6be1c7138cc6d6b9211796163e..ac2de5f6aba01fee1f0a07742e519d45a14429df 100644 (file)
@@ -1,3 +1,9 @@
+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++.
+
 Fri Nov 30 08:26:57 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * dwarf2asm.c (dw2_asm_output_encoded_addr_rtx): Handle const1_rtx.
index 8b14f5d2efe58f8bd3052042328e83699d17a545..718250d4960cabf7c8434220af6fef5b99dd344b 100644 (file)
@@ -1492,7 +1492,7 @@ dbxout_type (type, full)
                putc (TREE_VIA_VIRTUAL (child) ? '1' : '0', asmfile);
                putc (TREE_VIA_PUBLIC (child) ? '2' : '0', asmfile);
                CHARS (2);
-               if (TREE_VIA_VIRTUAL (child))
+               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.  */
index 55bb26420bd6b9957d1fc79eaeefdd1968ec179e..557730dc892a75ae9ecd5a61cdfca1d1a1f004b7 100644 (file)
@@ -4830,6 +4830,13 @@ is_c_family ()
          || lang == DW_LANG_C_plus_plus);
 }
 
+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 ()
 {
@@ -8414,7 +8421,7 @@ add_data_member_location_attribute (die, decl)
     {
       /* We're working on the TAG_inheritance for a base class.  */
 
-      if (TREE_VIA_VIRTUAL (decl))
+      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