diff options
author | Michael Matz <matz@suse.de> | 2007-02-22 17:03:48 +0000 |
---|---|---|
committer | Michael Matz <matz@gcc.gnu.org> | 2007-02-22 17:03:48 +0000 |
commit | a0ad3539f415e3f925691340ce389c0dc0819c91 (patch) | |
tree | b9429c7e1446e9672a2be1a81499cfcc7a228646 /gcc/cp/error.c | |
parent | b3502aa8d46d9cd008916170a635b2bf3a5d5125 (diff) | |
download | gcc-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/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 6a0eed5..5779805 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -447,7 +447,10 @@ dump_aggr_type (tree t, int flags) && TYPE_LANG_SPECIFIC (t) && CLASSTYPE_TEMPLATE_INFO (t) && (TREE_CODE (CLASSTYPE_TI_TEMPLATE (t)) != TEMPLATE_DECL || PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t))); - dump_scope (CP_DECL_CONTEXT (name), flags | TFF_SCOPE); + + if (! (flags & TFF_UNQUALIFIED_NAME)) + dump_scope (CP_DECL_CONTEXT (name), flags | TFF_SCOPE); + flags &= ~TFF_UNQUALIFIED_NAME; if (tmplate) { /* Because the template names are mangled, we have to locate @@ -697,11 +700,14 @@ dump_simple_decl (tree t, tree type, int flags) { if (flags & TFF_DECL_SPECIFIERS) { - dump_type_prefix (type, flags); + dump_type_prefix (type, flags & ~TFF_UNQUALIFIED_NAME); pp_maybe_space (cxx_pp); } - if (!DECL_INITIAL (t) || TREE_CODE (DECL_INITIAL (t)) != TEMPLATE_PARM_INDEX) + if (! (flags & TFF_UNQUALIFIED_NAME) + && (!DECL_INITIAL (t) + || TREE_CODE (DECL_INITIAL (t)) != TEMPLATE_PARM_INDEX)) dump_scope (CP_DECL_CONTEXT (t), flags); + flags &= ~TFF_UNQUALIFIED_NAME; if (DECL_NAME (t)) dump_decl (DECL_NAME (t), flags); else @@ -763,7 +769,9 @@ dump_decl (tree t, int flags) pp_cxx_declaration (cxx_pp, t); else { - dump_scope (CP_DECL_CONTEXT (t), flags); + if (! (flags & TFF_UNQUALIFIED_NAME)) + dump_scope (CP_DECL_CONTEXT (t), flags); + flags &= ~TFF_UNQUALIFIED_NAME; if (DECL_NAME (t) == NULL_TREE) pp_identifier (cxx_pp, "<unnamed>"); else @@ -998,7 +1006,9 @@ dump_function_decl (tree t, int flags) tree template_args = NULL_TREE; tree template_parms = NULL_TREE; int show_return = flags & TFF_RETURN_TYPE || flags & TFF_DECL_SPECIFIERS; + int do_outer_scope = ! (flags & TFF_UNQUALIFIED_NAME); + flags &= ~TFF_UNQUALIFIED_NAME; if (TREE_CODE (t) == TEMPLATE_DECL) t = DECL_TEMPLATE_RESULT (t); @@ -1040,7 +1050,9 @@ dump_function_decl (tree t, int flags) dump_type_prefix (TREE_TYPE (fntype), flags); /* Print the function name. */ - if (cname) + if (!do_outer_scope) + /* Nothing. */; + else if (cname) { dump_type (cname, flags); pp_cxx_colon_colon (cxx_pp); |