OSDN Git Service

2009-09-23 Yuri Gribov <tetra2005@googlemail.com>
[pf3gnuchains/gcc-fork.git] / gcc / pretty-print.c
index d531075..94952c3 100644 (file)
@@ -190,8 +190,6 @@ pp_base_indent (pretty_printer *pp)
    %.*s: a substring the length of which is specified by an argument
         integer.
    %Ns: likewise, but length specified as constant in the format string.
-   %H: location_t.
-   %J: a decl tree, from which DECL_SOURCE_LOCATION will be recorded.
    %K: a statement, from which EXPR_LOCATION and TREE_BLOCK will be recorded.
    Flag 'q': quote formatted text (must come immediately after '%').
 
@@ -476,22 +474,6 @@ pp_base_format (pretty_printer *pp, text_info *text)
              (pp, *text->args_ptr, precision, unsigned, "x");
          break;
 
-       case 'H':
-         {
-           location_t *locus = va_arg (*text->args_ptr, location_t *);
-           gcc_assert (text->locus != NULL);
-           *text->locus = *locus;
-         }
-         break;
-
-       case 'J':
-         {
-           tree t = va_arg (*text->args_ptr, tree);
-           gcc_assert (text->locus != NULL);
-           *text->locus = DECL_SOURCE_LOCATION (t);
-         }
-         break;
-
        case 'K':
          {
            tree t = va_arg (*text->args_ptr, tree), block;
@@ -719,6 +701,7 @@ pp_construct (pretty_printer *pp, const char *prefix, int maximum_length)
   pp_line_cutoff (pp) = maximum_length;
   pp_prefixing_rule (pp) = DIAGNOSTICS_SHOW_PREFIX_ONCE;
   pp_set_prefix (pp, prefix);
+  pp_translate_identifiers (pp) = true;
 }
 
 /* Append a string delimited by START and END to the output area of
@@ -855,8 +838,14 @@ pp_base_maybe_space (pretty_printer *pp)
 void
 pp_base_tree_identifier (pretty_printer *pp, tree id)
 {
-  const char *text = identifier_to_locale (IDENTIFIER_POINTER (id));
-  pp_append_text (pp, text, text + strlen (text));
+  if (pp_translate_identifiers (pp))
+    {
+      const char *text = identifier_to_locale (IDENTIFIER_POINTER (id));
+      pp_append_text (pp, text, text + strlen (text));
+    }
+  else
+    pp_append_text (pp, IDENTIFIER_POINTER (id),
+                   IDENTIFIER_POINTER (id) + IDENTIFIER_LENGTH (id));
 }
 \f
 /* The string starting at P has LEN (at least 1) bytes left; if they