diff options
Diffstat (limited to 'gcc/passes.c')
-rw-r--r-- | gcc/passes.c | 94 |
1 files changed, 83 insertions, 11 deletions
diff --git a/gcc/passes.c b/gcc/passes.c index 9ec0ebf..5e91a79 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -140,7 +140,9 @@ opt_pass::opt_pass (const pass_data &data, context *ctxt) void pass_manager::execute_early_local_passes () { - execute_pass_list (cfun, pass_early_local_passes_1->sub); + execute_pass_list (cfun, pass_build_ssa_passes_1->sub); + execute_pass_list (cfun, pass_chkp_instrumentation_passes_1->sub); + execute_pass_list (cfun, pass_local_optimization_passes_1->sub); } unsigned int @@ -332,7 +334,7 @@ finish_optimization_passes (void) } static unsigned int -execute_all_early_local_passes (void) +execute_build_ssa_passes (void) { /* Once this pass (and its sub-passes) are complete, all functions will be in SSA form. Technically this state change is happening @@ -347,10 +349,10 @@ execute_all_early_local_passes (void) namespace { -const pass_data pass_data_early_local_passes = +const pass_data pass_data_build_ssa_passes = { SIMPLE_IPA_PASS, /* type */ - "early_local_cleanups", /* name */ + "build_ssa_passes", /* name */ OPTGROUP_NONE, /* optinfo_flags */ TV_EARLY_LOCAL, /* tv_id */ 0, /* properties_required */ @@ -362,11 +364,11 @@ const pass_data pass_data_early_local_passes = 0, /* todo_flags_finish */ }; -class pass_early_local_passes : public simple_ipa_opt_pass +class pass_build_ssa_passes : public simple_ipa_opt_pass { public: - pass_early_local_passes (gcc::context *ctxt) - : simple_ipa_opt_pass (pass_data_early_local_passes, ctxt) + pass_build_ssa_passes (gcc::context *ctxt) + : simple_ipa_opt_pass (pass_data_build_ssa_passes, ctxt) {} /* opt_pass methods: */ @@ -378,17 +380,87 @@ public: virtual unsigned int execute (function *) { - return execute_all_early_local_passes (); + return execute_build_ssa_passes (); } -}; // class pass_early_local_passes +}; // class pass_build_ssa_passes + +const pass_data pass_data_chkp_instrumentation_passes = +{ + SIMPLE_IPA_PASS, /* type */ + "chkp_passes", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + TV_NONE, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ +}; + +class pass_chkp_instrumentation_passes : public simple_ipa_opt_pass +{ +public: + pass_chkp_instrumentation_passes (gcc::context *ctxt) + : simple_ipa_opt_pass (pass_data_chkp_instrumentation_passes, ctxt) + {} + + /* opt_pass methods: */ + virtual bool gate (function *) + { + /* Don't bother doing anything if the program has errors. */ + return (!seen_error () && !in_lto_p); + } + +}; // class pass_chkp_instrumentation_passes + +const pass_data pass_data_local_optimization_passes = +{ + SIMPLE_IPA_PASS, /* type */ + "opt_local_passes", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + TV_NONE, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ +}; + +class pass_local_optimization_passes : public simple_ipa_opt_pass +{ +public: + pass_local_optimization_passes (gcc::context *ctxt) + : simple_ipa_opt_pass (pass_data_local_optimization_passes, ctxt) + {} + + /* opt_pass methods: */ + virtual bool gate (function *) + { + /* Don't bother doing anything if the program has errors. */ + return (!seen_error () && !in_lto_p); + } + +}; // class pass_local_optimization_passes } // anon namespace simple_ipa_opt_pass * -make_pass_early_local_passes (gcc::context *ctxt) +make_pass_build_ssa_passes (gcc::context *ctxt) +{ + return new pass_build_ssa_passes (ctxt); +} + +simple_ipa_opt_pass * +make_pass_chkp_instrumentation_passes (gcc::context *ctxt) +{ + return new pass_chkp_instrumentation_passes (ctxt); +} + +simple_ipa_opt_pass * +make_pass_local_optimization_passes (gcc::context *ctxt) { - return new pass_early_local_passes (ctxt); + return new pass_local_optimization_passes (ctxt); } namespace { |