*/
static void call_mapper(ir_node *node, void *env)
{
- walker_env_t *wenv = env;
+ walker_env_t *wenv = (walker_env_t*)env;
ir_op *op = get_irn_op(node);
if (op == op_Call) {
p = pmap_find(wenv->c_map, ent);
if (p) {
- r = p->value;
+ r = (const i_call_record*)p->value;
wenv->nr_of_intrinsics += r->i_mapper(node, r->ctx) ? 1 : 0;
}
} else {
++wenv->nr_of_intrinsics;
break;
}
- r = r->link;
+ r = (const i_instr_record*)r->link;
}
}
}
return nr_of_intrinsics;
} /* lower_intrinsics */
-struct pass_t {
+typedef struct pass_t {
ir_prog_pass_t pass;
int part_block_used;
int length;
i_record list[1];
-};
+} pass_t;
/**
* Wrapper for running lower_intrinsics() as an ir_prog pass.
*/
static int pass_wrapper(ir_prog *irp, void *context)
{
- struct pass_t *pass = context;
+ pass_t *pass = (pass_t*)context;
(void) irp; /* TODO: set current irp, or remove parameter */
lower_intrinsics(pass->list, pass->length, pass->part_block_used);
/* probably this pass should not run again */
const char *name,
i_record *list, int length, int part_block_used)
{
- struct pass_t *pass = xmalloc(sizeof(*pass) + (length-1) * sizeof(pass->list[0]));
+ pass_t *pass = (pass_t*)xmalloc(sizeof(*pass) + (length-1) * sizeof(pass->list[0]));
memcpy(pass->list, list, sizeof(list[0]) * length);
pass->length = length;
/* A mapper for the floating point sqrt. */
int i_mapper_sqrt(ir_node *call, void *ctx)
{
- ir_node *mem;
- tarval *tv;
- ir_node *op = get_Call_param(call, 0);
+ ir_node *mem;
+ ir_tarval *tv;
+ ir_node *op = get_Call_param(call, 0);
(void) ctx;
if (!is_Const(op))
/* A mapper for the floating point cbrt. */
int i_mapper_cbrt(ir_node *call, void *ctx)
{
- ir_node *mem;
- tarval *tv;
- ir_node *op = get_Call_param(call, 0);
+ ir_node *mem;
+ ir_tarval *tv;
+ ir_node *op = get_Call_param(call, 0);
(void) ctx;
if (!is_Const(op))
/* pow (1.0, x) = 1.0 */
irn = left;
} else if (is_Const(right)) {
- tarval *tv = get_Const_tarval(right);
+ ir_tarval *tv = get_Const_tarval(right);
if (tarval_is_null(tv)) {
/* pow(x, 0.0) = 1.0 */
ir_mode *mode = get_tarval_mode(tv);
static bool initializer_val_is_null(ir_initializer_t *init)
{
- tarval *tv;
+ ir_tarval *tv;
if (get_initializer_kind(init) == IR_INITIALIZER_NULL)
return true;
}
}
if (len >= 0) {
- tarval *tv = new_tarval_from_long(len, get_type_mode(res_tp));
+ ir_tarval *tv = new_tarval_from_long(len, get_type_mode(res_tp));
return new_r_Const(irg, tv);
}
return NULL;
for (i = 0; i < size; ++i) {
ir_initializer_t *val = get_initializer_compound_value(initializer, i);
if (initializer_val_is_null(val)) {
- tarval *tv = new_tarval_from_long(i, get_type_mode(res_tp));
+ ir_tarval *tv = new_tarval_from_long(i, get_type_mode(res_tp));
return new_r_Const(irg, tv);
}
}
for (i = 0; i < n; ++i) {
ir_node *irn;
long v_l, v_r;
- tarval *tv;
+ ir_tarval *tv;
irn = get_compound_ent_value(left, i);
if (! is_Const(irn))
}
if (i < n) {
/* we found an end */
- tarval *tv = new_tarval_from_long(res, get_type_mode(res_tp));
+ ir_tarval *tv = new_tarval_from_long(res, get_type_mode(res_tp));
return new_r_Const(irg, tv);
}
return NULL;
mode = get_type_mode(char_tp);
/* replace the strcmp by (*x) */
- irn = new_rd_Load(dbg, block, mem, v, mode, 0);
+ irn = new_rd_Load(dbg, block, mem, v, mode, cons_none);
mem = new_r_Proj(irn, mode_M, pn_Load_M);
exc = new_r_Proj(irn, mode_X, pn_Load_X_except);
reg = new_r_Proj(irn, mode_X, pn_Load_X_regular);