diff options
Diffstat (limited to 'gcc/tree-switch-conversion.c')
-rw-r--r-- | gcc/tree-switch-conversion.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c index a0f9d19..34edc64 100644 --- a/gcc/tree-switch-conversion.c +++ b/gcc/tree-switch-conversion.c @@ -1414,12 +1414,43 @@ process_switch (gimple swtch) /* The main function of the pass scans statements for switches and invokes process_switch on them. */ -static unsigned int -do_switchconv (void) +namespace { + +const pass_data pass_data_convert_switch = +{ + GIMPLE_PASS, /* type */ + "switchconv", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + 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: */ + virtual bool gate (function *) { return flag_tree_switch_conversion != 0; } + virtual unsigned int execute (function *); + +}; // class pass_convert_switch + +unsigned int +pass_convert_switch::execute (function *fun) { basic_block bb; - FOR_EACH_BB_FN (bb, cfun) + FOR_EACH_BB_FN (bb, fun) { const char *failure_reason; gimple stmt = last_stmt (bb); @@ -1465,37 +1496,6 @@ do_switchconv (void) return 0; } -namespace { - -const pass_data pass_data_convert_switch = -{ - GIMPLE_PASS, /* type */ - "switchconv", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - 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: */ - virtual bool gate (function *) { return flag_tree_switch_conversion != 0; } - unsigned int execute () { return do_switchconv (); } - -}; // class pass_convert_switch - } // anon namespace gimple_opt_pass * |