2009-11-30 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Nov 2009 10:36:54 +0000 (10:36 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Nov 2009 10:36:54 +0000 (10:36 +0000)
* tree-dump.c (dump_option_value_in): Add TDF_NOUID.
* tree-pass.h (TDF_NOUID): Likewise.
* print-rtl.c: Include tree-pass.h.
(print_mem_expr): Pass dump_flags.
(print_rtx): Likewise.
* print-tree.c: Include tree-pass.h.
(print_node_brief): Handle TDF_NOUID.
(print_node): Likewise.
* tree-pretty-print.c (dump_decl_name): Likewise.
(dump_generic_node): Likewise.
* Makefile.in (print-rtl.o, print-tree.o): Add $(TREE_PASS_H)
dependency.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154775 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/Makefile.in
gcc/print-rtl.c
gcc/print-tree.c
gcc/tree-dump.c
gcc/tree-pass.h
gcc/tree-pretty-print.c

index 2db2fdc..defb342 100644 (file)
@@ -1,3 +1,18 @@
+2009-11-30  Richard Guenther  <rguenther@suse.de>
+
+       * tree-dump.c (dump_option_value_in): Add TDF_NOUID.
+       * tree-pass.h (TDF_NOUID): Likewise.
+       * print-rtl.c: Include tree-pass.h.
+       (print_mem_expr): Pass dump_flags.
+       (print_rtx): Likewise.
+       * print-tree.c: Include tree-pass.h.
+       (print_node_brief): Handle TDF_NOUID.
+       (print_node): Likewise.
+       * tree-pretty-print.c (dump_decl_name): Likewise.
+       (dump_generic_node): Likewise.
+       * Makefile.in (print-rtl.o, print-tree.o): Add $(TREE_PASS_H)
+       dependency.
+
 2009-11-30  Nick Clifton  <nickc@redhat.com>
 
        * config/stormy16/stormy16-lib2-count-leading-zeros.c: Delete.
index 6483c70..ece9f74 100644 (file)
@@ -2264,7 +2264,7 @@ tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(IPA_PROP_H) value-prof.h $(TREE_PASS_H) $(TARGET_H) $(INTEGRATE_H)
 print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
    $(GGC_H) langhooks.h $(REAL_H) tree-iterator.h fixed-value.h \
-   $(DIAGNOSTIC_H) $(TREE_FLOW_H)
+   $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_PASS_H)
 stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(TREE_H) $(PARAMS_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) output.h $(RTL_H) \
    $(GGC_H) $(TM_P_H) $(TARGET_H) langhooks.h $(REGS_H) gt-stor-layout.h \
@@ -2744,7 +2744,7 @@ rtl.o : rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
 
 print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
     $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) $(FLAGS_H) \
-    $(BCONFIG_H) $(REAL_H) $(DIAGNOSTIC_H) cselib.h
+    $(BCONFIG_H) $(REAL_H) $(DIAGNOSTIC_H) cselib.h $(TREE_PASS_H)
 rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TOPLEV_H) \
    $(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) $(REAL_H) \
    $(FLAGS_H) $(REGS_H) output.h $(TARGET_H) $(FUNCTION_H) $(TREE_H) \
index ff73c4a..75f0343 100644 (file)
@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "diagnostic.h"
 #include "cselib.h"
+#include "tree-pass.h"
 #endif
 
 static FILE *outfile;
@@ -78,7 +79,7 @@ void
 print_mem_expr (FILE *outfile, const_tree expr)
 {
   fputc (' ', outfile);
-  print_generic_expr (outfile, CONST_CAST_TREE (expr), 0);
+  print_generic_expr (outfile, CONST_CAST_TREE (expr), dump_flags);
 }
 #endif
 
@@ -241,7 +242,7 @@ print_rtx (const_rtx in_rtx)
          {
            tree decl = SYMBOL_REF_DECL (in_rtx);
            if (decl)
-             print_node_brief (outfile, "", decl, 0);
+             print_node_brief (outfile, "", decl, dump_flags);
          }
 #endif
        else if (i == 4 && NOTE_P (in_rtx))
index a44d23a..eebd1c3 100644 (file)
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-iterator.h"
 #include "diagnostic.h"
 #include "tree-flow.h"
+#include "tree-pass.h"
 
 /* Define the hash table of nodes already seen.
    Such nodes are not repeated; brief cross-references are used.  */
@@ -95,10 +96,22 @@ print_node_brief (FILE *file, const char *prefix, const_tree node, int indent)
        fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
       else if (TREE_CODE (node) == LABEL_DECL
               && LABEL_DECL_UID (node) != -1)
-       fprintf (file, " L.%d", (int) LABEL_DECL_UID (node));
+       {
+         if (dump_flags & TDF_NOUID)
+           fprintf (file, " L.xxxx");
+         else
+           fprintf (file, " L.%d", (int) LABEL_DECL_UID (node));
+       }
       else
-       fprintf (file, " %c.%u", TREE_CODE (node) == CONST_DECL ? 'C' : 'D',
-                DECL_UID (node));
+       {
+         if (dump_flags & TDF_NOUID)
+           fprintf (file, " %c.xxxx",
+                    TREE_CODE (node) == CONST_DECL ? 'C' : 'D');
+         else
+           fprintf (file, " %c.%u",
+                    TREE_CODE (node) == CONST_DECL ? 'C' : 'D',
+                    DECL_UID (node));
+       }
     }
   else if (tclass == tcc_type)
     {
@@ -260,10 +273,20 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
        fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node)));
       else if (code == LABEL_DECL
               && LABEL_DECL_UID (node) != -1)
-       fprintf (file, " L.%d", (int) LABEL_DECL_UID (node));
+       {
+         if (dump_flags & TDF_NOUID)
+           fprintf (file, " L.xxxx");
+         else
+           fprintf (file, " L.%d", (int) LABEL_DECL_UID (node));
+       }
       else
-       fprintf (file, " %c.%u", code == CONST_DECL ? 'C' : 'D',
-                DECL_UID (node));
+       {
+         if (dump_flags & TDF_NOUID)
+           fprintf (file, " %c.xxxx", code == CONST_DECL ? 'C' : 'D');
+         else
+           fprintf (file, " %c.%u", code == CONST_DECL ? 'C' : 'D',
+                    DECL_UID (node));
+       }
     }
   else if (tclass == tcc_type)
     {
index e0512bc..429f915 100644 (file)
@@ -821,6 +821,7 @@ static const struct dump_option_value_info dump_options[] =
   {"memsyms", TDF_MEMSYMS},
   {"verbose", TDF_VERBOSE},
   {"eh", TDF_EH},
+  {"nouid", TDF_NOUID},
   {"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA
            | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE
            | TDF_RHS_ONLY)},
index 1bff0bd..473176c 100644 (file)
@@ -79,6 +79,7 @@ enum tree_dump_index
 #define TDF_EH         (1 << 19)       /* display EH region number
                                           holding this gimple statement.  */
 
+#define TDF_NOUID      (1 << 20)       /* omit UIDs from dumps.  */
 
 /* In tree-dump.c */
 
index caa19ac..44d4a5d 100644 (file)
@@ -182,13 +182,21 @@ dump_decl_name (pretty_printer *buffer, tree node, int flags)
   if ((flags & TDF_UID) || DECL_NAME (node) == NULL_TREE)
     {
       if (TREE_CODE (node) == LABEL_DECL && LABEL_DECL_UID (node) != -1)
-        pp_printf (buffer, "L.%d", (int) LABEL_DECL_UID (node));
+       pp_printf (buffer, "L.%d", (int) LABEL_DECL_UID (node));
       else if (TREE_CODE (node) == DEBUG_EXPR_DECL)
-       pp_printf (buffer, "D#%i", DEBUG_TEMP_UID (node));
+       {
+         if (flags & TDF_NOUID)
+           pp_string (buffer, "D#xxxx");
+         else
+           pp_printf (buffer, "D#%i", DEBUG_TEMP_UID (node));
+       }
       else
        {
          char c = TREE_CODE (node) == CONST_DECL ? 'C' : 'D';
-         pp_printf (buffer, "%c.%u", c, DECL_UID (node));
+         if (flags & TDF_NOUID)
+           pp_printf (buffer, "%c.xxxx", c);
+         else
+           pp_printf (buffer, "%c.%u", c, DECL_UID (node));
        }
     }
 }
@@ -1030,9 +1038,14 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
       if (DECL_NAME (node))
        dump_decl_name (buffer, node, flags);
       else if (LABEL_DECL_UID (node) != -1)
-        pp_printf (buffer, "<L%d>", (int) LABEL_DECL_UID (node));
+       pp_printf (buffer, "<L%d>", (int) LABEL_DECL_UID (node));
       else
-        pp_printf (buffer, "<D.%u>", DECL_UID (node));
+       {
+         if (flags & TDF_NOUID)
+           pp_string (buffer, "<D.xxxx>");
+         else
+           pp_printf (buffer, "<D.%u>", DECL_UID (node));
+       }
       break;
 
     case TYPE_DECL: