summaryrefslogtreecommitdiff
path: root/gcc/tree-dump.c
diff options
context:
space:
mode:
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-08 08:13:20 +0000
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-08 08:13:20 +0000
commit6354626cdef500a87d9d85c5fa399b8a996662fb (patch)
treeb4486762445408b8e8b311f02bd5109a18afaffb /gcc/tree-dump.c
parent0d6c33ead962cfd497c1a65bd3fe0984f5c09eac (diff)
downloadgcc-6354626cdef500a87d9d85c5fa399b8a996662fb.tar.gz
2006-02-08 Paolo Bonzini <bonzini@gnu.org>
* passes.c (register_one_dump_file): Accept the current properties instead of pass number. Adjust call to dump_register. Remove duplicated code. (register_dump_files): Now a wrapper around... (register_dump_files_1): ... this one. Do not modify the pass structure. (next_pass_1): Cosmetic fix. (execute_todo): Keep second parameter only. Use curr_properties instead of fetching it from the pass structure. Check and set last_verified. (execute_one_pass): Handle TODO_set_props. Use curr_properties instead of fetching it from the pass structure. Fix calls to execute_todo. Update curr_properties and initialize .vcg RTL dump after running the pass. Reset last_verified. * tree-dump.c (dump_files): Renumber consecutively. Put .cgraph dump at the beginning. (FIRST_AUTO_NUMBERED_DUMP): New. (dump_register): Remove "num" parameter, assign it within the function. (get_dump_file_name): Modify template for dumps. * tree-dump.h (dump_register): Adjust prototype. * tree-pass.h (enum tree_dump_index): Move cgraph at the beginning. (PROP_trees): Add PROP_gimple_lomp. (TODO_set_props): New. * gimple-low.c (pass_lower_cf): Do not destroy PROP_gimple_lcf. * tree-eh.c (pass_lower_eh): Do not destroy PROP_gimple_leh. * cfgexpand.c (pass_expand): Destroy PROP_trees. gcc/testsuite: 2006-02-08 Paolo Bonzini <bonzini@gnu.org> * lib/gcc-dg.exp (cleanup-rtl-dump, cleanup-tree-dump, cleanup-ipa-dump): Update dump file glob patterns. * lib/scantree.exp (scan-tree-dump, scan-tree-dump-times, scan-tree-dump-not, scan-tree-dump-dem): Likewise. * lib/scanipa.exp (scan-ipa-dump, scan-ipa-dump-times, scan-ipa-dump-not, scan-ipa-dump-dem): Likewise. * lib/scanrtl.exp: New. * lib/gcc-dg.exp: Load it. * objc.dg/stubify-2.m: Use scan-rtl-dump-not. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110742 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-dump.c')
-rw-r--r--gcc/tree-dump.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index 89fd71ca712..49862ed24e9 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -721,22 +721,23 @@ dump_node (tree t, int flags, FILE *stream)
/* Table of tree dump switches. This must be consistent with the
- TREE_DUMP_INDEX enumeration in tree.h */
+ TREE_DUMP_INDEX enumeration in tree.h. */
static struct dump_file_info dump_files[TDI_end] =
{
{NULL, NULL, NULL, 0, 0, 0, 0},
- {".tu", "translation-unit", NULL, TDF_TREE, 0, 0, 0},
- {".class", "class-hierarchy", NULL, TDF_TREE, 0, 1, 0},
- {".original", "tree-original", NULL, TDF_TREE, 0, 2, 0},
- {".gimple", "tree-gimple", NULL, TDF_TREE, 0, 3, 0},
- {".nested", "tree-nested", NULL, TDF_TREE, 0, 4, 0},
- {".inlined", "tree-inlined", NULL, TDF_TREE, 0, 5, 0},
- {".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6, 0},
+ {".cgraph", "ipa-cgraph", NULL, TDF_IPA, 0, 0, 0},
+ {".tu", "translation-unit", NULL, TDF_TREE, 0, 1, 0},
+ {".class", "class-hierarchy", NULL, TDF_TREE, 0, 2, 0},
+ {".original", "tree-original", NULL, TDF_TREE, 0, 3, 0},
+ {".gimple", "tree-gimple", NULL, TDF_TREE, 0, 4, 0},
+ {".nested", "tree-nested", NULL, TDF_TREE, 0, 5, 0},
+ {".inlined", "tree-inlined", NULL, TDF_TREE, 0, 6, 0},
+ {".vcg", "tree-vcg", NULL, TDF_TREE, 0, 7, 0},
+#define FIRST_AUTO_NUMBERED_DUMP 8
+
{NULL, "tree-all", NULL, TDF_TREE, 0, 0, 0},
{NULL, "rtl-all", NULL, TDF_RTL, 0, 0, 0},
{NULL, "ipa-all", NULL, TDF_IPA, 0, 0, 0},
-
- { ".cgraph", "ipa-cgraph", NULL, TDF_IPA, 0, 0, 0},
};
/* Dynamically registered tree dump files and switches. */
@@ -772,8 +773,11 @@ static const struct dump_option_value_info dump_options[] =
unsigned int
dump_register (const char *suffix, const char *swtch, const char *glob,
- int flags, unsigned int num, int letter)
+ int flags, int letter)
{
+ static int next_dump = FIRST_AUTO_NUMBERED_DUMP;
+ int num = next_dump++;
+
size_t this = extra_dump_files_in_use++;
if (this >= extra_dump_files_alloced)
@@ -819,7 +823,7 @@ get_dump_file_info (enum tree_dump_index phase)
char *
get_dump_file_name (enum tree_dump_index phase)
{
- char dump_id[7];
+ char dump_id[10];
struct dump_file_info *dfi;
if (phase == TDI_none)
@@ -833,15 +837,15 @@ get_dump_file_name (enum tree_dump_index phase)
dump_id[0] = '\0';
else
{
- const char *template;
+ char suffix;
if (dfi->flags & TDF_TREE)
- template = ".t%02d";
+ suffix = 't';
else if (dfi->flags & TDF_IPA)
- template = ".i%02d";
+ suffix = 'i';
else
- template = ".%02d";
+ suffix = 'r';
- if (snprintf (dump_id, sizeof (dump_id), template, dfi->num) < 0)
+ if (snprintf (dump_id, sizeof (dump_id), ".%03d%c", dfi->num, suffix) < 0)
dump_id[0] = '\0';
}