]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/tree-profile.c
Automated conversion of passes to C++ classes
[thirdparty/gcc.git] / gcc / tree-profile.c
index 9985b40a2a87206691f7a7687c3c56a4b543c261..e276a592b2f3bb99bb1bcec6e359cebf561cf6ac 100644 (file)
@@ -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"