mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-16 13:01:21 +08:00
dwarf2out.c (add_linkage_name): New function.
* dwarf2out.c (add_linkage_name): New function. Don't add anything to DW_TAG_member DIEs. (add_name_and_src_coords_attributes): Use it. (gen_variable_die): Call it for C++ static data members if specification is DW_TAG_member. From-SVN: r161096
This commit is contained in:
parent
f0057424da
commit
5ec9660956
@ -1,5 +1,11 @@
|
||||
2010-06-21 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* dwarf2out.c (add_linkage_name): New function. Don't add
|
||||
anything to DW_TAG_member DIEs.
|
||||
(add_name_and_src_coords_attributes): Use it.
|
||||
(gen_variable_die): Call it for C++ static data members if
|
||||
specification is DW_TAG_member.
|
||||
|
||||
* dwarf2out.c (base_type_die): Use DW_ATE_UTF for
|
||||
C++ char16_t and char32_t.
|
||||
|
||||
|
@ -17330,6 +17330,34 @@ add_src_coords_attributes (dw_die_ref die, tree decl)
|
||||
add_AT_unsigned (die, DW_AT_decl_line, s.line);
|
||||
}
|
||||
|
||||
/* Add DW_AT_{,MIPS_}linkage_name attribute for the given decl. */
|
||||
|
||||
static void
|
||||
add_linkage_name (dw_die_ref die, tree decl)
|
||||
{
|
||||
if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
|
||||
&& TREE_PUBLIC (decl)
|
||||
&& !DECL_ABSTRACT (decl)
|
||||
&& !(TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
|
||||
&& die->die_tag != DW_TAG_member)
|
||||
{
|
||||
/* Defer until we have an assembler name set. */
|
||||
if (!DECL_ASSEMBLER_NAME_SET_P (decl))
|
||||
{
|
||||
limbo_die_node *asm_name;
|
||||
|
||||
asm_name = ggc_alloc_cleared_limbo_die_node ();
|
||||
asm_name->die = die;
|
||||
asm_name->created_for = decl;
|
||||
asm_name->next = deferred_asm_name;
|
||||
deferred_asm_name = asm_name;
|
||||
}
|
||||
else if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
|
||||
add_AT_string (die, AT_linkage_name,
|
||||
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
|
||||
}
|
||||
}
|
||||
|
||||
/* Add a DW_AT_name attribute and source coordinate attribute for the
|
||||
given decl, but only if it actually has a name. */
|
||||
|
||||
@ -17347,26 +17375,7 @@ add_name_and_src_coords_attributes (dw_die_ref die, tree decl)
|
||||
if (! DECL_ARTIFICIAL (decl))
|
||||
add_src_coords_attributes (die, decl);
|
||||
|
||||
if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
|
||||
&& TREE_PUBLIC (decl)
|
||||
&& !DECL_ABSTRACT (decl)
|
||||
&& !(TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl)))
|
||||
{
|
||||
/* Defer until we have an assembler name set. */
|
||||
if (!DECL_ASSEMBLER_NAME_SET_P (decl))
|
||||
{
|
||||
limbo_die_node *asm_name;
|
||||
|
||||
asm_name = ggc_alloc_cleared_limbo_die_node ();
|
||||
asm_name->die = die;
|
||||
asm_name->created_for = decl;
|
||||
asm_name->next = deferred_asm_name;
|
||||
deferred_asm_name = asm_name;
|
||||
}
|
||||
else if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
|
||||
add_AT_string (die, AT_linkage_name,
|
||||
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
|
||||
}
|
||||
add_linkage_name (die, decl);
|
||||
}
|
||||
|
||||
#ifdef VMS_DEBUGGING_INFO
|
||||
@ -18984,6 +18993,9 @@ gen_variable_die (tree decl, tree origin, dw_die_ref context_die)
|
||||
|
||||
if (get_AT_unsigned (old_die, DW_AT_decl_line) != (unsigned) s.line)
|
||||
add_AT_unsigned (var_die, DW_AT_decl_line, s.line);
|
||||
|
||||
if (old_die->die_tag == DW_TAG_member)
|
||||
add_linkage_name (var_die, decl);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user