cleanup: Remove duplicate MIN/MAX macros.
[libfirm] / ir / ana / irdom.c
index 4dcfac7..ab46923 100644 (file)
@@ -1,20 +1,6 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
- *
  * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
 /**
@@ -44,7 +30,6 @@
 
 ir_node *get_Block_idom(const ir_node *bl)
 {
-       assert(is_Block(bl));
        if (get_Block_dom_depth(bl) == -1) {
                /* This block is not reachable from Start */
                ir_graph *irg = get_irn_irg(bl);
@@ -76,7 +61,6 @@ void set_Block_idom(ir_node *bl, ir_node *n)
 
 ir_node *get_Block_ipostdom(const ir_node *bl)
 {
-       assert(is_Block(bl));
        if (get_Block_postdom_depth(bl) == -1) {
                /* This block is not reachable from Start */
                ir_graph *irg = get_irn_irg(bl);
@@ -432,7 +416,6 @@ static void init_tmp_dom_info(ir_node *bl, tmp_dom_info *parent,
        tmp_dom_info *tdi;
        int i;
 
-       assert(is_Block(bl));
        if (Block_block_visited(bl))
          return;
        mark_Block_block_visited(bl);
@@ -471,7 +454,6 @@ static void init_tmp_pdom_info(ir_node *bl, tmp_dom_info *parent,
        tmp_dom_info *tdi;
        int i;
 
-       assert(is_Block(bl));
        if (get_irg_block_visited(current_ir_graph) == get_Block_block_visited(bl))
          return;
        mark_Block_block_visited(bl);
@@ -493,7 +475,6 @@ static void init_tmp_pdom_info(ir_node *bl, tmp_dom_info *parent,
                ir_node *pred = get_Block_cfgpred_block(bl, i);
                if (is_Bad(pred))
                        continue;
-               assert(is_Block(pred));
                init_tmp_pdom_info(pred, tdi, tdi_list, used, n_blocks);
        }
 
@@ -567,7 +548,7 @@ void compute_doms(ir_graph *irg)
        current_ir_graph = irg;
 
        /* Update graph state */
-       assert(get_irg_phase_state(irg) != phase_building);
+       assert(!irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_CONSTRUCTION));
 
        /* Count the number of blocks in the graph. */
        n_blocks = 0;
@@ -696,7 +677,6 @@ void assure_doms(ir_graph *irg)
 void free_dom(ir_graph *irg)
 {
        /* Update graph state */
-       assert(get_irg_phase_state(irg) != phase_building);
        clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
 
        /* With the implementation right now there is nothing to free */
@@ -714,7 +694,7 @@ void compute_postdoms(ir_graph *irg)
        current_ir_graph = irg;
 
        /* Update graph state */
-       assert(get_irg_phase_state(irg) != phase_building);
+       assert(!irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_CONSTRUCTION));
 
        /* Count the number of blocks in the graph. */
        n_blocks = 0;
@@ -810,9 +790,5 @@ void assure_postdoms(ir_graph *irg)
 void free_postdom(ir_graph *irg)
 {
        /* Update graph state */
-       assert(get_irg_phase_state(irg) != phase_building);
        clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_POSTDOMINANCE);
-
-       /* With the implementation right now there is nothing to free,
-          but better call it anyways... */
 }