/* It's a completely bad loop: without Phi/Block nodes that can
be a head. I.e., the code is "dying". We break the loop by
setting Bad nodes. */
- int arity = get_irn_arity(n);
- ir_node *bad = get_irg_bad(get_irn_irg(n));
+ ir_graph *irg = get_irn_irg(n);
+ ir_mode *mode = get_irn_mode(n);
+ ir_node *bad = new_r_Bad(irg, mode);
+ int arity = get_irn_arity(n);
for (i = -1; i < arity; ++i) {
set_irn_n(n, i, bad);
}
assert(head_rem == current_loop);
mature_loops(current_loop, irg->obst);
set_irg_loop(irg, current_loop);
- set_irg_loopinfo_state(irg, loopinfo_consistent);
+ set_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_LOOPINFO);
assert(get_irg_loop(irg)->kind == k_ir_loop);
current_ir_graph = rem;
return max_loop_depth;
*/
irg_walk_graph(irg, loop_reset_node, NULL, NULL);
set_irg_loop(irg, NULL);
- set_irg_loopinfo_state(current_ir_graph, loopinfo_none);
+ clear_irg_state(current_ir_graph, IR_GRAPH_STATE_CONSISTENT_LOOPINFO);
/* We cannot free the loop nodes, they are on the obstack. */
}