summaryrefslogtreecommitdiffhomepage
path: root/ir/be/betranshlp.c
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2014-11-17 07:23:18 +0100
committerChristoph Mallon <mallon@cs.uni-saarland.de>2014-11-19 10:36:31 +0100
commit27ce51017d1628b575f36db454ecf48f0faa5434 (patch)
tree01c1af250b675267c1f6ec72995b59bde07069a1 /ir/be/betranshlp.c
parent91dab317de5222fccbf986a310245cca9067e531 (diff)
ir: Let get_irg_anchor() just return the anchor instead of its operands.
This also renders get_irg_n_anchors() obsolete, so remove it.
Diffstat (limited to 'ir/be/betranshlp.c')
-rw-r--r--ir/be/betranshlp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ir/be/betranshlp.c b/ir/be/betranshlp.c
index 3f8ba8a..0a4c0b6 100644
--- a/ir/be/betranshlp.c
+++ b/ir/be/betranshlp.c
@@ -314,9 +314,8 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform)
/* Pre-transform all anchors (so they are available in the other transform
* functions) and put them into the worklist. */
- for (size_t i = 0, n = get_irg_n_anchors(irg); i != n; ++i) {
- ir_node *const old = get_irn_n(old_anchor, i);
- ir_node *const nw = be_transform_node(old);
+ foreach_irn_in(old_anchor, i, old) {
+ ir_node *const nw = be_transform_node(old);
set_irn_n(new_anchor, i, nw);
}
@@ -331,9 +330,8 @@ static void transform_nodes(ir_graph *irg, arch_pretrans_nodes *pre_transform)
/* fix loops and set new anchors*/
inc_irg_visited(irg);
- for (int i = get_irg_n_anchors(irg) - 1; i >= 0; --i) {
- ir_node *anchor = get_irn_n(old_anchor, i);
- anchor = (ir_node*)get_irn_link(anchor);
+ foreach_irn_in_r(old_anchor, i, n) {
+ ir_node *const anchor = (ir_node*)get_irn_link(n);
fix_loops(anchor);
}