enabled or not. */
static void
-register_one_dump_file (struct opt_pass *pass, bool ipa, int properties)
+register_one_dump_file (struct opt_pass *pass)
{
char *dot_name, *flag_name, *glob_name;
const char *prefix;
? 1 : pass->static_pass_number));
dot_name = concat (".", pass->name, num, NULL);
- if (ipa)
+ if (pass->type == SIMPLE_IPA_PASS)
prefix = "ipa-", flags = TDF_IPA;
- else if (properties & PROP_trees)
+ else if (pass->type == GIMPLE_PASS)
prefix = "tree-", flags = TDF_TREE;
else
prefix = "rtl-", flags = TDF_RTL;
/* Recursive worker function for register_dump_files. */
static int
-register_dump_files_1 (struct opt_pass *pass, bool ipa, int properties)
+register_dump_files_1 (struct opt_pass *pass, int properties)
{
do
{
& ~pass->properties_destroyed;
if (pass->name)
- register_one_dump_file (pass, ipa, new_properties);
+ register_one_dump_file (pass);
if (pass->sub)
- new_properties = register_dump_files_1 (pass->sub, false,
- new_properties);
+ new_properties = register_dump_files_1 (pass->sub, new_properties);
/* If we have a gate, combine the properties that we could have with
and without the pass being examined. */
return properties;
}
-/* Register the dump files for the pipeline starting at PASS. IPA is
- true if the pass is inter-procedural, and PROPERTIES reflects the
- properties that are guaranteed to be available at the beginning of
- the pipeline. */
+/* Register the dump files for the pipeline starting at PASS.
+ PROPERTIES reflects the properties that are guaranteed to be available at
+ the beginning of the pipeline. */
static void
-register_dump_files (struct opt_pass *pass, bool ipa, int properties)
+register_dump_files (struct opt_pass *pass,int properties)
{
pass->properties_required |= properties;
- register_dump_files_1 (pass, ipa, properties);
+ register_dump_files_1 (pass, properties);
}
/* Add a pass to the pass list. Duplicate the pass if it's already
#undef NEXT_PASS
/* Register the passes with the tree dump code. */
- register_dump_files (all_lowering_passes, false, PROP_gimple_any);
+ register_dump_files (all_lowering_passes, PROP_gimple_any);
all_lowering_passes->todo_flags_start |= TODO_set_props;
- register_dump_files (all_ipa_passes, true,
+ register_dump_files (all_ipa_passes,
PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
| PROP_cfg);
- register_dump_files (all_passes, false,
+ register_dump_files (all_passes,
PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh
| PROP_cfg);
}
bool initializing_dump;
unsigned int todo_after = 0;
+ /* IPA passes are executed on whole program, so cfun should be NULL.
+ Ohter passes needs function context set. */
+ if (pass->type == SIMPLE_IPA_PASS)
+ gcc_assert (!cfun && !current_function_decl);
+ else
+ {
+ gcc_assert (cfun && current_function_decl);
+ gcc_assert (!(cfun->curr_properties & PROP_trees)
+ || pass->type != RTL_PASS);
+ }
+
current_pass = pass;
/* See if we're supposed to run this pass. */
if (pass->gate && !pass->gate ())
{
do
{
+ gcc_assert (pass->type == GIMPLE_PASS
+ || pass->type == RTL_PASS);
if (execute_one_pass (pass) && pass->sub)
execute_pass_list (pass->sub);
pass = pass->next;
{
gcc_assert (!current_function_decl);
gcc_assert (!cfun);
+ gcc_assert (pass->type == SIMPLE_IPA_PASS);
if (execute_one_pass (pass) && pass->sub)
- do_per_function_toporder ((void (*)(void *))execute_pass_list,
- pass->sub);
+ {
+ if (pass->sub->type == GIMPLE_PASS)
+ do_per_function_toporder ((void (*)(void *))execute_pass_list,
+ pass->sub);
+ else if (pass->sub->type == SIMPLE_IPA_PASS)
+ execute_ipa_pass_list (pass->sub);
+ else
+ gcc_unreachable ();
+ }
if (!current_function_decl)
cgraph_process_new_functions ();
pass = pass->next;
static void dequeue_and_dump (dump_info_p);
static void dump_new_line (dump_info_p);
static void dump_maybe_newline (dump_info_p);
-static int dump_enable_all (int, int);
/* Add T to the end of the queue of nodes to dump. Returns the index
assigned to T. */
tree_dump_index enumeration in tree-pass.h. */
static struct dump_file_info dump_files[TDI_end] =
{
- {NULL, NULL, NULL, 0, 0, 0, 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},
- {".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6, 0},
+ {NULL, NULL, NULL, 0, 0, 0},
+ {".cgraph", "ipa-cgraph", NULL, TDF_IPA, 0, 0},
+ {".tu", "translation-unit", NULL, TDF_TREE, 0, 1},
+ {".class", "class-hierarchy", NULL, TDF_TREE, 0, 2},
+ {".original", "tree-original", NULL, TDF_TREE, 0, 3},
+ {".gimple", "tree-gimple", NULL, TDF_TREE, 0, 4},
+ {".nested", "tree-nested", NULL, TDF_TREE, 0, 5},
+ {".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6},
#define FIRST_AUTO_NUMBERED_DUMP 7
- {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},
+ {NULL, "tree-all", NULL, TDF_TREE, 0, 0},
+ {NULL, "rtl-all", NULL, TDF_RTL, 0, 0},
+ {NULL, "ipa-all", NULL, TDF_IPA, 0, 0},
};
/* Dynamically registered tree dump files and switches. */
/* Enable all tree dumps. Return number of enabled tree dumps. */
static int
-dump_enable_all (int flags, int letter)
+dump_enable_all (int flags)
{
int ir_dump_type = (flags & (TDF_TREE | TDF_RTL | TDF_IPA));
int n = 0;
size_t i;
for (i = TDI_none + 1; i < (size_t) TDI_end; i++)
- if ((dump_files[i].flags & ir_dump_type)
- && (letter == 0 || letter == dump_files[i].letter))
+ if ((dump_files[i].flags & ir_dump_type))
{
dump_files[i].state = -1;
dump_files[i].flags |= flags;
}
for (i = 0; i < extra_dump_files_in_use; i++)
- if ((extra_dump_files[i].flags & ir_dump_type)
- && (letter == 0 || letter == extra_dump_files[i].letter))
+ if ((extra_dump_files[i].flags & ir_dump_type))
{
extra_dump_files[i].state = -1;
extra_dump_files[i].flags |= flags;
/* Process -fdump-tree-all and -fdump-rtl-all, by enabling all the
known dumps. */
if (dfi->suffix == NULL)
- dump_enable_all (dfi->flags, 0);
+ dump_enable_all (dfi->flags);
return 1;
}
}
bool
-enable_rtl_dump_file (int letter)
+enable_rtl_dump_file (void)
{
- if (letter == 'a')
- letter = 0;
-
- return dump_enable_all (TDF_RTL | TDF_DETAILS | TDF_BLOCKS, letter) > 0;
+ return dump_enable_all (TDF_RTL | TDF_DETAILS | TDF_BLOCKS) > 0;
}