aboutsummaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
authorZbigniew Chamski <zbigniew.chamski@gmail.com>2009-11-08 21:10:08 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2009-11-08 21:10:08 +0000
commite0a42b0f5b67d787dc86816895406b6fba6aac6f (patch)
tree42ab065bf8a3186983b0f265c90ee184ca2fd8ce /gcc/passes.c
parent642746839c4e86df01d0a6b34dd945ae10db7bc7 (diff)
downloadgcc-e0a42b0f5b67d787dc86816895406b6fba6aac6f.zip
gcc-e0a42b0f5b67d787dc86816895406b6fba6aac6f.tar.gz
gcc-e0a42b0f5b67d787dc86816895406b6fba6aac6f.tar.bz2
cfgrtl.c (pass_free_cfg): Add pass name.
* cfgrtl.c (pass_free_cfg): Add pass name. * cgraphbuild.c (pass_build_cgraph_edges): Likewise. (pass_rebuild_cgraph_edges, pass_remove_cgraph_callee_edges): Likewise. * dce.c (pass_ud_rtl_dce, pass_fast_rtl_dce): Change pass name. * df-core.c (pass_df_initialize_no_opt): Likewise. * except.c (pass_rtl_eh): Likewise. * function.c (pass_init_function, pass_leaf_regs): Likewise. * gcse.c (pass_rtl_pre): Change pass name. * passes.c (pass_postreload): Add pass name. (make_pass_instance): Don't use duplicate-tracking logic for names starting with '*'. (next_pass_1): Assert that pass has a name. (register_one_dump_file): If there is an space in the name, skip past it. * predict.c (pass_strip_predict_hints): Add pass name. * reg-stack.c (pass_stack_regs): Likewise. * stack-ptr-mod.c (pass_stack_ptr_mod): Likewise. * tree-cfg.c (pass_warn_function_return, pass_warn_function_noreturn): Add pass name. * tree-dfa.c (pass_referenced_vars): Likewise. * tree-optimize.c (pass_cleanup_cfg_post_optimizing): Fix whitespace before comment. (pass_fixup_cfg): Add pass name, fix whitespace before comment. (pass_init_datastructures): Add pass name. * tree-ssa-loop.c (pass_record_bounds): Likewise. * tree-ssa.c (pass_early_warn_uninitialized, pass_late_warn_uninitialized): Likewise. * tree.c (pass_ipa_free_lang_data): Likewise. * doc/passes.texi (pass manager): Document how to disambiguate pass names. Co-Authored-By: Joern Rennecke <amylaar@spamcop.net> From-SVN: r154013
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index 8022549..1cef349 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -314,7 +314,7 @@ struct rtl_opt_pass pass_postreload =
{
{
RTL_PASS,
- NULL, /* name */
+ "*all-postreload", /* name */
gate_postreload, /* gate */
NULL, /* execute */
NULL, /* sub */
@@ -374,7 +374,7 @@ void
register_one_dump_file (struct opt_pass *pass)
{
char *dot_name, *flag_name, *glob_name;
- const char *prefix;
+ const char *name, *prefix;
char num[10];
int flags, id;
@@ -384,7 +384,14 @@ register_one_dump_file (struct opt_pass *pass)
sprintf (num, "%d", ((int) pass->static_pass_number < 0
? 1 : pass->static_pass_number));
- dot_name = concat (".", pass->name, num, NULL);
+ /* The name is both used to identify the pass for the purposes of plugins,
+ and to specify dump file name and option.
+ The latter two might want something short which is not quite unique; for
+ that reason, we may have a disambiguating prefix, followed by a space
+ to mark the start of the following dump file name / option string. */
+ name = strchr (pass->name, ' ');
+ name = name ? name + 1 : pass->name;
+ dot_name = concat (".", name, num, NULL);
if (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS)
prefix = "ipa-", flags = TDF_IPA;
else if (pass->type == GIMPLE_PASS)
@@ -392,8 +399,8 @@ register_one_dump_file (struct opt_pass *pass)
else
prefix = "rtl-", flags = TDF_RTL;
- flag_name = concat (prefix, pass->name, num, NULL);
- glob_name = concat (prefix, pass->name, NULL);
+ flag_name = concat (prefix, name, num, NULL);
+ glob_name = concat (prefix, name, NULL);
id = dump_register (dot_name, flag_name, glob_name, flags);
set_pass_for_id (id, pass);
}
@@ -461,7 +468,7 @@ make_pass_instance (struct opt_pass *pass, bool track_duplicates)
and so it should rename the dump file. The first instance will
be -1, and be number of duplicates = -static_pass_number - 1.
Subsequent instances will be > 0 and just the duplicate number. */
- if (pass->name || track_duplicates)
+ if ((pass->name && pass->name[0] != '*') || track_duplicates)
{
pass->static_pass_number -= 1;
new_pass->static_pass_number = -pass->static_pass_number;
@@ -482,6 +489,9 @@ make_pass_instance (struct opt_pass *pass, bool track_duplicates)
static struct opt_pass **
next_pass_1 (struct opt_pass **list, struct opt_pass *pass)
{
+ /* Every pass should have a name so that plugins can refer to them. */
+ gcc_assert (pass->name != NULL);
+
*list = make_pass_instance (pass, false);
return &(*list)->next;