- int i, arity;
- const arch_register_class_t *cls = env->cls;
- const arch_env_t *arch_env = env->arch_env;
- const bitset_t *bitset = env->spilled_nodes;
-
- /* You should better break out of your loop when hitting the first phi
- * function. */
- assert(!is_Phi(node) && "liveness_transfer produces invalid results for phi nodes");
-
- if(arch_irn_consider_in_reg_alloc(arch_env, cls, node)) {
- ir_nodeset_remove(nodeset, node);
- }
-
- arity = get_irn_arity(node);
- for(i = 0; i < arity; ++i) {
- ir_node *op = get_irn_n(node, i);
-
- if(arch_irn_consider_in_reg_alloc(arch_env, cls, op)
- && !bitset_is_set(bitset, get_irn_idx(op))) {
- ir_nodeset_insert(nodeset, op);
+ /* You must break out of your loop when hitting the first phi function. */
+ assert(!is_Phi(node));
+
+ be_foreach_definition(node, cls, value,
+ ir_nodeset_remove(nodeset, value);
+ );
+}
+
+static void add_uses(ir_node *node, ir_nodeset_t *nodeset)
+{
+ int arity = get_irn_arity(node);
+ for (int i = 0; i < arity; ++i) {
+ ir_node *op = get_irn_n(node, i);
+
+ if (arch_irn_consider_in_reg_alloc(cls, op) &&
+ !bitset_is_set(spilled_nodes, get_irn_idx(op))) {
+ ir_nodeset_insert(nodeset, op);