Commit 03085d1c by David Malcolm Committed by David Malcolm

rl78.c (rl78_devirt_pass): Convert from a struct to...

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.

From-SVN: r201553
parent d0cd8160
2013-08-07 David Malcolm <dmalcolm@redhat.com> 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. * coretypes.h (rtl_opt_pass): Add.
(gcc::context): Add. (gcc::context): Add.
* config/epiphany/epiphany.c (pass_mode_switch_use): New. * config/epiphany/epiphany.c (pass_mode_switch_use): New.
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "rl78-protos.h" #include "rl78-protos.h"
#include "dumpfile.h" #include "dumpfile.h"
#include "tree-pass.h" #include "tree-pass.h"
#include "context.h"
static inline bool is_interrupt_func (const_tree decl); static inline bool is_interrupt_func (const_tree decl);
static inline bool is_brk_interrupt_func (const_tree decl); static inline bool is_brk_interrupt_func (const_tree decl);
...@@ -129,30 +130,45 @@ devirt_pass (void) ...@@ -129,30 +130,45 @@ devirt_pass (void)
/* This pass converts virtual instructions using virtual registers, to /* This pass converts virtual instructions using virtual registers, to
real instructions using real registers. Rather than run it as real instructions using real registers. Rather than run it as
reorg, we reschedule it before vartrack to help with debugging. */ reorg, we reschedule it before vartrack to help with debugging. */
static struct opt_pass rl78_devirt_pass = namespace {
{
RTL_PASS, const pass_data pass_data_rl78_devirt =
"devirt", {
OPTGROUP_NONE, /* optinfo_flags */ RTL_PASS, /* type */
devirt_gate, "devirt", /* name */
devirt_pass, OPTGROUP_NONE, /* optinfo_flags */
NULL, true, /* has_gate */
NULL, true, /* has_execute */
212, TV_MACH_DEP, /* tv_id */
TV_MACH_DEP, 0, /* properties_required */
0, 0, 0, 0, /* properties_provided */
0, 0, /* properties_destroyed */
0 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, public:
"vartrack", pass_rl78_devirt(gcc::context *ctxt)
1, : rtl_opt_pass(pass_data_rl78_devirt, ctxt)
PASS_POS_INSERT_BEFORE {
}
/* 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 #undef TARGET_ASM_FILE_START
#define TARGET_ASM_FILE_START rl78_asm_file_start #define TARGET_ASM_FILE_START rl78_asm_file_start
...@@ -167,6 +183,15 @@ rl78_asm_file_start (void) ...@@ -167,6 +183,15 @@ rl78_asm_file_start (void)
fprintf (asm_out_file, "r%d\t=\t0x%x\n", 16 + i, 0xffee8 + i); 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); register_pass (& rl78_devirt_info);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment