Complement r22830.
[libfirm] / ir / be / bestate.c
index e5f3c5e..cd2a306 100644 (file)
@@ -25,9 +25,7 @@
  * @date        26.03.2007
  * @version     $Id$
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "bestate.h"
 
@@ -62,7 +60,6 @@ typedef struct spill_info_t {
 
 typedef struct minibelady_env_t {
        struct obstack         obst;
-       const arch_env_t      *arch_env;
        const arch_register_t *reg;
        const be_lv_t         *lv;
        void                  *func_env;
@@ -268,7 +265,7 @@ block_info_t *compute_block_start_state(minibelady_env_t *env, ir_node *block)
        sched_foreach(block, node) {
                if (!is_Phi(node))
                        break;
-               if (arch_get_irn_register(env->arch_env, node) != env->reg)
+               if (arch_get_irn_register(node) != env->reg)
                        continue;
 
                DBG((dbg, LEVEL_2, "\t...checking %+F\n", node));
@@ -318,7 +315,7 @@ block_info_t *compute_block_start_state(minibelady_env_t *env, ir_node *block)
                if(!mode_is_data(get_irn_mode(node)))
                        continue;
 
-               if (arch_get_irn_register(env->arch_env, node) != env->reg)
+               if (arch_get_irn_register(node) != env->reg)
                        continue;
 
                DBG((dbg, LEVEL_2, "\t...checking %+F\n", node));
@@ -409,7 +406,7 @@ void belady(minibelady_env_t *env, ir_node *block)
                        if(!mode_is_data(get_irn_mode(in)))
                                continue;
 
-                       reg = arch_get_irn_register(env->arch_env, in);
+                       reg = arch_get_irn_register(in);
                        if(reg == env->reg) {
                                assert(need_val == NULL);
                                need_val = in;
@@ -436,7 +433,7 @@ void belady(minibelady_env_t *env, ir_node *block)
                                if(!mode_is_data(get_irn_mode(proj)))
                                        continue;
 
-                               reg = arch_get_irn_register(env->arch_env, proj);
+                               reg = arch_get_irn_register(proj);
                                if(reg == env->reg) {
                                        current_state = proj;
                                        DBG((dbg, LEVEL_3, "\t... current_state <- %+F\n", current_state));
@@ -444,8 +441,7 @@ void belady(minibelady_env_t *env, ir_node *block)
                        }
                } else {
                        if(mode_is_data(get_irn_mode(node))) {
-                               const arch_register_t *reg =
-                                       arch_get_irn_register(env->arch_env, node);
+                               const arch_register_t *reg = arch_get_irn_register(node);
                                if(reg == env->reg) {
                                        current_state = node;
                                        DBG((dbg, LEVEL_3, "\t... current_state <- %+F\n", current_state));
@@ -548,7 +544,6 @@ void be_assure_state(be_irg_t *birg, const arch_register_t *reg, void *func_env,
        }
 
        obstack_init(&env.obst);
-       env.arch_env      = be_get_birg_arch_env(birg);
        env.reg           = reg;
        env.func_env      = func_env;
        env.create_spill  = create_spill;
@@ -601,8 +596,8 @@ void be_assure_state(be_irg_t *birg, const arch_register_t *reg, void *func_env,
                len = ARR_LEN(phis);
                for(i = 0; i < len; ++i) {
                        ir_node *phi = phis[i];
-                       be_set_phi_flags(env.arch_env, phi, arch_irn_flags_ignore);
-                       arch_set_irn_register(env.arch_env, phi, env.reg);
+                       be_set_phi_flags(phi, arch_irn_flags_ignore);
+                       arch_set_irn_register(phi, env.reg);
                }
                be_ssa_construction_destroy(&senv);