diff options
Diffstat (limited to 'gcc/tree-call-cdce.c')
-rw-r--r-- | gcc/tree-call-cdce.c | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c index 9b6186e3393..8edcad93b8b 100644 --- a/gcc/tree-call-cdce.c +++ b/gcc/tree-call-cdce.c @@ -913,22 +913,40 @@ gate_call_cdce (void) return flag_tree_builtin_call_dce != 0 && optimize_function_for_speed_p (cfun); } -struct gimple_opt_pass pass_call_cdce = +namespace { + +const pass_data pass_data_call_cdce = { - { - GIMPLE_PASS, - "cdce", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - gate_call_cdce, /* gate */ - tree_call_cdce, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_TREE_CALL_CDCE, /* tv_id */ - PROP_cfg | PROP_ssa, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_verify_ssa /* todo_flags_finish */ - } + GIMPLE_PASS, /* type */ + "cdce", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_gate */ + true, /* has_execute */ + TV_TREE_CALL_CDCE, /* 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_call_cdce : public gimple_opt_pass +{ +public: + pass_call_cdce(gcc::context *ctxt) + : gimple_opt_pass(pass_data_call_cdce, ctxt) + {} + + /* opt_pass methods: */ + bool gate () { return gate_call_cdce (); } + unsigned int execute () { return tree_call_cdce (); } + +}; // class pass_call_cdce + +} // anon namespace + +gimple_opt_pass * +make_pass_call_cdce (gcc::context *ctxt) +{ + return new pass_call_cdce (ctxt); +} |