Commit 9c03c9cb authored by Christoph Mallon's avatar Christoph Mallon
Browse files

s/get_irn_n(irn, -1)/get_nodes_block(irn)/.

parent 0572df8d
......@@ -830,7 +830,7 @@ static ir_node *replace_div_by_mulh(ir_node *div, ir_tarval *tv)
{
dbg_info *dbg = get_irn_dbg_info(div);
ir_node *n = get_binop_left(div);
ir_node *block = get_irn_n(div, -1);
ir_node *block = get_nodes_block(div);
ir_mode *mode = get_irn_mode(n);
int bits = get_mode_size_bits(mode);
ir_node *q;
......@@ -936,7 +936,7 @@ ir_node *arch_dep_replace_div_by_const(ir_node *irn)
if (!mode_is_int(mode))
return irn;
block = get_irn_n(irn, -1);
block = get_nodes_block(irn);
dbg = get_irn_dbg_info(irn);
bits = get_mode_size_bits(mode);
......@@ -1039,7 +1039,7 @@ ir_node *arch_dep_replace_mod_by_const(ir_node *irn)
left = get_Mod_left(irn);
mode = get_irn_mode(left);
block = get_irn_n(irn, -1);
block = get_nodes_block(irn);
dbg = get_irn_dbg_info(irn);
bits = get_mode_size_bits(mode);
n = (bits + 7) / 8;
......
......@@ -1139,7 +1139,7 @@ static void print_data_edge_vcgattr(FILE *F, const ir_node *from, int to)
* do not use get_nodes_block() here, will fail
* if the irg is not pinned.
*/
if (get_irn_n(from, -1) == get_irn_n(get_irn_n(from, to), -1))
if (get_nodes_block(from) == get_nodes_block(get_irn_n(from, to)))
fprintf(F, INTRA_DATA_EDGE_ATTR);
else
fprintf(F, INTER_DATA_EDGE_ATTR);
......@@ -1151,7 +1151,7 @@ static void print_mem_edge_vcgattr(FILE *F, const ir_node *from, int to)
* do not use get_nodes_block() here, will fail
* if the irg is not pinned.
*/
if (get_irn_n(from, -1) == get_irn_n(get_irn_n(from, to), -1))
if (get_nodes_block(from) == get_nodes_block(get_irn_n(from, to)))
fprintf(F, INTRA_MEM_EDGE_ATTR);
else
fprintf(F, INTER_MEM_EDGE_ATTR);
......
......@@ -76,8 +76,9 @@ void dump_irnode_to_file(FILE *F, const ir_node *n)
if (get_irn_pinned(n) == op_pin_state_floats &&
get_irg_pinned(get_irn_irg(n)) == op_pin_state_floats) {
fprintf(F, " node was pinned in ");
dump_node_opcode(F, get_irn_n(n, -1));
fprintf(F, " %ld\n", get_irn_node_nr(get_irn_n(n, -1)));
ir_node *const block = get_nodes_block(n);
dump_node_opcode(F, block);
fprintf(F, " %ld\n", get_irn_node_nr(block));
}
fprintf(F, " arity: %d\n", get_irn_arity(n));
......@@ -85,8 +86,9 @@ void dump_irnode_to_file(FILE *F, const ir_node *n)
fprintf(F, " pred nodes:\n");
if (!is_Block(n)) {
fprintf(F, " -1: ");
dump_node_opcode(F, get_irn_n(n, -1));
fprintf(F, " %ld\n", get_irn_node_nr(get_irn_n(n, -1)));
ir_node *const block = get_nodes_block(n);
dump_node_opcode(F, block);
fprintf(F, " %ld\n", get_irn_node_nr(block));
}
{
......
......@@ -58,7 +58,7 @@ static unsigned irg_walk_2_pre(ir_node *node, irg_walk_func *pre, void *env)
pre(node, env);
if (node->op != op_Block) {
ir_node *pred = get_irn_n(node, -1);
ir_node *pred = get_nodes_block(node);
if (pred->visited < irg->visited)
cnt += irg_walk_2_pre(pred, pre, env);
}
......@@ -84,7 +84,7 @@ static unsigned irg_walk_2_post(ir_node *node, irg_walk_func *post, void *env)
set_irn_visited(node, irg->visited);
if (node->op != op_Block) {
ir_node *pred = get_irn_n(node, -1);
ir_node *pred = get_nodes_block(node);
if (pred->visited < irg->visited)
cnt += irg_walk_2_post(pred, post, env);
}
......@@ -116,7 +116,7 @@ static unsigned irg_walk_2_both(ir_node *node, irg_walk_func *pre,
pre(node, env);
if (node->op != op_Block) {
ir_node *pred = get_irn_n(node, -1);
ir_node *pred = get_nodes_block(node);
if (pred->visited < irg->visited)
cnt += irg_walk_2_both(pred, pre, post, env);
}
......@@ -204,7 +204,7 @@ static unsigned irg_walk_in_or_dep_2_pre(ir_node *node, irg_walk_func *pre, void
pre(node, env);
if (node->op != op_Block) {
ir_node *pred = get_irn_n(node, -1);
ir_node *pred = get_nodes_block(node);
if (pred->visited < irg->visited)
cnt += irg_walk_in_or_dep_2_pre(pred, pre, env);
}
......@@ -230,7 +230,7 @@ static unsigned irg_walk_in_or_dep_2_post(ir_node *node, irg_walk_func *post, vo
set_irn_visited(node, irg->visited);
if (node->op != op_Block) {
ir_node *pred = get_irn_n(node, -1);
ir_node *pred = get_nodes_block(node);
if (pred->visited < irg->visited)
cnt += irg_walk_in_or_dep_2_post(pred, post, env);
}
......@@ -261,7 +261,7 @@ static unsigned irg_walk_in_or_dep_2_both(ir_node *node, irg_walk_func *pre, irg
pre(node, env);
if (node->op != op_Block) {
ir_node *pred = get_irn_n(node, -1);
ir_node *pred = get_nodes_block(node);
if (pred->visited < irg->visited)
cnt += irg_walk_in_or_dep_2_both(pred, pre, post, env);
}
......
......@@ -2046,7 +2046,7 @@ static ir_node *transform_node_Or_bf_store(ir_node *irn_or)
}
/* ok, all conditions met */
block = get_irn_n(irn_or, -1);
block = get_nodes_block(irn_or);
irg = get_irn_irg(block);
new_and = new_r_And(block, value, new_r_Const(irg, tarval_and(tv4, tv2)), mode);
......@@ -3092,7 +3092,7 @@ static ir_node *transform_node_Mul2n(ir_node *n, ir_mode *mode)
}
if (tb == get_mode_one(smode)) {
/* (L)a * (L)1 = (L)a */
ir_node *blk = get_irn_n(a, -1);
ir_node *blk = get_nodes_block(a);
n = new_rd_Conv(get_irn_dbg_info(n), blk, a, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_NEUTRAL_1);
return n;
......@@ -4112,7 +4112,7 @@ static ir_node *transform_node_Proj_Mod(ir_node *proj)
switch (proj_nr) {
case pn_Mod_X_regular:
return new_r_Jmp(get_irn_n(mod, -1));
return new_r_Jmp(get_nodes_block(mod));
case pn_Mod_X_except: {
ir_graph *irg = get_irn_irg(proj);
......@@ -4905,7 +4905,7 @@ is_bittest: {
if (tarval_is_single_bit(tv)) {
/* special case: (x % 2^n) CMP 0 ==> x & (2^n-1) CMP 0 */
ir_node *v = get_binop_left(op);
ir_node *blk = get_irn_n(op, -1);
ir_node *blk = get_nodes_block(op);
ir_graph *irg = get_irn_irg(op);
ir_mode *mode = get_irn_mode(v);
......@@ -6454,7 +6454,7 @@ int identities_cmp(const void *elt, const void *key)
if (get_irn_pinned(a) == op_pin_state_pinned) {
/* for pinned nodes, the block inputs must be equal */
if (get_irn_n(a, -1) != get_irn_n(b, -1))
if (get_nodes_block(a) != get_nodes_block(b))
return 1;
} else {
ir_node *block_a = get_nodes_block(a);
......
Supports Markdown
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