]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2013-08-07 David Malcolm <dmalcolm@redhat.com>
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Aug 2013 01:50:43 +0000 (01:50 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Aug 2013 01:50:43 +0000 (01:50 +0000)
* config/rl78/rl78.c (rl78_devirt_pass): Convert from a struct to...
(pass_rl78_devirt): ...new subclass of rtl_opt_pass along with...
(pass_data_rl78_devirt): ...new pass_data instance and...
(make_pass_rl78_devirt): ...new function.
(rl78_asm_file_start): Port pass registration to new C++ API.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201553 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/rl78/rl78.c

index f89f5eba9d737d9bc25a19234e9293a0bb75ca88..c62cb892163b009a1fd2c2569ecf12dac51d1332 100644 (file)
@@ -1,3 +1,11 @@
+2013-08-07  David Malcolm  <dmalcolm@redhat.com>
+
+       * config/rl78/rl78.c (rl78_devirt_pass): Convert from a struct to...
+       (pass_rl78_devirt): ...new subclass of rtl_opt_pass along with...
+       (pass_data_rl78_devirt): ...new pass_data instance and...
+       (make_pass_rl78_devirt): ...new function.
+       (rl78_asm_file_start): Port pass registration to new C++ API.
+
 2013-08-07  David Malcolm  <dmalcolm@redhat.com>
 
        * coretypes.h (rtl_opt_pass): Add.
index c2ed7389bc425ccf3500db91f328b709a9f5e714..d7cacc16352dce3420a224af690eac13372777d4 100644 (file)
@@ -49,6 +49,7 @@
 #include "rl78-protos.h"
 #include "dumpfile.h"
 #include "tree-pass.h"
+#include "context.h"
 \f
 static inline bool is_interrupt_func (const_tree decl);
 static inline bool is_brk_interrupt_func (const_tree decl);
@@ -129,30 +130,45 @@ devirt_pass (void)
 /* This pass converts virtual instructions using virtual registers, to
    real instructions using real registers.  Rather than run it as
    reorg, we reschedule it before vartrack to help with debugging.  */
-static struct opt_pass rl78_devirt_pass =
-{
-  RTL_PASS,
-  "devirt",
-  OPTGROUP_NONE,                        /* optinfo_flags */
-  devirt_gate,
-  devirt_pass,
-  NULL,
-  NULL,
-  212,
-  TV_MACH_DEP,
-  0, 0, 0,
-  0,
-  0
+namespace {
+
+const pass_data pass_data_rl78_devirt =
+{
+  RTL_PASS, /* type */
+  "devirt", /* name */
+  OPTGROUP_NONE, /* optinfo_flags */
+  true, /* has_gate */
+  true, /* has_execute */
+  TV_MACH_DEP, /* tv_id */
+  0, /* properties_required */
+  0, /* properties_provided */
+  0, /* properties_destroyed */
+  0, /* todo_flags_start */
+  0, /* todo_flags_finish */
 };
 
-static struct register_pass_info rl78_devirt_info =
+class pass_rl78_devirt : public rtl_opt_pass
 {
-  & rl78_devirt_pass,
-  "vartrack",
-  1,
-  PASS_POS_INSERT_BEFORE
+public:
+  pass_rl78_devirt(gcc::context *ctxt)
+    : rtl_opt_pass(pass_data_rl78_devirt, ctxt)
+  {
+  }
+
+  /* opt_pass methods: */
+  bool gate () { return devirt_gate (); }
+  unsigned int execute () { return devirt_pass (); }
 };
 
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rl78_devirt (gcc::context *ctxt)
+{
+  return new pass_rl78_devirt (ctxt);
+}
+
+
 #undef  TARGET_ASM_FILE_START
 #define TARGET_ASM_FILE_START rl78_asm_file_start
 
@@ -167,6 +183,15 @@ rl78_asm_file_start (void)
       fprintf (asm_out_file, "r%d\t=\t0x%x\n", 16 + i, 0xffee8 + i);
     }
 
+  opt_pass *rl78_devirt_pass = make_pass_rl78_devirt (g);
+  struct register_pass_info rl78_devirt_info =
+    {
+      rl78_devirt_pass,
+      "vartrack",
+      1,
+      PASS_POS_INSERT_BEFORE
+    };
+
   register_pass (& rl78_devirt_info);
 }