OSDN Git Service

* dwarf2out.c (AT_linkage_name): Define.
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Apr 2010 17:04:10 +0000 (17:04 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 01:07:23 +0000 (10:07 +0900)
(clone_as_declaration): Handle DW_AT_linkage_name.
(add_name_and_src_coords_attributes): Use AT_linkage_name instead
of DW_AT_MIPS_linkage_name.
(move_linkage_attr): Likewise.
(dwarf2out_finish): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158568 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dwarf2out.c

index 687bde1..971fccb 100644 (file)
@@ -1,9 +1,18 @@
+2010-04-20  Jakub Jelinek  <jakub@redhat.com>
+
+       * dwarf2out.c (AT_linkage_name): Define.
+       (clone_as_declaration): Handle DW_AT_linkage_name.
+       (add_name_and_src_coords_attributes): Use AT_linkage_name instead
+       of DW_AT_MIPS_linkage_name.
+       (move_linkage_attr): Likewise.
+       (dwarf2out_finish): Likewise.
+
 2010-04-20  Xinliang David Li  <davidxl@gcc.gnu.org>
 
        PR middle-end/41952
        * fold-const.c (fold_comparison): New folding rule. 
 
 2010-04-20  Xinliang David Li  <davidxl@gcc.gnu.org>
 
        PR middle-end/41952
        * fold-const.c (fold_comparison): New folding rule. 
 
-2010-04-20  Anatoly Sokolov  <aesok@post.ru
+2010-04-20  Anatoly Sokolov  <aesok@post.ru>
 
        * double-int.h (double_int_setbit): Declare.
        * double-int.c (double_int_setbit): New function.
 
        * double-int.h (double_int_setbit): Declare.
        * double-int.c (double_int_setbit): New function.
index b044ab7..cfacf96 100644 (file)
@@ -5710,8 +5710,7 @@ static GTY(()) comdat_type_node *comdat_type_list;
 static GTY(()) limbo_die_node *limbo_die_list;
 
 /* A list of DIEs for which we may have to generate
 static GTY(()) limbo_die_node *limbo_die_list;
 
 /* A list of DIEs for which we may have to generate
-   DW_AT_MIPS_linkage_name once their DECL_ASSEMBLER_NAMEs are
-   set.  */
+   DW_AT_{,MIPS_}linkage_name once their DECL_ASSEMBLER_NAMEs are set.  */
 static GTY(()) limbo_die_node *deferred_asm_name;
 
 /* Filenames referenced by this compilation unit.  */
 static GTY(()) limbo_die_node *deferred_asm_name;
 
 /* Filenames referenced by this compilation unit.  */
@@ -6273,6 +6272,12 @@ static void gen_remaining_tmpl_value_param_die_attribute (void);
 #define DEBUG_MACINFO_SECTION_LABEL     "Ldebug_macinfo"
 #endif
 
 #define DEBUG_MACINFO_SECTION_LABEL     "Ldebug_macinfo"
 #endif
 
+/* Mangled name attribute to use.  This used to be a vendor extension
+   until DWARF 4 standardized it.  */
+#define AT_linkage_name \
+  (dwarf_version >= 4 ? DW_AT_linkage_name : DW_AT_MIPS_linkage_name)
+
+
 /* Definitions of defaults for formats and names of various special
    (artificial) labels which may be generated within this file (when the -g
    options is used and DWARF2_DEBUGGING_INFO is in effect.
 /* Definitions of defaults for formats and names of various special
    (artificial) labels which may be generated within this file (when the -g
    options is used and DWARF2_DEBUGGING_INFO is in effect.
@@ -9331,6 +9336,7 @@ clone_as_declaration (dw_die_ref die)
         case DW_AT_name:
         case DW_AT_type:
         case DW_AT_virtuality:
         case DW_AT_name:
         case DW_AT_type:
         case DW_AT_virtuality:
+        case DW_AT_linkage_name:
         case DW_AT_MIPS_linkage_name:
           add_dwarf_attr (clone, a);
           break;
         case DW_AT_MIPS_linkage_name:
           add_dwarf_attr (clone, a);
           break;
@@ -16769,7 +16775,7 @@ add_name_and_src_coords_attributes (dw_die_ref die, tree decl)
              deferred_asm_name = asm_name;
            }
          else if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
              deferred_asm_name = asm_name;
            }
          else if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
-           add_AT_string (die, DW_AT_MIPS_linkage_name,
+           add_AT_string (die, AT_linkage_name,
                           IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
        }
     }
                           IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
        }
     }
@@ -21139,7 +21145,7 @@ htab_ct_eq (const void *of1, const void *of2)
                     DWARF_TYPE_SIGNATURE_SIZE));
 }
 
                     DWARF_TYPE_SIGNATURE_SIZE));
 }
 
-/* Move a DW_AT_MIPS_linkage_name attribute just added to dw_die_ref
+/* Move a DW_AT_{,MIPS_}linkage_name attribute just added to dw_die_ref
    to the location it would have been added, should we know its
    DECL_ASSEMBLER_NAME when we added other attributes.  This will
    probably improve compactness of debug info, removing equivalent
    to the location it would have been added, should we know its
    DECL_ASSEMBLER_NAME when we added other attributes.  This will
    probably improve compactness of debug info, removing equivalent
@@ -21152,7 +21158,7 @@ move_linkage_attr (dw_die_ref die)
   unsigned ix = VEC_length (dw_attr_node, die->die_attr);
   dw_attr_node linkage = *VEC_index (dw_attr_node, die->die_attr, ix - 1);
 
   unsigned ix = VEC_length (dw_attr_node, die->die_attr);
   dw_attr_node linkage = *VEC_index (dw_attr_node, die->die_attr, ix - 1);
 
-  gcc_assert (linkage.dw_attr == DW_AT_MIPS_linkage_name);
+  gcc_assert (linkage.dw_attr == AT_linkage_name);
 
   while (--ix > 0)
     {
 
   while (--ix > 0)
     {
@@ -21386,7 +21392,7 @@ dwarf2out_finish (const char *filename)
       tree decl = node->created_for;
       if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
        {
       tree decl = node->created_for;
       if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
        {
-         add_AT_string (node->die, DW_AT_MIPS_linkage_name,
+         add_AT_string (node->die, AT_linkage_name,
                         IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
          move_linkage_attr (node->die);
        }
                         IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
          move_linkage_attr (node->die);
        }