This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Name unnamed passes and change duplicate pass names
- From: Justin Seyster <jrseys at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 7 May 2009 18:49:44 -0400
- Subject: [PATCH] Name unnamed passes and change duplicate pass names
I mailed the list a week ago about unnamed passes making it difficult
to insert plug-in passes where they want to go. In my case, I want
plug-ins to insert passes just before pass_all_optimizations, but I
cannot reference that pass by name.
Nobody seemed to object to the idea of naming that pass, so here is a
patch that names all the unnamed passes. While I was at it, I also
renamed passes that have duplicate names.
Bootstrapped on x86_64-unknown-linux-gnu.
This is a bit of a silly change, but it should be a boon to plug-in
authors!
2009-05-07 Justin Seyster <jrseys@gmail.com>
gcc/
* cgraphbuild.c (pass_build_cgraph_edges): Provided missing pass
name.
(pass_rebuild_cgraph_edges): Likewise.
(pass_remove_cgraph_callee_edges): Likewise.
* final.c (pass_final, pass_clean_state): Likewise.
* ipa-inline.c (pass_inline_parameters): Likewise.
* tree-ssa-loop.c (pass_record_bounds): Likewise.
* predict.c (pass_strip_predict_hints): Likewise.
* function.c (pass_init_function, pass_leaf_regs): Likewise.
* tree-dfa.c (pass_referenced_vars): Likewise.
* tree-ssa.c (pass_early_warn_uninitialized): Likewise.
(pass_late_warn_uninitialized): Likewise.
* tree-optimize.c (pass_all_optimizations): Likewise.
(pass_fixup_cfg, pass_init_datastructures): Likewise.
* stack-ptr-mod.c (pass_stack_ptr_mod): Likewise.
* reg-stac.c (pass_stack_regs): Likewise.
* tree-cfg.c (pass_warn_function_return): Likewise.
(pass_warn_function_noreturn): Likewise.
* passes.c (pass_rest_of_compilation, pass_postreload): Likewise.
* cfgrtl.c (pass_free_cfg): Likewise.
* df-core.c (pass_df_initialize_opt): Changed duplicate pass name.
* gcse.c (pass_rtl_pre, pass_df_initialize_no_opt): Likewise
* except.c (pass_rtl_eh): Likewise.
* dce.c (pass_ud_rtl_dce, pass_fast_rtl_dce): Likewise.
Index: gcc/cgraphbuild.c
===================================================================
--- gcc/cgraphbuild.c (revision 147136)
+++ gcc/cgraphbuild.c (working copy)
@@ -176,7 +176,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "build_edges", /* name */
NULL, /* gate */
build_cgraph_edges, /* execute */
NULL, /* sub */
@@ -237,7 +237,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "rebuild_edges", /* name */
NULL, /* gate */
rebuild_cgraph_edges, /* execute */
NULL, /* sub */
@@ -264,7 +264,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "rm_edges", /* name */
NULL, /* gate */
remove_cgraph_callee_edges, /* execute */
NULL, /* sub */
Index: gcc/final.c
===================================================================
--- gcc/final.c (revision 147136)
+++ gcc/final.c (working copy)
@@ -4230,7 +4230,7 @@
{
{
RTL_PASS,
- NULL, /* name */
+ "final", /* name */
NULL, /* gate */
rest_of_handle_final, /* execute */
NULL, /* sub */
@@ -4343,7 +4343,7 @@
{
{
RTL_PASS,
- NULL, /* name */
+ "clean", /* name */
NULL, /* gate */
rest_of_clean_state, /* execute */
NULL, /* sub */
Index: gcc/df-core.c
===================================================================
--- gcc/df-core.c (revision 147136)
+++ gcc/df-core.c (working copy)
@@ -760,7 +760,7 @@
{
{
RTL_PASS,
- "dfinit", /* name */
+ "dfinit_opt", /* name */
gate_opt, /* gate */
rest_of_handle_df_initialize, /* execute */
NULL, /* sub */
@@ -787,7 +787,7 @@
{
{
RTL_PASS,
- "dfinit", /* name */
+ "dfinit_no_opt", /* name */
gate_no_opt, /* gate */
rest_of_handle_df_initialize, /* execute */
NULL, /* sub */
Index: gcc/ipa-inline.c
===================================================================
--- gcc/ipa-inline.c (revision 147136)
+++ gcc/ipa-inline.c (working copy)
@@ -1647,7 +1647,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "inline_param", /* name */
NULL, /* gate */
compute_inline_parameters_for_current,/* execute */
NULL, /* sub */
Index: gcc/tree-ssa-loop.c
===================================================================
--- gcc/tree-ssa-loop.c (revision 147136)
+++ gcc/tree-ssa-loop.c (working copy)
@@ -481,7 +481,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "bounds", /* name */
NULL, /* gate */
tree_ssa_loop_bounds, /* execute */
NULL, /* sub */
Index: gcc/predict.c
===================================================================
--- gcc/predict.c (revision 147136)
+++ gcc/predict.c (working copy)
@@ -2220,7 +2220,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "strip_hints", /* name */
NULL, /* gate */
strip_predict_hints, /* execute */
NULL, /* sub */
Index: gcc/function.c
===================================================================
--- gcc/function.c (revision 147136)
+++ gcc/function.c (working copy)
@@ -4215,7 +4215,7 @@
{
{
RTL_PASS,
- NULL, /* name */
+ "func", /* name */
NULL, /* gate */
init_function_for_compilation, /* execute */
NULL, /* sub */
@@ -5382,7 +5382,7 @@
{
{
RTL_PASS,
- NULL, /* name */
+ "leaf", /* name */
NULL, /* gate */
rest_of_handle_check_leaf_regs, /* execute */
NULL, /* sub */
Index: gcc/gcse.c
===================================================================
--- gcc/gcse.c (revision 147136)
+++ gcc/gcse.c (working copy)
@@ -5125,7 +5125,7 @@
{
{
RTL_PASS,
- "pre", /* name */
+ "gcse_pre", /* name */
gate_rtl_pre, /* gate */
execute_rtl_pre, /* execute */
NULL, /* sub */
Index: gcc/tree-dfa.c
===================================================================
--- gcc/tree-dfa.c (revision 147136)
+++ gcc/tree-dfa.c (working copy)
@@ -101,7 +101,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "refvars", /* name */
NULL, /* gate */
find_referenced_vars, /* execute */
NULL, /* sub */
Index: gcc/except.c
===================================================================
--- gcc/except.c (revision 147136)
+++ gcc/except.c (working copy)
@@ -4707,7 +4707,7 @@
{
{
RTL_PASS,
- "eh", /* name */
+ "eh_rtl", /* name */
gate_handle_eh, /* gate */
rest_of_handle_eh, /* execute */
NULL, /* sub */
Index: gcc/tree-ssa.c
===================================================================
--- gcc/tree-ssa.c (revision 147136)
+++ gcc/tree-ssa.c (working copy)
@@ -1455,7 +1455,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "early_warn_uninit", /* name */
gate_warn_uninitialized, /* gate */
execute_early_warn_uninitialized, /* execute */
NULL, /* sub */
@@ -1474,7 +1474,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "late_warn_uninit", /* name */
gate_warn_uninitialized, /* gate */
execute_late_warn_uninitialized, /* execute */
NULL, /* sub */
Index: gcc/tree-optimize.c
===================================================================
--- gcc/tree-optimize.c (revision 147136)
+++ gcc/tree-optimize.c (working copy)
@@ -66,7 +66,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "all_optimizations", /* name */
gate_all_optimizations, /* gate */
NULL, /* execute */
NULL, /* sub */
@@ -292,7 +292,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "fixup", /* name */
NULL, /* gate */
execute_fixup_cfg, /* execute */
NULL, /* sub */
@@ -322,7 +322,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "datastructures", /* name */
NULL, /* gate */
execute_init_datastructures, /* execute */
NULL, /* sub */
Index: gcc/stack-ptr-mod.c
===================================================================
--- gcc/stack-ptr-mod.c (revision 147136)
+++ gcc/stack-ptr-mod.c (working copy)
@@ -95,7 +95,7 @@
{
{
RTL_PASS,
- NULL, /* name */
+ "spmod", /* name */
NULL, /* gate */
rest_of_handle_stack_ptr_mod, /* execute */
NULL, /* sub */
Index: gcc/reg-stack.c
===================================================================
--- gcc/reg-stack.c (revision 147136)
+++ gcc/reg-stack.c (working copy)
@@ -3221,7 +3221,7 @@
{
{
RTL_PASS,
- NULL, /* name */
+ "stack_regs", /* name */
gate_handle_stack_regs, /* gate */
NULL, /* execute */
NULL, /* sub */
Index: gcc/tree-cfg.c
===================================================================
--- gcc/tree-cfg.c (revision 147136)
+++ gcc/tree-cfg.c (working copy)
@@ -7211,7 +7211,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "warn_return", /* name */
NULL, /* gate */
execute_warn_function_return, /* execute */
NULL, /* sub */
@@ -7245,7 +7245,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "warn_noreturn", /* name */
NULL, /* gate */
execute_warn_function_noreturn, /* execute */
NULL, /* sub */
Index: gcc/passes.c
===================================================================
--- gcc/passes.c (revision 147136)
+++ gcc/passes.c (working copy)
@@ -288,7 +288,7 @@
{
{
GIMPLE_PASS,
- NULL, /* name */
+ "all_rtl", /* name */
gate_rest_of_compilation, /* gate */
NULL, /* execute */
NULL, /* sub */
@@ -313,7 +313,7 @@
{
{
RTL_PASS,
- NULL, /* name */
+ "all_postreload", /* name */
gate_postreload, /* gate */
NULL, /* execute */
NULL, /* sub */
Index: gcc/cfgrtl.c
===================================================================
--- gcc/cfgrtl.c (revision 147136)
+++ gcc/cfgrtl.c (working copy)
@@ -427,7 +427,7 @@
{
{
RTL_PASS,
- NULL, /* name */
+ "free_cfg", /* name */
NULL, /* gate */
rest_of_pass_free_cfg, /* execute */
NULL, /* sub */
Index: gcc/dce.c
===================================================================
--- gcc/dce.c (revision 147136)
+++ gcc/dce.c (working copy)
@@ -740,7 +740,7 @@
{
{
RTL_PASS,
- "dce", /* name */
+ "ud_rtl_dce", /* name */
gate_ud_dce, /* gate */
rest_of_handle_ud_dce, /* execute */
NULL, /* sub */
@@ -1125,7 +1125,7 @@
{
{
RTL_PASS,
- "dce", /* name */
+ "fast_rtl_dce", /* name */
gate_fast_dce, /* gate */
rest_of_handle_fast_dce, /* execute */
NULL, /* sub */