refactor mode_b lowerer to have a create_set callback
[libfirm] / ir / be / bechordal_common.c
index f4ec6b1..49e617d 100644 (file)
  * @date        08.12.2004
  * @version     $Id: bechordal.c 26750 2009-11-27 09:37:43Z bersch $
  */
-
 #include "config.h"
+
+#include "bechordal_common.h"
+
 #include "debug.h"
 
 #include "iredges.h"
@@ -115,10 +117,10 @@ void create_borders(ir_node *block, void *env_ptr)
        be_chordal_env_t *env             = env_ptr;
        bitset_t *live                    = bitset_malloc(get_irg_last_idx(env->irg));
        ir_node *irn;
-       be_lv_t *lv                       = env->birg->lv;
+       be_lv_t *lv                       = be_get_irg_liveness(env->irg);
 
        int i, n;
-       bitset_pos_t elm;
+       unsigned elm;
        unsigned step = 0;
        unsigned pressure = 0;
        struct list_head *head;
@@ -253,7 +255,7 @@ ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn)
         * Make the Perm, recompute liveness and re-scan the insn since the
         * in operands are now the Projs of the Perm.
         */
-       perm = insert_Perm_after(env->birg, env->cls, sched_prev(insn->irn));
+       perm = insert_Perm_after(env->irg, env->cls, sched_prev(insn->irn));
 
        /* Registers are propagated by insert_Perm_after(). Clean them here! */
        if (perm == NULL)
@@ -292,9 +294,8 @@ ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn)
        return perm;
 }
 
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal_common);
 void be_init_chordal_common(void)
 {
        FIRM_DBG_REGISTER(dbg, "firm.be.chordal_common");
 }
-
-BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal_common);