summaryrefslogtreecommitdiff
path: root/gcc/config/rl78/rl78.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/rl78/rl78.c')
-rw-r--r--gcc/config/rl78/rl78.c63
1 files changed, 44 insertions, 19 deletions
diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c
index c2ed7389bc4..d7cacc16352 100644
--- a/gcc/config/rl78/rl78.c
+++ b/gcc/config/rl78/rl78.c
@@ -49,6 +49,7 @@
#include "rl78-protos.h"
#include "dumpfile.h"
#include "tree-pass.h"
+#include "context.h"
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);
}