diff options
author | Martin Jambor <mjambor@suse.cz> | 2009-11-10 15:43:20 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2009-11-10 15:43:20 +0100 |
commit | 2c5721d9f36a114809e296686ff39b1324b0cc5b (patch) | |
tree | 6cb5567aec53c0584fb5b316226815f21f6ec6b1 /gcc/passes.c | |
parent | c587836d9d5d1c1ec9182becd91268e0249d8f26 (diff) | |
download | gcc-2c5721d9f36a114809e296686ff39b1324b0cc5b.zip gcc-2c5721d9f36a114809e296686ff39b1324b0cc5b.tar.gz gcc-2c5721d9f36a114809e296686ff39b1324b0cc5b.tar.bz2 |
tree-pass.h (struct ipa_opt_pass_d): Added stmt_fixup field.
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.
From-SVN: r154064
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 1cef349..fb0dd83 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); |