]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/combine.c
Automated conversion of passes to C++ classes
[thirdparty/gcc.git] / gcc / combine.c
index 754cd341f45cb6f35bb4ea3da951e9766c7d3aa3..d0aae69f2698cb0c20768d0223ed9b81546bd968 100644 (file)
@@ -13840,22 +13840,40 @@ rest_of_handle_combine (void)
   return 0;
 }
 
-struct rtl_opt_pass pass_combine =
+namespace {
+
+const pass_data pass_data_combine =
 {
- {
-  RTL_PASS,
-  "combine",                            /* name */
-  OPTGROUP_NONE,                        /* optinfo_flags */
-  gate_handle_combine,                  /* gate */
-  rest_of_handle_combine,               /* execute */
-  NULL,                                 /* sub */
-  NULL,                                 /* next */
-  0,                                    /* static_pass_number */
-  TV_COMBINE,                           /* tv_id */
-  PROP_cfglayout,                       /* properties_required */
-  0,                                    /* properties_provided */
-  0,                                    /* properties_destroyed */
-  0,                                    /* todo_flags_start */
-  TODO_df_finish | TODO_verify_rtl_sharing /* todo_flags_finish */
- }
+  RTL_PASS, /* type */
+  "combine", /* name */
+  OPTGROUP_NONE, /* optinfo_flags */
+  true, /* has_gate */
+  true, /* has_execute */
+  TV_COMBINE, /* tv_id */
+  PROP_cfglayout, /* properties_required */
+  0, /* properties_provided */
+  0, /* properties_destroyed */
+  0, /* todo_flags_start */
+  ( TODO_df_finish | TODO_verify_rtl_sharing ), /* todo_flags_finish */
 };
+
+class pass_combine : public rtl_opt_pass
+{
+public:
+  pass_combine(gcc::context *ctxt)
+    : rtl_opt_pass(pass_data_combine, ctxt)
+  {}
+
+  /* opt_pass methods: */
+  bool gate () { return gate_handle_combine (); }
+  unsigned int execute () { return rest_of_handle_combine (); }
+
+}; // class pass_combine
+
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_combine (gcc::context *ctxt)
+{
+  return new pass_combine (ctxt);
+}