+2008-05-16 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * 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.
+
2008-05-16 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/bfin.c (bfin_discover_loops): Delete empty loops.
debug.h $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-iterator.h tree-mudflap.h \
ipa-prop.h value-prof.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
+ $(GGC_H) langhooks.h $(REAL_H) tree-iterator.h fixed-value.h $(TREE_FLOW_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) $(RTL_H) \
$(GGC_H) $(TM_P_H) $(TARGET_H) langhooks.h $(REGS_H) gt-stor-layout.h \
Enable showing line numbers for statements.
@item uid
Enable showing the unique ID (@code{DECL_UID}) for each variable.
+@item verbose
+Enable showing the tree dump for each statement.
@item all
-Turn on all options, except @option{raw}, @option{slim} and @option{lineno}.
+Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
+and @option{lineno}.
@end table
The following tree dumps are possible:
#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. */
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);
}
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;
print_generic_expr (file, TREE_TYPE (arg), dump_flags);
fprintf (file, " ");
print_generic_expr (file, arg, dump_flags);
+ if (flags & TDF_VERBOSE)
+ print_node (file, "", arg, 4);
if (TREE_CHAIN (arg))
fprintf (file, ", ");
arg = TREE_CHAIN (arg);
}
fprintf (file, ")\n");
+ if (flags & TDF_VERBOSE)
+ print_node (file, "", fn, 2);
+
dsf = DECL_STRUCT_FUNCTION (fn);
if (dsf && (flags & TDF_DETAILS))
dump_eh_tree (file, dsf);
var = TREE_VALUE (vars);
print_generic_decl (file, var, flags);
+ if (flags & TDF_VERBOSE)
+ print_node (file, "", var, 4);
fprintf (file, "\n");
any_var = true;
{"uid", TDF_UID},
{"stmtaddr", TDF_STMTADDR},
{"memsyms", TDF_MEMSYMS},
+ {"verbose", TDF_VERBOSE},
{"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA
- | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC)},
+ | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE)},
{NULL, 0}
};
#define TDF_DIAGNOSTIC (1 << 15) /* A dump to be put in a diagnostic
message. */
+#define TDF_VERBOSE (1 << 16) /* A dump that uses the full tree
+ dumper to print stmts. */
extern char *get_dump_file_name (enum tree_dump_index);
extern int dump_enabled_p (enum tree_dump_index);
}
-/* Dump the node NODE on the pretty_printer BUFFER, SPC spaces of indent.
- FLAGS specifies details to show in the dump (see TDF_* in tree-pass.h).
- If IS_STMT is true, the object printed is considered to be a statement
- and it is terminated by ';' if appropriate. */
+/* Dump the node NODE on the pretty_printer BUFFER, SPC spaces of
+ indent. FLAGS specifies details to show in the dump (see TDF_* in
+ tree-pass.h). If IS_STMT is true, the object printed is considered
+ to be a statement and it is terminated by ';' if appropriate. */
int
dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
pp_string (buffer, "# ");
dump_generic_node (buffer, phi, indent, flags, false);
pp_newline (buffer);
+ if (flags & TDF_VERBOSE)
+ print_node (buffer->buffer->stream, "", phi, indent);
}
}
}
dump_generic_node (buffer, stmt, curr_indent, flags, true);
pp_newline (buffer);
dump_histograms_for_stmt (cfun, buffer->buffer->stream, stmt);
+ if (flags & TDF_VERBOSE)
+ print_node (buffer->buffer->stream, "", stmt, curr_indent);
}
dump_implicit_edges (buffer, bb, indent, flags);