aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2007-02-22 17:03:48 +0000
committerMichael Matz <matz@gcc.gnu.org>2007-02-22 17:03:48 +0000
commita0ad3539f415e3f925691340ce389c0dc0819c91 (patch)
treeb9429c7e1446e9672a2be1a81499cfcc7a228646 /gcc/dwarf2out.c
parentb3502aa8d46d9cd008916170a635b2bf3a5d5125 (diff)
downloadgcc-a0ad3539f415e3f925691340ce389c0dc0819c91.zip
gcc-a0ad3539f415e3f925691340ce389c0dc0819c91.tar.gz
gcc-a0ad3539f415e3f925691340ce389c0dc0819c91.tar.bz2
dwarf2out.c (add_AT_string): Call ggc_strdup once per string.
* dwarf2out.c (add_AT_string): Call ggc_strdup once per string. (type_tag): Use lang_hooks.dwarf_name instead of DECL_NAME. * cp-tree.h (TFF_NO_OUTER_SCOPE): New formatting flag. * error.c (dump_aggr_type, dump_simple_decl, dump_decl, dump_function_decl): Guard emitting outer scopes by new flag. * cp-lang.c (cxx_dwarf_name): New function. (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name. * pt.c (classtype_mangled_name, mangle_class_name_for_template): Remove functions. (push_template_decl_real, lookup_template_class): Remove calls to above functions. From-SVN: r122230
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 2bb68dc..3f2dbba 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -5039,9 +5039,15 @@ add_AT_string (dw_die_ref die, enum dwarf_attribute attr_kind, const char *str)
slot = htab_find_slot_with_hash (debug_str_hash, str,
htab_hash_string (str), INSERT);
if (*slot == NULL)
- *slot = ggc_alloc_cleared (sizeof (struct indirect_string_node));
- node = (struct indirect_string_node *) *slot;
- node->str = ggc_strdup (str);
+ {
+ node = (struct indirect_string_node *)
+ ggc_alloc_cleared (sizeof (struct indirect_string_node));
+ node->str = ggc_strdup (str);
+ *slot = node;
+ }
+ else
+ node = (struct indirect_string_node *) *slot;
+
node->refcount++;
attr.dw_attr = attr_kind;
@@ -11251,10 +11257,17 @@ type_tag (tree type)
involved. */
else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& ! DECL_IGNORED_P (TYPE_NAME (type)))
- t = DECL_NAME (TYPE_NAME (type));
+ {
+ /* We want to be extra verbose. Don't call dwarf_name if
+ DECL_NAME isn't set. The default hook for decl_printable_name
+ doesn't like that, and in this context it's correct to return
+ 0, instead of "<anonymous>" or the like. */
+ if (DECL_NAME (TYPE_NAME (type)))
+ name = lang_hooks.dwarf_name (TYPE_NAME (type), 2);
+ }
/* Now get the name as a string, or invent one. */
- if (t != 0)
+ if (!name && t != 0)
name = IDENTIFIER_POINTER (t);
}