aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-05-05 00:44:36 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2009-05-05 00:44:36 +0100
commit4f1e4960a6f174ae3ece9a1582aa802708a1d2fc (patch)
treeb03ae469ea639011a5e2bb04f05228d71da46777 /gcc/toplev.c
parent40540e682ac2596f091d0ee40729bc998cf904ed (diff)
downloadgcc-4f1e4960a6f174ae3ece9a1582aa802708a1d2fc.zip
gcc-4f1e4960a6f174ae3ece9a1582aa802708a1d2fc.tar.gz
gcc-4f1e4960a6f174ae3ece9a1582aa802708a1d2fc.tar.bz2
attribs.c (decl_attributes): Use %qE for identifiers in diagnostics.
* attribs.c (decl_attributes): Use %qE for identifiers in diagnostics. * cgraphunit.c (verify_cgraph_node): Translate function names to locale character set in diagnostics. * coverage.c (get_coverage_counts): Use %qE for identifiers in diagnostics. * doc/invoke.texi (-finstrument-functions-exclude-function-list): Document that functions are named in UTF-8. * expr.c (expand_expr_real_1): Translate function names to locale character set in diagnostics. * gimplify.c (omp_notice_variable, omp_is_private, gimplify_scan_omp_clauses): Use %qE for identifiers in diagnostics. * langhooks.c (lhd_print_error_function): Translate function names to locale character set. * langhooks.h (decl_printable_name): Document that return value is in internal character set. * stmt.c: Include pretty-print.h (tree_conflicts_with_clobbers_p): Use %qE for identifiers in diagnostics. (resolve_operand_name_1): Translate named operand name to locale character set. * stor-layout.c (finalize_record_size): Use %qE for identifiers in diagnostics. * toplev.c (announce_function): Translate function names to locale character set. (warn_deprecated_use): Use %qE for identifiers in diagnostics. (default_tree_printer): Use pp_identifier or translate identifiers to locale character set. Mark "<anonymous>" for translation. * tree-mudflap.c (mx_register_decls, mudflap_finish_file): Use %qE for identifiers in diagnostics. * tree.c (handle_dll_attribute): Use %qE for identifiers in diagnostics. * varasm.c (output_constructor): Use %qE for identifiers in diagnostics. testsuite: * gcc.dg/ucnid-11.c, gcc.dg/ucnid-12.c, gcc.dg/ucnid-13.c: New tests. From-SVN: r147111
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 9520299..1b850fa 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -427,9 +427,11 @@ announce_function (tree decl)
if (!quiet_flag)
{
if (rtl_dump_and_exit)
- fprintf (stderr, "%s ", IDENTIFIER_POINTER (DECL_NAME (decl)));
+ fprintf (stderr, "%s ",
+ identifier_to_locale (IDENTIFIER_POINTER (DECL_NAME (decl))));
else
- fprintf (stderr, " %s", lang_hooks.decl_printable_name (decl, 2));
+ fprintf (stderr, " %s",
+ identifier_to_locale (lang_hooks.decl_printable_name (decl, 2)));
fflush (stderr);
pp_needs_newline (global_dc->printer) = true;
diagnostic_set_last_function (global_dc, (diagnostic_info *) NULL);
@@ -920,16 +922,16 @@ warn_deprecated_use (tree node)
}
else if (TYPE_P (node))
{
- const char *what = NULL;
+ tree what = NULL_TREE;
tree decl = TYPE_STUB_DECL (node);
if (TYPE_NAME (node))
{
if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
- what = IDENTIFIER_POINTER (TYPE_NAME (node));
+ what = TYPE_NAME (node);
else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
&& DECL_NAME (TYPE_NAME (node)))
- what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node)));
+ what = DECL_NAME (TYPE_NAME (node));
}
if (decl)
@@ -938,7 +940,7 @@ warn_deprecated_use (tree node)
= expand_location (DECL_SOURCE_LOCATION (decl));
if (what)
warning (OPT_Wdeprecated_declarations,
- "%qs is deprecated (declared at %s:%d)", what,
+ "%qE is deprecated (declared at %s:%d)", what,
xloc.file, xloc.line);
else
warning (OPT_Wdeprecated_declarations,
@@ -948,7 +950,7 @@ warn_deprecated_use (tree node)
else
{
if (what)
- warning (OPT_Wdeprecated_declarations, "%qs is deprecated", what);
+ warning (OPT_Wdeprecated_declarations, "%qE is deprecated", what);
else
warning (OPT_Wdeprecated_declarations, "type is deprecated");
}
@@ -1511,7 +1513,7 @@ default_tree_printer (pretty_printer * pp, text_info *text, const char *spec,
t = va_arg (*text->args_ptr, tree);
if (TREE_CODE (t) == IDENTIFIER_NODE)
{
- pp_string (pp, IDENTIFIER_POINTER (t));
+ pp_identifier (pp, IDENTIFIER_POINTER (t));
return true;
}
break;
@@ -1537,8 +1539,8 @@ default_tree_printer (pretty_printer * pp, text_info *text, const char *spec,
if (DECL_P (t))
{
const char *n = DECL_NAME (t)
- ? lang_hooks.decl_printable_name (t, 2)
- : "<anonymous>";
+ ? identifier_to_locale (lang_hooks.decl_printable_name (t, 2))
+ : _("<anonymous>");
pp_string (pp, n);
}
else