remove #ifdef HAVE_CONFIG_Hs
[libfirm] / ir / opt / ifconv.c
index b7ad5e3..63c7090 100644 (file)
@@ -24,9 +24,7 @@
  * @version $Id$
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <assert.h>
 #include "iroptimize.h"
@@ -39,8 +37,7 @@
 #include "irgopt.h"
 #include "irgwalk.h"
 #include "irtools.h"
-#include "array.h"
-#include "xmalloc.h"
+#include "array_t.h"
 
 // debug
 #include "irdump.h"
@@ -271,14 +268,15 @@ restart:
                        if (projx0 == NULL) continue;
 
                        cond = get_Proj_pred(projx0);
-                       if (get_irn_op(cond) != op_Cond) continue;
+                       if (! is_Cond(cond))
+                               continue;
 
                        /* We only handle boolean decisions, no switches */
                        if (get_irn_mode(get_Cond_selector(cond)) != mode_b) continue;
 
                        for (j = i + 1; j < arity; ++j) {
                                ir_node* projx1;
-                               ir_node* cond;
+                               ir_node* sel;
                                ir_node* mux_block;
                                ir_node* phi;
                                ir_node* pred1;
@@ -303,7 +301,7 @@ restart:
                                prepare_path(block, j, dependency);
                                arity = get_irn_arity(block);
 
-                               cond = get_Cond_selector(cond);
+                               sel = get_Cond_selector(cond);
 
                                mux_block = get_nodes_block(cond);
                                cond_dbg = get_irn_dbg_info(cond);
@@ -331,7 +329,7 @@ restart:
                                                        f = val_i;
                                                }
 
-                                               mux = new_rd_Mux(cond_dbg, current_ir_graph, mux_block, cond, f, t, get_irn_mode(phi));
+                                               mux = new_rd_Mux(cond_dbg, current_ir_graph, mux_block, sel, f, t, get_irn_mode(phi));
                                                DB((dbg, LEVEL_2, "Generating %+F for %+F\n", mux, phi));
                                        }
 
@@ -537,13 +535,13 @@ void opt_if_conv(ir_graph *irg, const ir_settings_if_conv_t *params)
        compute_cdep(irg);
        assure_doms(irg);
 
-       set_using_block_mark(irg);
+       ir_reserve_resources(irg, IR_RESOURCE_BLOCK_MARK);
 
        irg_block_walk_graph(irg, init_block_link, NULL, NULL);
        irg_walk_graph(irg, collect_phis, NULL, NULL);
        irg_block_walk_graph(irg, NULL, if_conv_walker, &p);
 
-       clear_using_block_mark(irg);
+       ir_free_resources(irg, IR_RESOURCE_BLOCK_MARK);
 
        local_optimize_graph(irg);