mirror of git://gcc.gnu.org/git/gcc.git
invoke.text (-fdump-tree-*-verbose): New option.
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. From-SVN: r135417
This commit is contained in:
parent
4fc4d8507e
commit
3e894af156
|
@ -1,3 +1,15 @@
|
||||||
|
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>
|
2008-05-16 Bernd Schmidt <bernd.schmidt@analog.com>
|
||||||
|
|
||||||
* config/bfin/bfin.c (bfin_discover_loops): Delete empty loops.
|
* config/bfin/bfin.c (bfin_discover_loops): Delete empty loops.
|
||||||
|
|
|
@ -1986,7 +1986,7 @@ tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
|
||||||
debug.h $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-iterator.h tree-mudflap.h \
|
debug.h $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-iterator.h tree-mudflap.h \
|
||||||
ipa-prop.h value-prof.h $(TARGET_H) $(INTEGRATE_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) \
|
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) \
|
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) \
|
$(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 \
|
$(GGC_H) $(TM_P_H) $(TARGET_H) langhooks.h $(REGS_H) gt-stor-layout.h \
|
||||||
|
|
|
@ -4771,8 +4771,11 @@ Enable showing virtual operands for every statement.
|
||||||
Enable showing line numbers for statements.
|
Enable showing line numbers for statements.
|
||||||
@item uid
|
@item uid
|
||||||
Enable showing the unique ID (@code{DECL_UID}) for each variable.
|
Enable showing the unique ID (@code{DECL_UID}) for each variable.
|
||||||
|
@item verbose
|
||||||
|
Enable showing the tree dump for each statement.
|
||||||
@item all
|
@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
|
@end table
|
||||||
|
|
||||||
The following tree dumps are possible:
|
The following tree dumps are possible:
|
||||||
|
|
|
@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
|
||||||
#include "ggc.h"
|
#include "ggc.h"
|
||||||
#include "langhooks.h"
|
#include "langhooks.h"
|
||||||
#include "tree-iterator.h"
|
#include "tree-iterator.h"
|
||||||
|
#include "tree-flow.h"
|
||||||
|
|
||||||
/* Define the hash table of nodes already seen.
|
/* Define the hash table of nodes already seen.
|
||||||
Such nodes are not repeated; brief cross-references are used. */
|
Such nodes are not repeated; brief cross-references are used. */
|
||||||
|
@ -221,6 +222,9 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Allow this function to be called if the table is not there. */
|
||||||
|
if (table)
|
||||||
|
{
|
||||||
hash = ((unsigned long) node) % HASH_SIZE;
|
hash = ((unsigned long) node) % HASH_SIZE;
|
||||||
|
|
||||||
/* If node is in the table, just mention its address. */
|
/* If node is in the table, just mention its address. */
|
||||||
|
@ -236,6 +240,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
|
||||||
b->node = node;
|
b->node = node;
|
||||||
b->next = table[hash];
|
b->next = table[hash];
|
||||||
table[hash] = b;
|
table[hash] = b;
|
||||||
|
}
|
||||||
|
|
||||||
/* Indent to the specified column, since this is the long form. */
|
/* Indent to the specified column, since this is the long form. */
|
||||||
indent_to (file, indent);
|
indent_to (file, indent);
|
||||||
|
@ -906,6 +911,12 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case OMP_CLAUSE:
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -6179,12 +6179,17 @@ dump_function_to_file (tree fn, FILE *file, int flags)
|
||||||
print_generic_expr (file, TREE_TYPE (arg), dump_flags);
|
print_generic_expr (file, TREE_TYPE (arg), dump_flags);
|
||||||
fprintf (file, " ");
|
fprintf (file, " ");
|
||||||
print_generic_expr (file, arg, dump_flags);
|
print_generic_expr (file, arg, dump_flags);
|
||||||
|
if (flags & TDF_VERBOSE)
|
||||||
|
print_node (file, "", arg, 4);
|
||||||
if (TREE_CHAIN (arg))
|
if (TREE_CHAIN (arg))
|
||||||
fprintf (file, ", ");
|
fprintf (file, ", ");
|
||||||
arg = TREE_CHAIN (arg);
|
arg = TREE_CHAIN (arg);
|
||||||
}
|
}
|
||||||
fprintf (file, ")\n");
|
fprintf (file, ")\n");
|
||||||
|
|
||||||
|
if (flags & TDF_VERBOSE)
|
||||||
|
print_node (file, "", fn, 2);
|
||||||
|
|
||||||
dsf = DECL_STRUCT_FUNCTION (fn);
|
dsf = DECL_STRUCT_FUNCTION (fn);
|
||||||
if (dsf && (flags & TDF_DETAILS))
|
if (dsf && (flags & TDF_DETAILS))
|
||||||
dump_eh_tree (file, dsf);
|
dump_eh_tree (file, dsf);
|
||||||
|
@ -6210,6 +6215,8 @@ dump_function_to_file (tree fn, FILE *file, int flags)
|
||||||
var = TREE_VALUE (vars);
|
var = TREE_VALUE (vars);
|
||||||
|
|
||||||
print_generic_decl (file, var, flags);
|
print_generic_decl (file, var, flags);
|
||||||
|
if (flags & TDF_VERBOSE)
|
||||||
|
print_node (file, "", var, 4);
|
||||||
fprintf (file, "\n");
|
fprintf (file, "\n");
|
||||||
|
|
||||||
any_var = true;
|
any_var = true;
|
||||||
|
|
|
@ -822,8 +822,9 @@ static const struct dump_option_value_info dump_options[] =
|
||||||
{"uid", TDF_UID},
|
{"uid", TDF_UID},
|
||||||
{"stmtaddr", TDF_STMTADDR},
|
{"stmtaddr", TDF_STMTADDR},
|
||||||
{"memsyms", TDF_MEMSYMS},
|
{"memsyms", TDF_MEMSYMS},
|
||||||
|
{"verbose", TDF_VERBOSE},
|
||||||
{"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA
|
{"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}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,8 @@ enum tree_dump_index
|
||||||
|
|
||||||
#define TDF_DIAGNOSTIC (1 << 15) /* A dump to be put in a diagnostic
|
#define TDF_DIAGNOSTIC (1 << 15) /* A dump to be put in a diagnostic
|
||||||
message. */
|
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 char *get_dump_file_name (enum tree_dump_index);
|
||||||
extern int dump_enabled_p (enum tree_dump_index);
|
extern int dump_enabled_p (enum tree_dump_index);
|
||||||
|
|
|
@ -436,10 +436,10 @@ dump_symbols (pretty_printer *buffer, bitmap syms, int flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Dump the node NODE on the pretty_printer BUFFER, SPC spaces of indent.
|
/* Dump the node NODE on the pretty_printer BUFFER, SPC spaces of
|
||||||
FLAGS specifies details to show in the dump (see TDF_* in tree-pass.h).
|
indent. FLAGS specifies details to show in the dump (see TDF_* in
|
||||||
If IS_STMT is true, the object printed is considered to be a statement
|
tree-pass.h). If IS_STMT is true, the object printed is considered
|
||||||
and it is terminated by ';' if appropriate. */
|
to be a statement and it is terminated by ';' if appropriate. */
|
||||||
|
|
||||||
int
|
int
|
||||||
dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
|
dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
|
||||||
|
@ -3052,6 +3052,8 @@ dump_phi_nodes (pretty_printer *buffer, basic_block bb, int indent, int flags)
|
||||||
pp_string (buffer, "# ");
|
pp_string (buffer, "# ");
|
||||||
dump_generic_node (buffer, phi, indent, flags, false);
|
dump_generic_node (buffer, phi, indent, flags, false);
|
||||||
pp_newline (buffer);
|
pp_newline (buffer);
|
||||||
|
if (flags & TDF_VERBOSE)
|
||||||
|
print_node (buffer->buffer->stream, "", phi, indent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3170,6 +3172,8 @@ dump_generic_bb_buff (pretty_printer *buffer, basic_block bb,
|
||||||
dump_generic_node (buffer, stmt, curr_indent, flags, true);
|
dump_generic_node (buffer, stmt, curr_indent, flags, true);
|
||||||
pp_newline (buffer);
|
pp_newline (buffer);
|
||||||
dump_histograms_for_stmt (cfun, buffer->buffer->stream, stmt);
|
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);
|
dump_implicit_edges (buffer, bb, indent, flags);
|
||||||
|
|
Loading…
Reference in New Issue