summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/Makefile.in4
-rw-r--r--gcc/print-rtl.c5
-rw-r--r--gcc/print-tree.c35
-rw-r--r--gcc/tree-dump.c1
-rw-r--r--gcc/tree-pass.h1
-rw-r--r--gcc/tree-pretty-print.c23
7 files changed, 69 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2db2fdcf0d8..defb342d070 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 6483c70d660..ece9f742702 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -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) \
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index ff73c4afb05..75f034376cb 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -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))
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index a44d23a8474..eebd1c35ba1 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -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)
{
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index e0512bc80a3..429f915bcc9 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -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)},
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 1bff0bd52ce..473176c21c9 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -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 */
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index caa19ac8d6c..44d4a5d9c03 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -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: