static const arch_register_req_t firm_std_reg_req = {
arch_register_req_type_normal,
®_classes[CLS_DATAB],
- { NULL }
+ NULL,
+ NULL
};
static const arch_register_req_t *
-firm_get_irn_reg_req(const arch_irn_ops_t *self,
+firm_get_irn_reg_req(const void *self,
arch_register_req_t *req, const ir_node *irn, int pos)
{
if(is_firm_be_mode(get_irn_mode(irn)))
return set_insert(reg_set, &templ, sizeof(templ), HASH_PTR(irn));
}
-static void firm_set_irn_reg(const arch_irn_ops_t *self, ir_node *irn, const arch_register_t *reg)
+static void firm_set_irn_reg(const void *self, ir_node *irn, const arch_register_t *reg)
{
struct irn_reg_assoc *assoc = get_irn_reg_assoc(irn);
assoc->reg = reg;
}
-static const arch_register_t *firm_get_irn_reg(const arch_irn_ops_t *self, const ir_node *irn)
+static const arch_register_t *firm_get_irn_reg(const void *self, const ir_node *irn)
{
struct irn_reg_assoc *assoc = get_irn_reg_assoc(irn);
return assoc->reg;
}
-static arch_irn_class_t firm_classify(const arch_irn_ops_t *self, const ir_node *irn)
+static arch_irn_class_t firm_classify(const void *self, const ir_node *irn)
{
arch_irn_class_t res;
case iro_Jmp:
res = arch_irn_class_branch;
break;
+ case iro_Call:
+ res = arch_irn_class_call;
+ break;
default:
res = arch_irn_class_normal;
}
return res;
}
-static arch_irn_flags_t firm_get_flags(const arch_irn_ops_t *self, const ir_node *irn)
+static arch_irn_flags_t firm_get_flags(const void *self, const ir_node *irn)
{
arch_irn_flags_t res = arch_irn_flags_spillable;
return res;
}
-static const arch_irn_ops_t irn_ops = {
- firm_get_irn_reg_req,
- firm_set_irn_reg,
- firm_get_irn_reg,
- firm_classify,
+static const arch_irn_ops_if_t firm_irn_ops_if = {
+ firm_get_irn_reg_req,
+ firm_set_irn_reg,
+ firm_get_irn_reg,
+ firm_classify,
firm_get_flags
};
-static const arch_irn_ops_t *firm_get_irn_ops(const arch_irn_handler_t *self,
- const ir_node *irn)
+static const arch_irn_ops_t firm_irn_ops = {
+ &firm_irn_ops_if
+};
+
+static const void *firm_get_irn_ops(const arch_irn_handler_t *self,
+ const ir_node *irn)
{
- return &irn_ops;
+ return &firm_irn_ops;
}
const arch_irn_handler_t firm_irn_handler = {
- firm_get_irn_ops,
+ firm_get_irn_ops,
};
static ir_node *new_Push(ir_graph *irg, ir_node *bl, ir_node *push, ir_node *arg)
static void *firm_cg_init(FILE *file_handle, ir_graph *irg, const arch_env_t *env);
-static const arch_code_generator_if_t firm_code_gen = {
+static const arch_code_generator_if_t firm_code_gen_if = {
firm_cg_init,
firm_prepare_graph,
firm_before_sched,
firm_before_ra,
+ NULL, /* lower spill */
+ NULL, /* lower reload */
firm_codegen_done
};
static void *firm_cg_init(FILE *file_handle, ir_graph *irg, const arch_env_t *env)
{
firm_code_gen_t *cg = xmalloc(sizeof(*cg));
- cg->impl = &firm_code_gen;
+ cg->impl = &firm_code_gen_if;
cg->irg = irg;
return cg;
}
-static const arch_code_generator_if_t *firm_get_code_generator(void *self)
+static const arch_code_generator_if_t *firm_get_code_generator_if(void *self)
{
- return &firm_code_gen;
+ return &firm_code_gen_if;
}
static const list_sched_selector_t *firm_get_list_sched_selector(const void *self) {
firm_get_n_reg_class,
firm_get_reg_class,
firm_get_irn_handler,
- firm_get_code_generator,
+ firm_get_code_generator_if,
firm_get_list_sched_selector
};