diff options
Diffstat (limited to 'gcc/tree-profile.c')
-rw-r--r-- | gcc/tree-profile.c | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c index 9985b40..e276a59 100644 --- a/gcc/tree-profile.c +++ b/gcc/tree-profile.c @@ -561,24 +561,42 @@ gate_tree_profile_ipa (void) || profile_arc_flag)); } -struct simple_ipa_opt_pass pass_ipa_tree_profile = +namespace { + +const pass_data pass_data_ipa_tree_profile = { - { - SIMPLE_IPA_PASS, - "profile", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - gate_tree_profile_ipa, /* gate */ - tree_profiling, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_IPA_PROFILE, /* tv_id */ - 0, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - 0 /* todo_flags_finish */ - } + SIMPLE_IPA_PASS, /* type */ + "profile", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_gate */ + true, /* has_execute */ + TV_IPA_PROFILE, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ }; +class pass_ipa_tree_profile : public simple_ipa_opt_pass +{ +public: + pass_ipa_tree_profile(gcc::context *ctxt) + : simple_ipa_opt_pass(pass_data_ipa_tree_profile, ctxt) + {} + + /* opt_pass methods: */ + bool gate () { return gate_tree_profile_ipa (); } + unsigned int execute () { return tree_profiling (); } + +}; // class pass_ipa_tree_profile + +} // anon namespace + +simple_ipa_opt_pass * +make_pass_ipa_tree_profile (gcc::context *ctxt) +{ + return new pass_ipa_tree_profile (ctxt); +} + #include "gt-tree-profile.h" |