- fixed typos and some comments
[libfirm] / ir / ir / iredges.c
index 4f27a07..1c6099d 100644 (file)
@@ -881,11 +881,13 @@ void edges_init_dbg(int do_dbg) {
 void edges_activate(ir_graph *irg) {
        edges_activate_kind(irg, EDGE_KIND_NORMAL);
        edges_activate_kind(irg, EDGE_KIND_BLOCK);
-       edges_activate_kind(irg, EDGE_KIND_DEP);
+       if (get_irg_phase_state(irg) == phase_backend)
+               edges_activate_kind(irg, EDGE_KIND_DEP);
 }
 
 void edges_deactivate(ir_graph *irg) {
-       edges_deactivate_kind(irg, EDGE_KIND_DEP);
+       if (get_irg_phase_state(irg) == phase_backend)
+               edges_deactivate_kind(irg, EDGE_KIND_DEP);
        edges_deactivate_kind(irg, EDGE_KIND_BLOCK);
        edges_deactivate_kind(irg, EDGE_KIND_NORMAL);
 }
@@ -951,7 +953,7 @@ static void irg_block_edges_walk2(ir_node *bl,
                                 void *env) {
        const ir_edge_t *edge, *next;
 
-       if (Block_not_block_visited(bl)) {
+       if (!Block_block_visited(bl)) {
                mark_Block_block_visited(bl);
 
                if (pre)
@@ -975,10 +977,10 @@ void irg_block_edges_walk(ir_node *node,
        assert(edges_activated(current_ir_graph));
        assert(is_Block(node));
 
-       set_using_block_visited(current_ir_graph);
+       ir_reserve_resources(current_ir_graph, IR_RESOURCE_BLOCK_VISITED);
 
        inc_irg_block_visited(current_ir_graph);
        irg_block_edges_walk2(node, pre, post, env);
 
-       clear_using_block_visited(current_ir_graph);
+       ir_free_resources(current_ir_graph, IR_RESOURCE_BLOCK_VISITED);
 }