]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/ipa-split.c
Automated conversion of passes to C++ classes
[thirdparty/gcc.git] / gcc / ipa-split.c
index e786478981e43731ed4489a00870b3e94dbefae5..c83c4d04dbfa5c8c74edb303de9ecbf6482a24f2 100644 (file)
@@ -1624,26 +1624,44 @@ gate_split_functions (void)
          && !profile_arc_flag && !flag_branch_probabilities);
 }
 
-struct gimple_opt_pass pass_split_functions =
+namespace {
+
+const pass_data pass_data_split_functions =
 {
- {
-  GIMPLE_PASS,
-  "fnsplit",                           /* name */
-  OPTGROUP_NONE,                        /* optinfo_flags */
-  gate_split_functions,                        /* gate */
-  execute_split_functions,             /* execute */
-  NULL,                                        /* sub */
-  NULL,                                        /* next */
-  0,                                   /* static_pass_number */
-  TV_IPA_FNSPLIT,                      /* tv_id */
-  PROP_cfg,                            /* properties_required */
-  0,                                   /* properties_provided */
-  0,                                   /* properties_destroyed */
-  0,                                   /* todo_flags_start */
-  TODO_verify_all                              /* todo_flags_finish */
- }
+  GIMPLE_PASS, /* type */
+  "fnsplit", /* name */
+  OPTGROUP_NONE, /* optinfo_flags */
+  true, /* has_gate */
+  true, /* has_execute */
+  TV_IPA_FNSPLIT, /* tv_id */
+  PROP_cfg, /* properties_required */
+  0, /* properties_provided */
+  0, /* properties_destroyed */
+  0, /* todo_flags_start */
+  TODO_verify_all, /* todo_flags_finish */
 };
 
+class pass_split_functions : public gimple_opt_pass
+{
+public:
+  pass_split_functions(gcc::context *ctxt)
+    : gimple_opt_pass(pass_data_split_functions, ctxt)
+  {}
+
+  /* opt_pass methods: */
+  bool gate () { return gate_split_functions (); }
+  unsigned int execute () { return execute_split_functions (); }
+
+}; // class pass_split_functions
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_split_functions (gcc::context *ctxt)
+{
+  return new pass_split_functions (ctxt);
+}
+
 /* Gate feedback driven function splitting pass.
    We don't need to split when profiling at all, we are producing
    lousy code anyway.  */
@@ -1666,22 +1684,40 @@ execute_feedback_split_functions (void)
   return retval;
 }
 
-struct gimple_opt_pass pass_feedback_split_functions =
+namespace {
+
+const pass_data pass_data_feedback_split_functions =
 {
- {
-  GIMPLE_PASS,
-  "feedback_fnsplit",                  /* name */
-  OPTGROUP_NONE,                      /* optinfo_flags */
-  gate_feedback_split_functions,       /* gate */
-  execute_feedback_split_functions,    /* execute */
-  NULL,                                        /* sub */
-  NULL,                                        /* next */
-  0,                                   /* static_pass_number */
-  TV_IPA_FNSPLIT,                      /* tv_id */
-  PROP_cfg,                            /* properties_required */
-  0,                                   /* properties_provided */
-  0,                                   /* properties_destroyed */
-  0,                                   /* todo_flags_start */
-  TODO_verify_all                              /* todo_flags_finish */
- }
+  GIMPLE_PASS, /* type */
+  "feedback_fnsplit", /* name */
+  OPTGROUP_NONE, /* optinfo_flags */
+  true, /* has_gate */
+  true, /* has_execute */
+  TV_IPA_FNSPLIT, /* tv_id */
+  PROP_cfg, /* properties_required */
+  0, /* properties_provided */
+  0, /* properties_destroyed */
+  0, /* todo_flags_start */
+  TODO_verify_all, /* todo_flags_finish */
 };
+
+class pass_feedback_split_functions : public gimple_opt_pass
+{
+public:
+  pass_feedback_split_functions(gcc::context *ctxt)
+    : gimple_opt_pass(pass_data_feedback_split_functions, ctxt)
+  {}
+
+  /* opt_pass methods: */
+  bool gate () { return gate_feedback_split_functions (); }
+  unsigned int execute () { return execute_feedback_split_functions (); }
+
+}; // class pass_feedback_split_functions
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_feedback_split_functions (gcc::context *ctxt)
+{
+  return new pass_feedback_split_functions (ctxt);
+}