Commit 8ce557f8 authored by Moritz Kroll's avatar Moritz Kroll
Browse files

Removed unused block parameter from Const constructors

[r23750]
parent af7c3d76
......@@ -1223,21 +1223,24 @@ ir_node *new_rd_Return (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *store, int arity, ir_node *in[]);
/** Constructor for a Const_type node.
*
* Adds the node to the start block.
*
* The constant represents a target value. This constructor sets high
* level type information for the constant value.
*
* @param *db A pointer for debug information.
* @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *mode The mode of the operands and results.
* @param *con Points to an entry in the constant table.
* @param *tp The type of the constant.
*/
ir_node *new_rd_Const_type (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *new_rd_Const_type (dbg_info *db, ir_graph *irg,
ir_mode *mode, tarval *con, ir_type *tp);
/** Constructor for a Const node.
*
* Adds the node to the start block.
*
* Constructor for a Const node. The constant represents a target
* value. Sets the type information to type_unknown. (No more
......@@ -1245,11 +1248,10 @@ ir_node *new_rd_Const_type (dbg_info *db, ir_graph *irg, ir_node *block,
*
* @param *db A pointer for debug information.
* @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *mode The mode of the operands and results.
* @param *con Points to an entry in the constant table.
*/
ir_node *new_rd_Const (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *new_rd_Const (dbg_info *db, ir_graph *irg,
ir_mode *mode, tarval *con);
/** Constructor for a SymConst_type node.
......@@ -2104,6 +2106,8 @@ ir_node *new_r_Return (ir_graph *irg, ir_node *block,
ir_node *store, int arity, ir_node *in[]);
/** Constructor for a Const node.
*
* Adds the node to the start block.
*
* Constructor for a Const node. The constant represents a target
* value. Sets the type information to type_unknown. (No more
......@@ -2114,35 +2118,37 @@ ir_node *new_r_Return (ir_graph *irg, ir_node *block,
* @param *mode The mode of the operands and the results.
* @param *con Points to an entry in the constant table.
*/
ir_node *new_r_Const (ir_graph *irg, ir_node *block,
ir_node *new_r_Const (ir_graph *irg,
ir_mode *mode, tarval *con);
/** Constructor for a Const node.
*
* Adds the node to the start block.
*
* Constructor for a Const node. The constant represents a target
* value. Sets the type information to type_unknown. (No more
* supported: If tv is entity derives a somehow useful type.)
*
* @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *mode The mode of the operands and the results.
* @param value A value from which the tarval is made.
*/
ir_node *new_r_Const_long(ir_graph *irg, ir_node *block,
ir_node *new_r_Const_long(ir_graph *irg,
ir_mode *mode, long value);
/** Constructor for a Const_type node.
*
* Adds the node to the start block.
*
* The constant represents a target value. This constructor sets high
* level type information for the constant value.
*
* @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to.
* @param *mode The mode of the operands and results.
* @param *con Points to an entry in the constant table.
* @param *tp The type of the constant.
*/
ir_node *new_r_Const_type(ir_graph *irg, ir_node *block,
ir_node *new_r_Const_type(ir_graph *irg,
ir_mode *mode, tarval *con, ir_type *tp);
/** Constructor for a SymConst node.
......@@ -2932,7 +2938,7 @@ ir_node *new_d_Return (dbg_info *db, ir_node *store, int arity, ir_node *in[]);
/** Constructor for a Const_type node.
*
* Adds the node to the block in current_ir_block.
* Adds the node to the start block.
*
* The constant represents a target value. This constructor sets high
* level type information for the constant value.
......
......@@ -108,7 +108,7 @@ static void handle_case(ir_node *block, ir_node *irn, long nr, env_t *env) {
ir_mode *mode = get_irn_mode(irn);
ir_type *tp = get_irn_type(irn);
tarval *tv = new_tarval_from_long(nr, mode);
c = new_r_Const_type(current_ir_graph, block, mode, tv, tp);
c = new_r_Const_type(current_ir_graph, mode, tv, tp);
}
set_irn_n(succ, pos, c);
......
......@@ -553,7 +553,7 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
if(mode_is_reference(mach_mode)) {
constmode = mode_Is;
}
addr = new_r_Const_long(irg, bl, constmode, curr_ofs);
addr = new_r_Const_long(irg, constmode, curr_ofs);
addr = new_r_Add(irg, bl, curr_sp, addr, mach_mode);
}
}
......@@ -851,11 +851,11 @@ static ir_node *adjust_alloc_size(unsigned stack_alignment, ir_node *size,
mode = get_irn_mode(size);
tv = new_tarval_from_long(stack_alignment-1, mode);
mask = new_r_Const(irg, block, mode, tv);
mask = new_r_Const(irg, mode, tv);
size = new_rd_Add(dbg, irg, block, size, mask, mode);
tv = new_tarval_from_long(-(long)stack_alignment, mode);
mask = new_r_Const(irg, block, mode, tv);
mask = new_r_Const(irg, mode, tv);
size = new_rd_And(dbg, irg, block, size, mask, mode);
}
return size;
......@@ -915,7 +915,7 @@ static ir_node *adjust_alloc(be_abi_irg_t *env, ir_node *alloc, ir_node *curr_sp
if (type != firm_unknown_type && get_type_size_bytes(type) != 1) {
tarval *tv = new_tarval_from_long(get_type_size_bytes(type),
mode_Iu);
ir_node *cnst = new_rd_Const(dbg, irg, block, mode_Iu, tv);
ir_node *cnst = new_rd_Const(dbg, irg, mode_Iu, tv);
ir_node *mul = new_rd_Mul(dbg, irg, block, get_Alloc_size(alloc),
cnst, mode_Iu);
size = mul;
......@@ -985,7 +985,7 @@ static ir_node *adjust_free(be_abi_irg_t *env, ir_node *free, ir_node *curr_sp)
/* we might need to multiply the size with the element size */
if (type != firm_unknown_type && get_type_size_bytes(type) != 1) {
tarval *tv = new_tarval_from_long(get_type_size_bytes(type), mode_Iu);
ir_node *cnst = new_rd_Const(dbg, irg, block, mode_Iu, tv);
ir_node *cnst = new_rd_Const(dbg, irg, mode_Iu, tv);
ir_node *mul = new_rd_Mul(dbg, irg, block, get_Free_size(free),
cnst, mode_Iu);
size = mul;
......
......@@ -73,7 +73,7 @@ static ir_entity *create_ent(int value, const char *name)
set_entity_allocation(ent, allocation_static);
cnst_irg = get_const_code_irg();
cnst = new_r_Const(cnst_irg, get_irg_start_block(cnst_irg), mode, tv);
cnst = new_r_Const(cnst_irg, mode, tv);
set_atomic_ent_value(ent, cnst);
return ent;
......
......@@ -191,7 +191,7 @@ static int map_Shl(ir_node *call, void *ctx) {
need to reduce the constant here, this is done by the hardware. */
ir_node *conv = new_rd_Conv(dbg, irg, block, a_l, h_mode);
h_res = new_rd_Shl(dbg, irg, block, conv, cnt, h_mode);
l_res = new_rd_Const(dbg, irg, block, l_mode, get_mode_null(l_mode));
l_res = new_rd_Const(dbg, irg, l_mode, get_mode_null(l_mode));
} else {
/* h_res = SHLD a_h, a_l, cnt */
......@@ -215,9 +215,9 @@ static int map_Shl(ir_node *call, void *ctx) {
l1 = new_bd_ia32_l_ShlDep(dbg, upper, a_l, cnt, h1, l_mode);
c_mode = get_irn_mode(cnt);
irn = new_r_Const_long(irg, upper, c_mode, 32);
irn = new_r_Const_long(irg, c_mode, 32);
irn = new_rd_And(dbg, irg, upper, cnt, irn, c_mode);
irn = new_rd_Cmp(dbg, irg, upper, irn, new_r_Const(irg, upper, c_mode, get_mode_null(c_mode)));
irn = new_rd_Cmp(dbg, irg, upper, irn, new_r_Const(irg, c_mode, get_mode_null(c_mode)));
irn = new_r_Proj(irg, upper, irn, mode_b, pn_Cmp_Eq);
cond = new_rd_Cond(dbg, irg, upper, irn);
......@@ -227,7 +227,7 @@ static int map_Shl(ir_node *call, void *ctx) {
/* the block for cnt >= 32 */
n_block = new_rd_Block(dbg, irg, 1, &in[1]);
h2 = new_rd_Conv(dbg, irg, n_block, l1, h_mode);
l2 = new_r_Const(irg, n_block, l_mode, get_mode_null(l_mode));
l2 = new_r_Const(irg, l_mode, get_mode_null(l_mode));
in[1] = new_r_Jmp(irg, n_block);
set_irn_in(block, 2, in);
......@@ -278,7 +278,7 @@ static int map_Shr(ir_node *call, void *ctx) {
/* simplest case: shift only the higher bits. Note that there is no
need to reduce the constant here, this is done by the hardware. */
ir_node *conv = new_rd_Conv(dbg, irg, block, a_h, l_mode);
h_res = new_rd_Const(dbg, irg, block, h_mode, get_mode_null(h_mode));
h_res = new_rd_Const(dbg, irg, h_mode, get_mode_null(h_mode));
l_res = new_rd_Shr(dbg, irg, block, conv, cnt, l_mode);
} else {
/* l_res = SHRD a_h:a_l, cnt */
......@@ -301,9 +301,9 @@ static int map_Shr(ir_node *call, void *ctx) {
h1 = new_bd_ia32_l_ShrDep(dbg, upper, a_h, cnt, l1, h_mode);
c_mode = get_irn_mode(cnt);
irn = new_r_Const_long(irg, upper, c_mode, 32);
irn = new_r_Const_long(irg, c_mode, 32);
irn = new_rd_And(dbg, irg, upper, cnt, irn, c_mode);
irn = new_rd_Cmp(dbg, irg, upper, irn, new_r_Const(irg, upper, c_mode, get_mode_null(c_mode)));
irn = new_rd_Cmp(dbg, irg, upper, irn, new_r_Const(irg, c_mode, get_mode_null(c_mode)));
irn = new_r_Proj(irg, upper, irn, mode_b, pn_Cmp_Eq);
cond = new_rd_Cond(dbg, irg, upper, irn);
......@@ -313,7 +313,7 @@ static int map_Shr(ir_node *call, void *ctx) {
/* the block for cnt >= 32 */
n_block = new_rd_Block(dbg, irg, 1, &in[1]);
l2 = new_rd_Conv(dbg, irg, n_block, h1, l_mode);
h2 = new_r_Const(irg, n_block, h_mode, get_mode_null(h_mode));
h2 = new_r_Const(irg, h_mode, get_mode_null(h_mode));
in[1] = new_r_Jmp(irg, n_block);
set_irn_in(block, 2, in);
......@@ -366,7 +366,7 @@ static int map_Shrs(ir_node *call, void *ctx) {
ir_node *conv = new_rd_Conv(dbg, irg, block, a_h, l_mode);
ir_mode *c_mode = get_irn_mode(cnt);
h_res = new_rd_Shrs(dbg, irg, block, a_h, new_r_Const_long(irg, block, c_mode, 31), h_mode);
h_res = new_rd_Shrs(dbg, irg, block, a_h, new_r_Const_long(irg, c_mode, 31), h_mode);
l_res = new_rd_Shrs(dbg, irg, block, conv, cnt, l_mode);
} else {
/* l_res = SHRD a_h:a_l, cnt */
......@@ -389,9 +389,9 @@ static int map_Shrs(ir_node *call, void *ctx) {
h1 = new_bd_ia32_l_SarDep(dbg, upper, a_h, cnt, l1, h_mode);
c_mode = get_irn_mode(cnt);
irn = new_r_Const_long(irg, upper, c_mode, 32);
irn = new_r_Const_long(irg, c_mode, 32);
irn = new_rd_And(dbg, irg, upper, cnt, irn, c_mode);
irn = new_rd_Cmp(dbg, irg, upper, irn, new_r_Const(irg, upper, c_mode, get_mode_null(c_mode)));
irn = new_rd_Cmp(dbg, irg, upper, irn, new_r_Const(irg, c_mode, get_mode_null(c_mode)));
irn = new_r_Proj(irg, upper, irn, mode_b, pn_Cmp_Eq);
cond = new_rd_Cond(dbg, irg, upper, irn);
......@@ -401,7 +401,7 @@ static int map_Shrs(ir_node *call, void *ctx) {
/* the block for cnt >= 32 */
n_block = new_rd_Block(dbg, irg, 1, &in[1]);
l2 = new_rd_Conv(dbg, irg, n_block, h1, l_mode);
h2 = new_rd_Shrs(dbg, irg, n_block, a_h, new_r_Const_long(irg, block, c_mode, 31), h_mode);
h2 = new_rd_Shrs(dbg, irg, n_block, a_h, new_r_Const_long(irg, c_mode, 31), h_mode);
in[1] = new_r_Jmp(irg, n_block);
set_irn_in(block, 2, in);
......
......@@ -448,12 +448,12 @@ static ir_node *build_graph(mul_env *env, instruction *inst) {
case LEA:
l = build_graph(env, inst->in[0]);
r = build_graph(env, inst->in[1]);
c = new_r_Const(current_ir_graph, env->blk, env->shf_mode, new_tarval_from_long(inst->shift_count, env->shf_mode));
c = new_r_Const(current_ir_graph, env->shf_mode, new_tarval_from_long(inst->shift_count, env->shf_mode));
r = new_rd_Shl(env->dbg, current_ir_graph, env->blk, r, c, env->mode);
return inst->irn = new_rd_Add(env->dbg, current_ir_graph, env->blk, l, r, env->mode);
case SHIFT:
l = build_graph(env, inst->in[0]);
c = new_r_Const(current_ir_graph, env->blk, env->shf_mode, new_tarval_from_long(inst->shift_count, env->shf_mode));
c = new_r_Const(current_ir_graph, env->shf_mode, new_tarval_from_long(inst->shift_count, env->shf_mode));
return inst->irn = new_rd_Shl(env->dbg, current_ir_graph, env->blk, l, c, env->mode);
case SUB:
l = build_graph(env, inst->in[0]);
......@@ -464,7 +464,7 @@ static ir_node *build_graph(mul_env *env, instruction *inst) {
r = build_graph(env, inst->in[1]);
return inst->irn = new_rd_Add(env->dbg, current_ir_graph, env->blk, l, r, env->mode);
case ZERO:
return inst->irn = new_r_Const(current_ir_graph, env->blk, env->mode, get_mode_null(env->mode));
return inst->irn = new_r_Const(current_ir_graph, env->mode, get_mode_null(env->mode));
default:
panic("Unsupported instruction kind");
return NULL;
......@@ -822,7 +822,7 @@ static ir_node *replace_div_by_mulh(ir_node *div, tarval *tv) {
struct ms mag = magic(tv);
/* generate the Mulh instruction */
c = new_r_Const(current_ir_graph, block, mode, mag.M);
c = new_r_Const(current_ir_graph, mode, mag.M);
q = new_rd_Mulh(dbg, current_ir_graph, block, n, c, mode);
/* do we need an Add or Sub */
......@@ -833,12 +833,12 @@ static ir_node *replace_div_by_mulh(ir_node *div, tarval *tv) {
/* Do we need the shift */
if (mag.s > 0) {
c = new_r_Const_long(current_ir_graph, block, mode_Iu, mag.s);
c = new_r_Const_long(current_ir_graph, mode_Iu, mag.s);
q = new_rd_Shrs(dbg, current_ir_graph, block, q, c, mode);
}
/* final */
c = new_r_Const_long(current_ir_graph, block, mode_Iu, bits-1);
c = new_r_Const_long(current_ir_graph, mode_Iu, bits-1);
t = new_rd_Shr(dbg, current_ir_graph, block, q, c, mode);
q = new_rd_Add(dbg, current_ir_graph, block, q, t, mode);
......@@ -847,7 +847,7 @@ static ir_node *replace_div_by_mulh(ir_node *div, tarval *tv) {
ir_node *c;
/* generate the Mulh instruction */
c = new_r_Const(current_ir_graph, block, mode, mag.M);
c = new_r_Const(current_ir_graph, mode, mag.M);
q = new_rd_Mulh(dbg, current_ir_graph, block, n, c, mode);
if (mag.need_add) {
......@@ -855,19 +855,19 @@ static ir_node *replace_div_by_mulh(ir_node *div, tarval *tv) {
/* use the GM scheme */
t = new_rd_Sub(dbg, current_ir_graph, block, n, q, mode);
c = new_r_Const(current_ir_graph, block, mode_Iu, get_mode_one(mode_Iu));
c = new_r_Const(current_ir_graph, mode_Iu, get_mode_one(mode_Iu));
t = new_rd_Shr(dbg, current_ir_graph, block, t, c, mode);
t = new_rd_Add(dbg, current_ir_graph, block, t, q, mode);
c = new_r_Const_long(current_ir_graph, block, mode_Iu, mag.s-1);
c = new_r_Const_long(current_ir_graph, mode_Iu, mag.s-1);
q = new_rd_Shr(dbg, current_ir_graph, block, t, c, mode);
} else {
/* use the default scheme */
q = new_rd_Add(dbg, current_ir_graph, block, q, n, mode);
}
} else if (mag.s > 0) { /* default scheme, shift needed */
c = new_r_Const_long(current_ir_graph, block, mode_Iu, mag.s);
c = new_r_Const_long(current_ir_graph, mode_Iu, mag.s);
q = new_rd_Shr(dbg, current_ir_graph, block, q, c, mode);
}
}
......@@ -930,11 +930,11 @@ ir_node *arch_dep_replace_div_by_const(ir_node *irn) {
/* create the correction code for signed values only if there might be a remainder */
if (! is_Div_remainderless(irn)) {
if (k != 1) {
k_node = new_r_Const_long(current_ir_graph, block, mode_Iu, k - 1);
k_node = new_r_Const_long(current_ir_graph, mode_Iu, k - 1);
curr = new_rd_Shrs(dbg, current_ir_graph, block, left, k_node, mode);
}
k_node = new_r_Const_long(current_ir_graph, block, mode_Iu, bits - k);
k_node = new_r_Const_long(current_ir_graph, mode_Iu, bits - k);
curr = new_rd_Shr(dbg, current_ir_graph, block, curr, k_node, mode);
curr = new_rd_Add(dbg, current_ir_graph, block, left, curr, mode);
......@@ -942,19 +942,19 @@ ir_node *arch_dep_replace_div_by_const(ir_node *irn) {
k_node = left;
}
k_node = new_r_Const_long(current_ir_graph, block, mode_Iu, k);
k_node = new_r_Const_long(current_ir_graph, mode_Iu, k);
res = new_rd_Shrs(dbg, current_ir_graph, block, curr, k_node, mode);
if (n_flag) { /* negate the result */
ir_node *k_node;
k_node = new_r_Const(current_ir_graph, block, mode, get_mode_null(mode));
k_node = new_r_Const(current_ir_graph, mode, get_mode_null(mode));
res = new_rd_Sub(dbg, current_ir_graph, block, k_node, res, mode);
}
} else { /* unsigned case */
ir_node *k_node;
k_node = new_r_Const_long(current_ir_graph, block, mode_Iu, k);
k_node = new_r_Const_long(current_ir_graph, mode_Iu, k);
res = new_rd_Shr(dbg, current_ir_graph, block, left, k_node, mode);
}
} else {
......@@ -1024,23 +1024,23 @@ ir_node *arch_dep_replace_mod_by_const(ir_node *irn) {
ir_node *curr = left;
if (k != 1) {
k_node = new_r_Const_long(current_ir_graph, block, mode_Iu, k - 1);
k_node = new_r_Const_long(current_ir_graph, mode_Iu, k - 1);
curr = new_rd_Shrs(dbg, current_ir_graph, block, left, k_node, mode);
}
k_node = new_r_Const_long(current_ir_graph, block, mode_Iu, bits - k);
k_node = new_r_Const_long(current_ir_graph, mode_Iu, bits - k);
curr = new_rd_Shr(dbg, current_ir_graph, block, curr, k_node, mode);
curr = new_rd_Add(dbg, current_ir_graph, block, left, curr, mode);
k_node = new_r_Const_long(current_ir_graph, block, mode, (-1) << k);
k_node = new_r_Const_long(current_ir_graph, mode, (-1) << k);
curr = new_rd_And(dbg, current_ir_graph, block, curr, k_node, mode);
res = new_rd_Sub(dbg, current_ir_graph, block, left, curr, mode);
} else { /* unsigned case */
ir_node *k_node;
k_node = new_r_Const_long(current_ir_graph, block, mode, (1 << k) - 1);
k_node = new_r_Const_long(current_ir_graph, mode, (1 << k) - 1);
res = new_rd_And(dbg, current_ir_graph, block, left, k_node, mode);
}
} else {
......@@ -1118,37 +1118,37 @@ void arch_dep_replace_divmod_by_const(ir_node **div, ir_node **mod, ir_node *irn
ir_node *curr = left;
if (k != 1) {
k_node = new_r_Const_long(current_ir_graph, block, mode_Iu, k - 1);
k_node = new_r_Const_long(current_ir_graph, mode_Iu, k - 1);
curr = new_rd_Shrs(dbg, current_ir_graph, block, left, k_node, mode);
}
k_node = new_r_Const_long(current_ir_graph, block, mode_Iu, bits - k);
k_node = new_r_Const_long(current_ir_graph, mode_Iu, bits - k);
curr = new_rd_Shr(dbg, current_ir_graph, block, curr, k_node, mode);
curr = new_rd_Add(dbg, current_ir_graph, block, left, curr, mode);
c_k = new_r_Const_long(current_ir_graph, block, mode_Iu, k);
c_k = new_r_Const_long(current_ir_graph, mode_Iu, k);
*div = new_rd_Shrs(dbg, current_ir_graph, block, curr, c_k, mode);
if (n_flag) { /* negate the div result */
ir_node *k_node;
k_node = new_r_Const(current_ir_graph, block, mode, get_mode_null(mode));
k_node = new_r_Const(current_ir_graph, mode, get_mode_null(mode));
*div = new_rd_Sub(dbg, current_ir_graph, block, k_node, *div, mode);
}
k_node = new_r_Const_long(current_ir_graph, block, mode, (-1) << k);
k_node = new_r_Const_long(current_ir_graph, mode, (-1) << k);
curr = new_rd_And(dbg, current_ir_graph, block, curr, k_node, mode);
*mod = new_rd_Sub(dbg, current_ir_graph, block, left, curr, mode);
} else { /* unsigned case */
ir_node *k_node;
k_node = new_r_Const_long(current_ir_graph, block, mode_Iu, k);
k_node = new_r_Const_long(current_ir_graph, mode_Iu, k);
*div = new_rd_Shr(dbg, current_ir_graph, block, left, k_node, mode);
k_node = new_r_Const_long(current_ir_graph, block, mode, (1 << k) - 1);
k_node = new_r_Const_long(current_ir_graph, mode, (1 << k) - 1);
*mod = new_rd_And(dbg, current_ir_graph, block, left, k_node, mode);
}
} else {
......
......@@ -257,10 +257,9 @@ new_bd_Phi(dbg_info *db, ir_node *block, int arity, ir_node **in, ir_mode *mode)
} /* new_bd_Phi */
static ir_node *
new_bd_Const_type(dbg_info *db, ir_node *block, ir_mode *mode, tarval *con, ir_type *tp) {
new_bd_Const_type(dbg_info *db, ir_mode *mode, tarval *con, ir_type *tp) {
ir_node *res;
ir_graph *irg = current_ir_graph;
(void) block;
res = new_ir_node(db, irg, get_irg_start_block(irg), op_Const, mode, 0, NULL);
res->attr.con.tv = con;
......@@ -273,17 +272,17 @@ new_bd_Const_type(dbg_info *db, ir_node *block, ir_mode *mode, tarval *con, ir_t
} /* new_bd_Const_type */
static ir_node *
new_bd_Const(dbg_info *db, ir_node *block, ir_mode *mode, tarval *con) {
new_bd_Const(dbg_info *db, ir_mode *mode, tarval *con) {
ir_graph *irg = current_ir_graph;
return new_rd_Const_type (db, irg, block, mode, con, firm_unknown_type);
return new_rd_Const_type (db, irg, mode, con, firm_unknown_type);
} /* new_bd_Const */
static ir_node *
new_bd_Const_long(dbg_info *db, ir_node *block, ir_mode *mode, long value) {
new_bd_Const_long(dbg_info *db, ir_mode *mode, long value) {
ir_graph *irg = current_ir_graph;
return new_rd_Const(db, irg, block, mode, new_tarval_from_long(value, mode));
return new_rd_Const(db, irg, mode, new_tarval_from_long(value, mode));
} /* new_bd_Const_long */
static ir_node *
......@@ -895,32 +894,32 @@ new_rd_Phi(dbg_info *db, ir_graph *irg, ir_node *block, int arity, ir_node **in,
} /* new_rd_Phi */
ir_node *
new_rd_Const_type(dbg_info *db, ir_graph *irg, ir_node *block, ir_mode *mode, tarval *con, ir_type *tp) {
new_rd_Const_type(dbg_info *db, ir_graph *irg, ir_mode *mode, tarval *con, ir_type *tp) {
ir_node *res;
ir_graph *rem = current_ir_graph;
current_ir_graph = irg;
res = new_bd_Const_type(db, block, mode, con, tp);
res = new_bd_Const_type(db, mode, con, tp);
current_ir_graph = rem;
return res;
} /* new_rd_Const_type */
ir_node *
new_rd_Const(dbg_info *db, ir_graph *irg, ir_node *block, ir_mode *mode, tarval *con) {
new_rd_Const(dbg_info *db, ir_graph *irg, ir_mode *mode, tarval *con) {
ir_node *res;
ir_graph *rem = current_ir_graph;
current_ir_graph = irg;
res = new_bd_Const_type(db, block, mode, con, firm_unknown_type);
res = new_bd_Const_type(db, mode, con, firm_unknown_type);
current_ir_graph = rem;
return res;
} /* new_rd_Const */
ir_node *
new_rd_Const_long(dbg_info *db, ir_graph *irg, ir_node *block, ir_mode *mode, long value) {
return new_rd_Const(db, irg, block, mode, new_tarval_from_long(value, mode));
new_rd_Const_long(dbg_info *db, ir_graph *irg, ir_mode *mode, long value) {
return new_rd_Const(db, irg, mode, new_tarval_from_long(value, mode));
} /* new_rd_Const_long */
ir_node *
......@@ -1445,17 +1444,15 @@ ir_node *new_r_Return(ir_graph *irg, ir_node *block,
ir_node *store, int arity, ir_node **in) {
return new_rd_Return(NULL, irg, block, store, arity, in);
}
ir_node *new_r_Const(ir_graph *irg, ir_node *block,
ir_mode *mode, tarval *con) {
return new_rd_Const(NULL, irg, block, mode, con);
ir_node *new_r_Const(ir_graph *irg, ir_mode *mode, tarval *con) {
return new_rd_Const(NULL, irg, mode, con);
}
ir_node *new_r_Const_long(ir_graph *irg, ir_node *block,
ir_mode *mode, long value) {
return new_rd_Const_long(NULL, irg, block, mode, value);
ir_node *new_r_Const_long(ir_graph *irg, ir_mode *mode, long value) {
return new_rd_Const_long(NULL, irg, mode, value);
}
ir_node *new_r_Const_type(ir_graph *irg, ir_node *block,
ir_node *new_r_Const_type(ir_graph *irg,
ir_mode *mode, tarval *con, ir_type *tp) {
return new_rd_Const_type(NULL, irg, block, mode, con, tp);
return new_rd_Const_type(NULL, irg, mode, con, tp);
}
ir_node *new_r_SymConst(ir_graph *irg, ir_node *block, ir_mode *mode,
symconst_symbol value, symconst_kind symkind) {
......@@ -2260,17 +2257,17 @@ new_d_Phi(dbg_info *db, int arity, ir_node **in, ir_mode *mode) {
ir_node *
new_d_Const(dbg_info *db, ir_mode *mode, tarval *con) {
return new_bd_Const(db, get_irg_start_block(current_ir_graph), mode, con);
return new_bd_Const(db, mode, con);
} /* new_d_Const */
ir_node *
new_d_Const_long(dbg_info *db, ir_mode *mode, long value) {
return new_bd_Const_long(db, get_irg_start_block(current_ir_graph), mode, value);
return new_bd_Const_long(db, mode, value);
} /* new_d_Const_long */
ir_node *
new_d_Const_type(dbg_info *db, ir_mode *mode, tarval *con, ir_type *tp) {
return new_bd_Const_type(db, get_irg_start_block(current_ir_graph), mode, con, tp);
return new_bd_Const_type(db, mode, con, tp);
} /* new_d_Const_type */
......
......@@ -1984,8 +1984,7 @@ static ir_node *apply_binop_on_phi(ir_node *phi, tarval *other, tarval *(*eval)(
irg = current_ir_graph;
for (i = 0; i < n; ++i) {
pred = get_irn_n(phi, i);
res[i] = new_r_Const_type(irg, get_irg_start_block(irg),
mode, res[i], get_Const_type(pred));
res[i] = new_r_Const_type(irg, mode, res[i], get_Const_type(pred));
}
return new_r_Phi(irg, get_nodes_block(phi), n, (ir_node **)res, mode);
} /* apply_binop_on_phi */
......@@ -2029,7 +2028,7 @@ static ir_node *apply_binop_on_2_phis(ir_node *a, ir_node *b, tarval *(*eval)(),
irg = current_ir_graph;
for (i = 0; i < n; ++i) {
pred = get_irn_n(a, i);
res[i] = new_r_Const_type(irg, get_irg_start_block(irg), mode, res[i], get_Const_type(pred));
res[i] = new_r_Const_type(irg, mode, res[i], get_Const_type(pred));
}
return new_r_Phi(irg, get_nodes_block(a), n, (ir_node **)res, mode);
} /* apply_binop_on_2_phis */
......@@ -2066,8 +2065,7 @@ static ir_node *apply_unop_on_phi(ir_node *phi, tarval *(*eval)(tarval *)) {
irg = current_ir_graph;
for (i = 0; i < n; ++i) {
pred = get_irn_n(phi, i);
res[i] = new_r_Const_type(irg, get_irg_start_block(irg),
mode, res[i], get_Const_type(pred));
res[i] = new_r_Const_type(irg, mode, res[i], get_Const_type(pred));
}
return new_r_Phi(irg, get_nodes_block(phi), n, (ir_node **)res, mode);
} /* apply_unop_on_phi */
......@@ -2101,8 +2099,7 @@ static ir_node *apply_conv_on_phi(ir_node *phi, ir_mode *mode) {
irg = current_ir_graph;
for (i = 0; i < n; ++i) {
pred = get_irn_n(phi, i);
res[i] = new_r_Const_type(irg, get_irg_start_block(irg),
mode, res[i], get_Const_type(pred));
res[i] = new_r_Const_type(irg, mode, res[i], get_Const_type(pred));
}
return new_r_Phi(irg, get_nodes_block(phi), n, (ir_node **)res, mode);
} /* apply_conv_on_phi */
......@@ -2259,7 +2256,7 @@ static ir_node *transform_node_Add(ir_node *n) {
current_ir_graph,
block,
a,