diff options
Diffstat (limited to 'gcc/tree-switch-conversion.c')
-rw-r--r-- | gcc/tree-switch-conversion.c | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c index 9ad7daf0689..0d128981e38 100644 --- a/gcc/tree-switch-conversion.c +++ b/gcc/tree-switch-conversion.c @@ -1463,25 +1463,42 @@ switchconv_gate (void) return flag_tree_switch_conversion != 0; } -struct gimple_opt_pass pass_convert_switch = +namespace { + +const pass_data pass_data_convert_switch = { - { - GIMPLE_PASS, - "switchconv", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - switchconv_gate, /* gate */ - do_switchconv, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_TREE_SWITCH_CONVERSION, /* tv_id */ - PROP_cfg | PROP_ssa, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_update_ssa - | TODO_verify_ssa - | TODO_verify_stmts - | TODO_verify_flow /* todo_flags_finish */ - } + GIMPLE_PASS, /* type */ + "switchconv", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_gate */ + true, /* has_execute */ + TV_TREE_SWITCH_CONVERSION, /* tv_id */ + ( PROP_cfg | PROP_ssa ), /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + ( TODO_update_ssa | TODO_verify_ssa + | TODO_verify_stmts + | TODO_verify_flow ), /* todo_flags_finish */ }; + +class pass_convert_switch : public gimple_opt_pass +{ +public: + pass_convert_switch(gcc::context *ctxt) + : gimple_opt_pass(pass_data_convert_switch, ctxt) + {} + + /* opt_pass methods: */ + bool gate () { return switchconv_gate (); } + unsigned int execute () { return do_switchconv (); } + +}; // class pass_convert_switch + +} // anon namespace + +gimple_opt_pass * +make_pass_convert_switch (gcc::context *ctxt) +{ + return new pass_convert_switch (ctxt); +} |