diff gcc/pretty-print.h @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children b7f97abdc517
line wrap: on
line diff
--- a/gcc/pretty-print.h	Sun Feb 07 18:28:00 2010 +0900
+++ b/gcc/pretty-print.h	Fri Feb 12 23:39:51 2010 +0900
@@ -71,9 +71,9 @@
 
 /* The output buffer datatype.  This is best seen as an abstract datatype
    whose fields should not be accessed directly by clients.  */
-typedef struct 
+typedef struct
 {
-  /* Obstack where the text is built up.  */  
+  /* Obstack where the text is built up.  */
   struct obstack formatted_obstack;
 
   /* Obstack containing a chunked representation of the format
@@ -90,7 +90,7 @@
   /* Where to output formatted text.  */
   FILE *stream;
 
-  /* The amount of characters output so far.  */  
+  /* The amount of characters output so far.  */
   int line_length;
 
   /* This must be large enough to hold any printed integer or
@@ -114,7 +114,7 @@
   diagnostic_prefixing_rule_t rule;
 
   /* The ideal upper bound of number of characters per line, as suggested
-     by front-end.  */  
+     by front-end.  */
   int line_cutoff;
 } pp_wrapping_mode_t;
 
@@ -140,7 +140,7 @@
 
 /* TRUE if a newline character needs to be added before further
    formatting.  */
-#define pp_needs_newline(PP)  pp_base (PP)->need_newline 
+#define pp_needs_newline(PP)  pp_base (PP)->need_newline
 
 /* True if PRETTY-PRINTER is in line-wrapping mode.  */
 #define pp_is_wrapping_line(PP) (pp_line_cutoff (PP) > 0)
@@ -148,6 +148,10 @@
 /* The amount of whitespace to be emitted when starting a new line.  */
 #define pp_indentation(PP) pp_base (PP)->indent_skip
 
+/* True if identifiers are translated to the locale character set on
+   output.  */
+#define pp_translate_identifiers(PP) pp_base (PP)->translate_identifiers
+
 /* The data structure that contains the bare minimum required to do
    proper pretty-printing.  Clients may derived from this structure
    and add additional fields they need.  */
@@ -158,12 +162,12 @@
 
   /* The prefix for each new line.  */
   const char *prefix;
-  
+
   /* Where to put whitespace around the entity being formatted.  */
   pp_padding padding;
-  
+
   /* The real upper bound of number of characters per line, taking into
-     account the case of a very very looong prefix.  */  
+     account the case of a very very looong prefix.  */
   int maximum_length;
 
   /* Indentation count.  */
@@ -187,6 +191,10 @@
 
   /* Nonzero means one should emit a newline before outputting anything.  */
   bool need_newline;
+
+  /* Nonzero means identifiers are translated to the locale character
+     set on output.  */
+  bool translate_identifiers;
 };
 
 #define pp_set_line_maximum_length(PP, L) \
@@ -273,10 +281,11 @@
    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, (pp_translate_identifiers (PP) \
+					  ? identifier_to_locale (ID)	\
+					  : (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 +331,7 @@
 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 +344,6 @@
 }
 #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 */