From a3af5087d9b0e120764cb3852da73149be17dfac Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 4 May 2009 13:23:50 +0100 Subject: intl.c (locale_encoding, [...]): New. * intl.c (locale_encoding, locale_utf8): New. (gcc_init_libintl): Initialize locale_encoding and locale_utf8. * intl.h (locale_encoding, locale_utf8): Declare. * pretty-print.c: Include ggc.h. Include iconv.h if HAVE_ICONV. (pp_base_tree_identifier, decode_utf8_char, identifier_to_locale): New. * pretty-print.h (pp_identifier): Call identifier_to_locale on ID argument. (pp_tree_identifier): Define to call pp_base_tree_identifier. (pp_base_tree_identifier): Declare as function. (identifier_to_locale): Declare. * Makefile.in (pretty-print.o): Update dependencies. * varasm.c (finish_aliases_1): Use %qE for identifiers in diagnostics. testsuite: * gcc.dg/attr-alias-5.c, gcc.dg/ucnid-7.c: New tests. From-SVN: r147096 --- gcc/pretty-print.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/pretty-print.h') diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h index dd3f0c0..5829225 100644 --- a/gcc/pretty-print.h +++ b/gcc/pretty-print.h @@ -273,10 +273,9 @@ struct pretty_print_info pp_scalar (PP, HOST_WIDEST_INT_PRINT_DEC, (HOST_WIDEST_INT) I) #define pp_pointer(PP, P) pp_scalar (PP, "%p", P) -#define pp_identifier(PP, ID) pp_string (PP, ID) +#define pp_identifier(PP, ID) pp_string (PP, identifier_to_locale (ID)) #define pp_tree_identifier(PP, T) \ - pp_append_text(PP, IDENTIFIER_POINTER (T), \ - IDENTIFIER_POINTER (T) + IDENTIFIER_LENGTH (T)) + pp_base_tree_identifier (pp_base (PP), T) #define pp_unsupported_tree(PP, T) \ pp_verbatim (pp_base (PP), "#%qs not supported by %s#", \ @@ -322,6 +321,7 @@ extern void pp_base_character (pretty_printer *, int); extern void pp_base_string (pretty_printer *, const char *); extern void pp_write_text_to_stream (pretty_printer *pp); extern void pp_base_maybe_space (pretty_printer *); +extern void pp_base_tree_identifier (pretty_printer *, tree); /* Switch into verbatim mode and return the old mode. */ static inline pp_wrapping_mode_t @@ -334,4 +334,6 @@ pp_set_verbatim_wrapping_ (pretty_printer *pp) } #define pp_set_verbatim_wrapping(PP) pp_set_verbatim_wrapping_ (pp_base (PP)) +extern const char *identifier_to_locale (const char *); + #endif /* GCC_PRETTY_PRINT_H */ -- cgit v1.1