summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bespill.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/bespill.c
parentcc281f880e6e186609e3c0222dca4dfca968f1f6 (diff)
Add and use foreach_irn_pred{,_r}().
Diffstat (limited to 'ir/be/bespill.c')
-rw-r--r--ir/be/bespill.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ir/be/bespill.c b/ir/be/bespill.c
index b95e971..88ee31e 100644
--- a/ir/be/bespill.c
+++ b/ir/be/bespill.c
@@ -51,13 +51,11 @@ static void prepare_constr_insn(be_pre_spill_env_t *env, ir_node *node)
* (typical example: stack pointer as input to copyb)
* TODO: This really just checks precolored registers at the moment and
* ignores the general case of not matching in/out constraints */
- int const arity = get_irn_arity(node);
- for (int i = 0; i < arity; ++i) {
+ foreach_irn_in(node, i, op) {
const arch_register_req_t *req = arch_get_irn_register_req_in(node, i);
if (req->cls != cls)
continue;
- ir_node *op = get_irn_n(node, i);
const arch_register_t *reg = arch_get_irn_register(op);
if (reg == NULL)
continue;
@@ -81,6 +79,7 @@ static void prepare_constr_insn(be_pre_spill_env_t *env, ir_node *node)
}
/* insert copies for nodes that occur constrained more than once. */
+ int const arity = get_irn_arity(node);
be_foreach_use(node, cls, req, in, in_req_,
if (!arch_register_req_is(req, limited))
continue;