Commit 51d49bc2 by Eric Botcazou Committed by Eric Botcazou

dwarf2out.c (AT_linkage_name): Delete.

	* dwarf2out.c (AT_linkage_name): Delete.
	(add_linkage_attr): New function.
	(add_linkage_name): Call it to emit the linkage attribute.
	(dwarf2out_finish): Likewise.
	(move_linkage_attr): Explicitly accept both attribute variants.

From-SVN: r161944
parent 718f9c0f
2010-07-08 Eric Botcazou <ebotcazou@adacore.com>
* dwarf2out.c (AT_linkage_name): Delete.
(add_linkage_attr): New function.
(add_linkage_name): Call it to emit the linkage attribute.
(dwarf2out_finish): Likewise.
(move_linkage_attr): Explicitly accept both attribute variants.
2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org> 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
* toplev.h: Do not include diagnostic-core.h. * toplev.h: Do not include diagnostic-core.h.
......
...@@ -6385,11 +6385,6 @@ static void gen_remaining_tmpl_value_param_die_attribute (void); ...@@ -6385,11 +6385,6 @@ static void gen_remaining_tmpl_value_param_die_attribute (void);
#define DEBUG_MACINFO_SECTION_LABEL "Ldebug_macinfo" #define DEBUG_MACINFO_SECTION_LABEL "Ldebug_macinfo"
#endif #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 /* Definitions of defaults for formats and names of various special
(artificial) labels which may be generated within this file (when the -g (artificial) labels which may be generated within this file (when the -g
...@@ -17384,6 +17379,25 @@ add_pure_or_virtual_attribute (dw_die_ref die, tree func_decl) ...@@ -17384,6 +17379,25 @@ add_pure_or_virtual_attribute (dw_die_ref die, tree func_decl)
} }
} }
/* Add a DW_AT_linkage_name or DW_AT_MIPS_linkage_name attribute for the
given decl. This used to be a vendor extension until after DWARF 4
standardized it. */
static void
add_linkage_attr (dw_die_ref die, tree decl)
{
const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
/* Mimic what assemble_name_raw does with a leading '*'. */
if (name[0] == '*')
name = &name[1];
if (dwarf_version >= 4)
add_AT_string (die, DW_AT_linkage_name, name);
else
add_AT_string (die, DW_AT_MIPS_linkage_name, name);
}
/* Add source coordinate attributes for the given decl. */ /* Add source coordinate attributes for the given decl. */
static void static void
...@@ -17418,8 +17432,7 @@ add_linkage_name (dw_die_ref die, tree decl) ...@@ -17418,8 +17432,7 @@ add_linkage_name (dw_die_ref die, tree decl)
deferred_asm_name = asm_name; deferred_asm_name = asm_name;
} }
else if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl)) else if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
add_AT_string (die, AT_linkage_name, add_linkage_attr (die, decl);
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
} }
} }
...@@ -22017,7 +22030,8 @@ move_linkage_attr (dw_die_ref die) ...@@ -22017,7 +22030,8 @@ move_linkage_attr (dw_die_ref die)
unsigned ix = VEC_length (dw_attr_node, die->die_attr); unsigned ix = VEC_length (dw_attr_node, die->die_attr);
dw_attr_node linkage = *VEC_index (dw_attr_node, die->die_attr, ix - 1); dw_attr_node linkage = *VEC_index (dw_attr_node, die->die_attr, ix - 1);
gcc_assert (linkage.dw_attr == AT_linkage_name); gcc_assert (linkage.dw_attr == DW_AT_linkage_name
|| linkage.dw_attr == DW_AT_MIPS_linkage_name);
while (--ix > 0) while (--ix > 0)
{ {
...@@ -22250,8 +22264,7 @@ dwarf2out_finish (const char *filename) ...@@ -22250,8 +22264,7 @@ dwarf2out_finish (const char *filename)
tree decl = node->created_for; tree decl = node->created_for;
if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl)) if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
{ {
add_AT_string (node->die, AT_linkage_name, add_linkage_attr (node->die, decl);
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
move_linkage_attr (node->die); move_linkage_attr (node->die);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment