summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bestate.c
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/be/bestate.c
parentcc281f880e6e186609e3c0222dca4dfca968f1f6 (diff)
Add and use foreach_irn_pred{,_r}().
Diffstat (limited to 'ir/be/bestate.c')
-rw-r--r--ir/be/bestate.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ir/be/bestate.c b/ir/be/bestate.c
index a230f52..15ab7b8 100644
--- a/ir/be/bestate.c
+++ b/ir/be/bestate.c
@@ -168,8 +168,7 @@ static void spill_phi(minibelady_env_t *env, ir_node *phi)
}
/* create spills for the phi values */
- for (int i = 0; i < arity; ++i) {
- ir_node *in = get_irn_n(phi, i);
+ foreach_irn_in(phi, i, in) {
spill_info_t *pred_spill = create_spill(env, in, true);
set_irn_n(spill_info->spill, i, pred_spill->spill);
}
@@ -345,8 +344,7 @@ static void belady(minibelady_env_t *env, ir_node *block)
/* check which state is desired for the node */
ir_node *need_val = 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) {
const arch_register_t *reg = arch_get_irn_register(in);
if (reg == env->reg) {
assert(need_val == NULL);