diff options
Diffstat (limited to 'gcc/regcprop.c')
-rw-r--r-- | gcc/regcprop.c | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/gcc/regcprop.c b/gcc/regcprop.c index 896902f3012..19f33495170 100644 --- a/gcc/regcprop.c +++ b/gcc/regcprop.c @@ -1236,23 +1236,40 @@ gate_handle_cprop (void) } -struct rtl_opt_pass pass_cprop_hardreg = +namespace { + +const pass_data pass_data_cprop_hardreg = { - { - RTL_PASS, - "cprop_hardreg", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - gate_handle_cprop, /* gate */ - copyprop_hardreg_forward, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_CPROP_REGISTERS, /* tv_id */ - 0, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_df_finish - | TODO_verify_rtl_sharing /* todo_flags_finish */ - } + RTL_PASS, /* type */ + "cprop_hardreg", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_gate */ + true, /* has_execute */ + TV_CPROP_REGISTERS, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */ }; + +class pass_cprop_hardreg : public rtl_opt_pass +{ +public: + pass_cprop_hardreg(gcc::context *ctxt) + : rtl_opt_pass(pass_data_cprop_hardreg, ctxt) + {} + + /* opt_pass methods: */ + bool gate () { return gate_handle_cprop (); } + unsigned int execute () { return copyprop_hardreg_forward (); } + +}; // class pass_cprop_hardreg + +} // anon namespace + +rtl_opt_pass * +make_pass_cprop_hardreg (gcc::context *ctxt) +{ + return new pass_cprop_hardreg (ctxt); +} |