diff options
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r-- | gcc/ipa-inline.c | 122 |
1 files changed, 78 insertions, 44 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 6eede0d35fc..96cbc9a0133 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -2086,26 +2086,43 @@ early_inliner (void) return todo; } -struct gimple_opt_pass pass_early_inline = +namespace { + +const pass_data pass_data_early_inline = { - { - GIMPLE_PASS, - "einline", /* name */ - OPTGROUP_INLINE, /* optinfo_flags */ - NULL, /* gate */ - early_inliner, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_EARLY_INLINING, /* tv_id */ - PROP_ssa, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - 0 /* todo_flags_finish */ - } + GIMPLE_PASS, /* type */ + "einline", /* name */ + OPTGROUP_INLINE, /* optinfo_flags */ + false, /* has_gate */ + true, /* has_execute */ + TV_EARLY_INLINING, /* tv_id */ + PROP_ssa, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ }; +class pass_early_inline : public gimple_opt_pass +{ +public: + pass_early_inline(gcc::context *ctxt) + : gimple_opt_pass(pass_data_early_inline, ctxt) + {} + + /* opt_pass methods: */ + unsigned int execute () { return early_inliner (); } + +}; // class pass_early_inline + +} // anon namespace + +gimple_opt_pass * +make_pass_early_inline (gcc::context *ctxt) +{ + return new pass_early_inline (ctxt); +} + /* When to run IPA inlining. Inlining of always-inline functions happens during early inlining. @@ -2119,32 +2136,49 @@ gate_ipa_inline (void) return optimize || flag_lto || flag_wpa; } -struct ipa_opt_pass_d pass_ipa_inline = +namespace { + +const pass_data pass_data_ipa_inline = { - { - IPA_PASS, - "inline", /* name */ - OPTGROUP_INLINE, /* optinfo_flags */ - gate_ipa_inline, /* gate */ - ipa_inline, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_IPA_INLINING, /* tv_id */ - 0, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - TODO_remove_functions, /* todo_flags_finish */ - TODO_dump_symtab - | TODO_remove_functions /* todo_flags_finish */ - }, - inline_generate_summary, /* generate_summary */ - inline_write_summary, /* write_summary */ - inline_read_summary, /* read_summary */ - NULL, /* write_optimization_summary */ - NULL, /* read_optimization_summary */ - NULL, /* stmt_fixup */ - 0, /* TODOs */ - inline_transform, /* function_transform */ - NULL, /* variable_transform */ + IPA_PASS, /* type */ + "inline", /* name */ + OPTGROUP_INLINE, /* optinfo_flags */ + true, /* has_gate */ + true, /* has_execute */ + TV_IPA_INLINING, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + TODO_remove_functions, /* todo_flags_start */ + ( TODO_dump_symtab | TODO_remove_functions ), /* todo_flags_finish */ }; + +class pass_ipa_inline : public ipa_opt_pass_d +{ +public: + pass_ipa_inline(gcc::context *ctxt) + : ipa_opt_pass_d(pass_data_ipa_inline, ctxt, + inline_generate_summary, /* generate_summary */ + inline_write_summary, /* write_summary */ + inline_read_summary, /* read_summary */ + NULL, /* write_optimization_summary */ + NULL, /* read_optimization_summary */ + NULL, /* stmt_fixup */ + 0, /* function_transform_todo_flags_start */ + inline_transform, /* function_transform */ + NULL) /* variable_transform */ + {} + + /* opt_pass methods: */ + bool gate () { return gate_ipa_inline (); } + unsigned int execute () { return ipa_inline (); } + +}; // class pass_ipa_inline + +} // anon namespace + +ipa_opt_pass_d * +make_pass_ipa_inline (gcc::context *ctxt) +{ + return new pass_ipa_inline (ctxt); +} |