summaryrefslogtreecommitdiffhomepage
path: root/ir/common
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2014-02-13 16:38:46 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2014-02-17 14:11:15 +0100
commit0ea8b7276a18cf5cdaa89cf6b054faa60086f9a0 (patch)
tree01d0462aed83d8b63097e7091b1feafde5f683b1 /ir/common
parentcc281f880e6e186609e3c0222dca4dfca968f1f6 (diff)
Add and use foreach_irn_pred{,_r}().
Diffstat (limited to 'ir/common')
-rw-r--r--ir/common/irtools.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ir/common/irtools.c b/ir/common/irtools.c
index f3aa27d..5e4837f 100644
--- a/ir/common/irtools.c
+++ b/ir/common/irtools.c
@@ -123,8 +123,7 @@ ir_node *irn_copy_into_irg(const ir_node *node, ir_graph *irg)
ir_node *res;
if (op->opar == oparity_dynamic) {
res = new_ir_node(dbgi, irg, block, op, mode, -1, NULL);
- for (int i = 0, arity = get_irn_arity(node); i < arity; ++i) {
- ir_node *in = get_irn_n(node, i);
+ foreach_irn_in(node, i, in) {
add_irn_n(res, in);
}
} else {
@@ -168,8 +167,7 @@ void irn_rewire_inputs(ir_node *node)
set_nodes_block(new_node, new_block);
}
- for (int i = 0, arity = get_irn_arity(new_node); i < arity; ++i) {
- ir_node *in = get_irn_n(node, i);
+ foreach_irn_in(node, i, in) {
ir_node *new_in = get_new_node(in);
set_irn_n(new_node, i, new_in);
}