From 3e894af1569a84c5bb6eb730266248e6a4cae2de Mon Sep 17 00:00:00 2001 From: Kenneth Zadeck Date: Fri, 16 May 2008 13:34:34 +0000 Subject: invoke.text (-fdump-tree-*-verbose): New option. 2008-05-16 Kenneth Zadeck * doc/invoke.text (-fdump-tree-*-verbose): New option. * tree-dump.c (dump_options): New verbose option. * tree-pretty-print.c (dump_phi_nodes, dump_generic_bb_buff): Add verbose dump. * tree-pass.h (TDF_VERBOSE): New dump flag. * print-tree.c (print_node): Added code to be able to print PHI_NODES. (tree-flow.h): Added include. Makefile.in (print-tree.o): Added TREE_FLOW_H. From-SVN: r135417 --- gcc/print-tree.c | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) (limited to 'gcc/print-tree.c') diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 4745491..3b34f89 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "ggc.h" #include "langhooks.h" #include "tree-iterator.h" +#include "tree-flow.h" /* Define the hash table of nodes already seen. Such nodes are not repeated; brief cross-references are used. */ @@ -221,21 +222,25 @@ print_node (FILE *file, const char *prefix, tree node, int indent) return; } - hash = ((unsigned long) node) % HASH_SIZE; - - /* If node is in the table, just mention its address. */ - for (b = table[hash]; b; b = b->next) - if (b->node == node) - { - print_node_brief (file, prefix, node, indent); - return; - } - - /* Add this node to the table. */ - b = XNEW (struct bucket); - b->node = node; - b->next = table[hash]; - table[hash] = b; + /* Allow this function to be called if the table is not there. */ + if (table) + { + hash = ((unsigned long) node) % HASH_SIZE; + + /* If node is in the table, just mention its address. */ + for (b = table[hash]; b; b = b->next) + if (b->node == node) + { + print_node_brief (file, prefix, node, indent); + return; + } + + /* Add this node to the table. */ + b = XNEW (struct bucket); + b->node = node; + b->next = table[hash]; + table[hash] = b; + } /* Indent to the specified column, since this is the long form. */ indent_to (file, indent); @@ -906,6 +911,12 @@ print_node (FILE *file, const char *prefix, tree node, int indent) } break; + case PHI_NODE: + print_node (file, "result", PHI_RESULT (node), indent + 4); + for (i = 0; i < PHI_NUM_ARGS (node); i++) + print_node (file, "arg", PHI_ARG_DEF (node, i), indent + 4); + break; + case OMP_CLAUSE: { int i; -- cgit v1.1