diff options
Diffstat (limited to 'gcc/gimple-ssa-strength-reduction.c')
-rw-r--r-- | gcc/gimple-ssa-strength-reduction.c | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index 4a0d631722a..c6f305c35ea 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -3478,22 +3478,40 @@ gate_strength_reduction (void) return flag_tree_slsr; } -struct gimple_opt_pass pass_strength_reduction = -{ - { - GIMPLE_PASS, - "slsr", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - gate_strength_reduction, /* gate */ - execute_strength_reduction, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_GIMPLE_SLSR, /* tv_id */ - PROP_cfg | PROP_ssa, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_verify_ssa /* todo_flags_finish */ - } +namespace { + +const pass_data pass_data_strength_reduction = +{ + GIMPLE_PASS, /* type */ + "slsr", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_gate */ + true, /* has_execute */ + TV_GIMPLE_SLSR, /* tv_id */ + ( PROP_cfg | PROP_ssa ), /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_verify_ssa, /* todo_flags_finish */ }; + +class pass_strength_reduction : public gimple_opt_pass +{ +public: + pass_strength_reduction(gcc::context *ctxt) + : gimple_opt_pass(pass_data_strength_reduction, ctxt) + {} + + /* opt_pass methods: */ + bool gate () { return gate_strength_reduction (); } + unsigned int execute () { return execute_strength_reduction (); } + +}; // class pass_strength_reduction + +} // anon namespace + +gimple_opt_pass * +make_pass_strength_reduction (gcc::context *ctxt) +{ + return new pass_strength_reduction (ctxt); +} |