be_opcode_t be_get_irn_opcode(const ir_node *irn)
{
- return is_be_node(irn) ? get_irn_opcode(irn) - beo_base : beo_NoBeOp;
+ return is_be_node(irn) ? (be_opcode_t) get_irn_opcode(irn) - beo_base : beo_NoBeOp;
}
/**
}
static void
-be_node_set_irn_reg(const void *_self, ir_node *irn, const arch_register_t *reg)
+be_node_set_irn_reg(const void *self, ir_node *irn, const arch_register_t *reg)
{
be_reg_data_t *r = retrieve_reg_data(irn);
+ (void) self;
r->reg = reg;
}
return irn;
}
+void be_Perm_reduce(ir_node *perm, int new_size, int *map)
+{
+ ir_graph *irg = get_irn_irg(perm);
+ int n = get_irn_arity(perm);
+ be_reg_data_t *old_data = malloc(n * sizeof(old_data[0]));
+ be_node_attr_t *attr = get_irn_attr(perm);
+ ir_node **new_in = NEW_ARR_D(ir_node *, irg->obst, new_size + 1);
+
+ int i;
+
+ assert(be_is_Perm(perm));
+ assert(new_size <= n);
+
+ /* save the old register data */
+ memcpy(old_data, attr->reg_data, n * sizeof(old_data[0]));
+
+ /* compose the new in array and set the new register data directly in place */
+ for (i = 0; i < n; ++i) {
+ int idx = map[i];
+ if (idx >= 0) {
+ new_in[idx] = get_irn_n(perm, i);
+ attr->reg_data[idx] = old_data[i];
+ }
+ }
+
+ free(old_data);
+ set_irn_in(perm, new_size, new_in);
+}
+
ir_node *be_new_MemPerm(const arch_env_t *arch_env, ir_graph *irg, ir_node *bl, int n, ir_node *in[])
{
int i;
{
int out_pos = pos;
+ (void) self;
if (pos < 0) {
if (get_irn_mode(irn) == mode_T)
return arch_no_register_req;
}
const arch_register_t *
-be_node_get_irn_reg(const void *_self, const ir_node *irn)
+be_node_get_irn_reg(const void *self, const ir_node *irn)
{
be_reg_data_t *r;
+ (void) self;
if (get_irn_mode(irn) == mode_T)
return NULL;
r = retrieve_reg_data(irn);
return r->reg;
}
-static arch_irn_class_t be_node_classify(const void *_self, const ir_node *irn)
+static arch_irn_class_t be_node_classify(const void *self, const ir_node *irn)
{
redir_proj((const ir_node **) &irn);
+ (void) self;
switch(be_get_irn_opcode(irn)) {
#define XXX(a,b) case beo_ ## a: return arch_irn_class_ ## b
XXX(Spill, spill);
return 0;
}
-static arch_irn_flags_t be_node_get_flags(const void *_self, const ir_node *node)
+static arch_irn_flags_t be_node_get_flags(const void *self, const ir_node *node)
{
be_req_t *bereq;
int pos = -1;
+ (void) self;
if(is_Proj(node)) {
pos = OUT_POS(get_Proj_proj(node));
static ir_entity *be_node_get_frame_entity(const void *self, const ir_node *irn)
{
+ (void) self;
return be_get_frame_entity(irn);
}
static void be_node_set_frame_entity(const void *self, ir_node *irn, ir_entity *ent)
{
be_frame_attr_t *a;
+ (void) self;
assert(be_has_frame_entity(irn));
static void be_node_set_frame_offset(const void *self, ir_node *irn, int offset)
{
+ (void) self;
if(be_has_frame_entity(irn)) {
be_frame_attr_t *a = get_irn_attr(irn);
a->offset = offset;
static int be_node_get_sp_bias(const void *self, const ir_node *irn)
{
+ (void) self;
return be_is_IncSP(irn) ? be_get_IncSP_offset(irn) : 0;
}
const void *be_node_get_irn_ops(const arch_irn_handler_t *self, const ir_node *irn)
{
redir_proj((const ir_node **) &irn);
+ (void) self;
return is_be_node(irn) ? &be_node_irn_ops : NULL;
}
{
phi_handler_t *phi_handler = get_phi_handler_from_ops(self);
phi_attr_t *attr;
+ (void) self;
+ (void) pos;
if(!mode_is_datab(get_irn_mode(irn)))
return arch_no_register_req;
static
arch_irn_class_t phi_classify(const void *self, const ir_node *irn)
{
+ (void) self;
+ (void) irn;
return arch_irn_class_normal;
}
{
phi_handler_t *h = get_phi_handler_from_ops(self);
phi_attr_t *attr = get_Phi_attr(h, irn);
+ (void) self;
return attr->flags;
}
static
-ir_entity *phi_get_frame_entity(const void *_self, const ir_node *irn)
+ir_entity *phi_get_frame_entity(const void *self, const ir_node *irn)
{
+ (void) self;
+ (void) irn;
return NULL;
}
static
-void phi_set_frame_entity(const void *_self, ir_node *irn, ir_entity *ent)
+void phi_set_frame_entity(const void *self, ir_node *irn, ir_entity *ent)
{
+ (void) self;
+ (void) irn;
+ (void) ent;
assert(0);
}
static
-void phi_set_frame_offset(const void *_self, ir_node *irn, int bias)
+void phi_set_frame_offset(const void *self, ir_node *irn, int bias)
{
+ (void) self;
+ (void) irn;
+ (void) bias;
assert(0);
}
static
int phi_get_sp_bias(const void* self, const ir_node *irn)
{
+ (void) self;
+ (void) irn;
return 0;
}