diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-10 14:43:20 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-10 14:43:20 +0000 |
commit | 90464c8b80ce61e7f80340c404a8a1b3ffc41316 (patch) | |
tree | 6cb5567aec53c0584fb5b316226815f21f6ec6b1 /gcc/passes.c | |
parent | fa15a5af81ca7b69e5a309a433d3338cda75ed4d (diff) | |
download | gcc-90464c8b80ce61e7f80340c404a8a1b3ffc41316.tar.gz |
2009-11-10 Martin Jambor <mjambor@suse.cz>
* tree-pass.h (struct ipa_opt_pass_d): Added stmt_fixup field.
(execute_all_ipa_stmt_fixups): Declare.
* ipa-cp.c (pass_ipa_cp): Added stmt_fixup value.
* ipa-inline.c (pass_ipa_inline): Likewise.
* ipa-pure-const.c (pass_ipa_pure_cons): Likewise.
* ipa-reference.c (pass_ipa_reference): Likewise.
* ipa.c (pass_ipa_whole_program_visibility): Likewise.
* lto-streamer-out.c (pass_ipa_lto_gimple_out): Likewise.
(pass_ipa_lto_finish_out): Likewise.
* lto-wpa-fixup.c (pass_ipa_lto_wpa_fixup): Likewise.
* passes.c (execute_ipa_stmt_fixups): New function.
(execute_all_ipa_stmt_fixups): New function.
* lto-streamer-in.c (input_function): Call execute_all_ipa_stmt_fixups.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154064 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/passes.c')
-rw-r--r-- | gcc/passes.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc/passes.c b/gcc/passes.c index 1cef3499b78..fb0dd832708 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1755,6 +1755,50 @@ execute_ipa_pass_list (struct opt_pass *pass) while (pass); } +/* Execute stmt fixup hooks of all passes in PASS for NODE and STMTS. */ + +static void +execute_ipa_stmt_fixups (struct opt_pass *pass, + struct cgraph_node *node, gimple *stmts) +{ + while (pass) + { + /* Execute all of the IPA_PASSes in the list. */ + if (pass->type == IPA_PASS + && (!pass->gate || pass->gate ())) + { + struct ipa_opt_pass_d *ipa_pass = (struct ipa_opt_pass_d *) pass; + + if (ipa_pass->stmt_fixup) + { + pass_init_dump_file (pass); + /* If a timevar is present, start it. */ + if (pass->tv_id) + timevar_push (pass->tv_id); + + ipa_pass->stmt_fixup (node, stmts); + + /* Stop timevar. */ + if (pass->tv_id) + timevar_pop (pass->tv_id); + pass_fini_dump_file (pass); + } + if (pass->sub) + execute_ipa_stmt_fixups (pass->sub, node, stmts); + } + pass = pass->next; + } +} + +/* Execute stmt fixup hooks of all IPA passes for NODE and STMTS. */ + +void +execute_all_ipa_stmt_fixups (struct cgraph_node *node, gimple *stmts) +{ + execute_ipa_stmt_fixups (all_regular_ipa_passes, node, stmts); +} + + extern void debug_properties (unsigned int); extern void dump_properties (FILE *, unsigned int); |