summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bestate.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2012-11-28 20:16:27 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2012-11-28 23:42:46 +0100
commit40db13dafa724caf3f38f76539cf107cd4c1a376 (patch)
treeefab3a5fb988ec6d383856cc8ac844498ce19562 /ir/be/bestate.c
parent21859ae93493117ea48653347ddc6307be93e16f (diff)
bearch: Add and use be_foreach_value().
This also handles the latent problem, that nobody checks, whether the user of a tuple is actually a Proj and not the End node.
Diffstat (limited to 'ir/be/bestate.c')
-rw-r--r--ir/be/bestate.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/ir/be/bestate.c b/ir/be/bestate.c
index f2f6a4c..a15a61c 100644
--- a/ir/be/bestate.c
+++ b/ir/be/bestate.c
@@ -408,29 +408,15 @@ static void belady(minibelady_env_t *env, ir_node *block)
DBG((dbg, LEVEL_3, " ...%+F\n", node));
/* record state changes by the node */
- if (get_irn_mode(node) == mode_T) {
- foreach_out_edge(node, edge) {
- const arch_register_t *reg;
- ir_node *proj = get_edge_src_irn(edge);
-
- if (!mode_is_data(get_irn_mode(proj)))
- continue;
-
- reg = arch_get_irn_register(proj);
- if (reg == env->reg) {
- current_state = proj;
- DBG((dbg, LEVEL_3, "\t... current_state <- %+F\n", current_state));
- }
- }
- } else {
- if (mode_is_data(get_irn_mode(node))) {
- const arch_register_t *reg = arch_get_irn_register(node);
- if (reg == env->reg) {
- current_state = node;
- DBG((dbg, LEVEL_3, "\t... current_state <- %+F\n", current_state));
- }
- }
- }
+ be_foreach_value(node, value,
+ if (!mode_is_data(get_irn_mode(value)))
+ continue;
+ arch_register_t const *const reg = arch_get_irn_register(value);
+ if (reg != env->reg)
+ continue;
+ current_state = value;
+ DBG((dbg, LEVEL_3, "\t... current_state <- %+F\n", current_state));
+ );
}
/* Remember end-workset for this block */