summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bearch.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/bearch.c
parentcc281f880e6e186609e3c0222dca4dfca968f1f6 (diff)
Add and use foreach_irn_pred{,_r}().
Diffstat (limited to 'ir/be/bearch.c')
-rw-r--r--ir/be/bearch.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ir/be/bearch.c b/ir/be/bearch.c
index 208c00c..1fca869 100644
--- a/ir/be/bearch.c
+++ b/ir/be/bearch.c
@@ -216,19 +216,17 @@ static void arch_dump_register_req(FILE *const F, arch_register_req_t const *con
void arch_dump_reqs_and_registers(FILE *F, const ir_node *node)
{
- backend_info_t *const info = be_get_info(node);
- int const n_ins = get_irn_arity(node);
+ backend_info_t *const info = be_get_info(node);
/* don't fail on invalid graphs */
- if (!info || (!info->in_reqs && n_ins != 0) || !info->out_infos) {
+ if (!info || (!info->in_reqs && get_irn_arity(node) != 0) || !info->out_infos) {
fprintf(F, "invalid register requirements!!!\n");
return;
}
- for (int i = 0; i < n_ins; ++i) {
+ foreach_irn_in(node, i, op) {
const arch_register_req_t *req = arch_get_irn_register_req_in(node, i);
fprintf(F, "inreq #%d = ", i);
arch_dump_register_req(F, req);
- ir_node *const op = get_irn_n(node, i);
arch_register_t const *const reg = be_get_info(skip_Proj_const(op))->out_infos ? arch_get_irn_register(op) : NULL;
fprintf(F, " [%s]\n", reg ? reg->name : "n/a");
}