Let list_for_each_entry(), list_for_each_entry_reverse() and list_for_each_entry_safe...
[libfirm] / ir / opt / code_placement.c
index 2e3e5a6..22f41be 100644 (file)
@@ -23,7 +23,6 @@
  *           often.
  * @author   Christian Schaefer, Goetz Lindenmaier, Sebastian Felis,
  *           Michael Beck
- * @version  $Id$
  *
  * The idea here is to push nodes as deep into the dominance tree as their
  * dependencies allow. After pushing them back up out of as many loops as
@@ -349,11 +348,7 @@ static void place_floats_late(ir_node *n, pdeq *worklist)
                return;
        /* some nodes should simply stay in the startblock */
        if (is_irn_start_block_placed(n)) {
-#ifndef NDEBUG
-               ir_graph *irg         = get_irn_irg(n);
-               ir_node  *start_block = get_irg_start_block(irg);
-               assert(get_nodes_block(n) == start_block);
-#endif
+               assert(get_nodes_block(n) == get_irg_start_block(get_irn_irg(n)));
                return;
        }
 
@@ -400,13 +395,14 @@ void place_code(ir_graph *irg)
 {
        waitq *worklist;
 
-       remove_critical_cf_edges(irg);
-
        /* Handle graph state */
        assert(get_irg_phase_state(irg) != phase_building);
-       assure_irg_outs(irg);
-       assure_doms(irg);
-       assure_cf_loop(irg);
+       assure_irg_properties(irg,
+               IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES |
+               IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE |
+               IR_GRAPH_PROPERTY_CONSISTENT_OUTS |
+               IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE |
+               IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
 
        /* Place all floating nodes as early as possible. This guarantees
         a legal code placement. */
@@ -424,6 +420,7 @@ void place_code(ir_graph *irg)
        place_late(irg, worklist);
 
        del_waitq(worklist);
+       confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_NONE);
 }
 
 /**