Use backtracking in find_original_value() for the flags emitter.
[libfirm] / ir / be / bechordal_main.c
index d533e84..28dce51 100644 (file)
@@ -38,8 +38,8 @@
 #include "iterator.h"
 #include "firm_config.h"
 
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
+#include "lc_opts.h"
+#include "lc_opts_enum.h"
 
 #include "ircons_t.h"
 #include "irmode_t.h"
@@ -394,8 +394,7 @@ static void post_spill(post_spill_env_t *pse, int iteration) {
                if (chordal_env->opts->vrfy_option == BE_CH_VRFY_WARN) {
                        be_verify_schedule(birg);
                        be_verify_register_pressure(birg, pse->cls, irg);
-               }
-               else if (chordal_env->opts->vrfy_option == BE_CH_VRFY_ASSERT) {
+               } else if (chordal_env->opts->vrfy_option == BE_CH_VRFY_ASSERT) {
                        assert(be_verify_schedule(birg) && "Schedule verification failed");
                        assert(be_verify_register_pressure(birg, pse->cls, irg)
                                && "Register pressure verification failed");
@@ -472,9 +471,9 @@ static void post_spill(post_spill_env_t *pse, int iteration) {
  */
 static void be_ra_chordal_main(be_irg_t *birg)
 {
-       const be_main_env_t *main_env  = birg->main_env;
-       const arch_isa_t    *isa       = arch_env_get_isa(main_env->arch_env);
-       ir_graph            *irg       = birg->irg;
+       const be_main_env_t *main_env = birg->main_env;
+       const arch_env_t    *arch_env = main_env->arch_env;
+       ir_graph            *irg      = birg->irg;
        int                 j, m;
        be_chordal_env_t    chordal_env;
        struct obstack      obst;
@@ -508,10 +507,10 @@ static void be_ra_chordal_main(be_irg_t *birg)
                /* use one of the generic spiller */
 
                /* Perform the following for each register class. */
-               for (j = 0, m = arch_isa_get_n_reg_class(isa); j < m; ++j) {
+               for (j = 0, m = arch_env_get_n_reg_class(arch_env); j < m; ++j) {
                        post_spill_env_t pse;
                        const arch_register_class_t *cls
-                               = arch_isa_get_reg_class(isa, j);
+                               = arch_env_get_reg_class(arch_env, j);
 
                        if(arch_register_class_flags(cls) & arch_register_class_flag_manual_ra)
                                continue;
@@ -534,7 +533,7 @@ static void be_ra_chordal_main(be_irg_t *birg)
                post_spill_env_t *pse;
 
                /* the backend has it's own spiller */
-               m = arch_isa_get_n_reg_class(isa);
+               m = arch_env_get_n_reg_class(arch_env);
 
                pse = alloca(m * sizeof(pse[0]));
 
@@ -571,8 +570,6 @@ static void be_ra_chordal_main(be_irg_t *birg)
        stat_ev_if {
                be_stat_ev("insns_after", count_insns(irg));
        }
-
-       return;
 }
 
 static be_ra_t be_ra_chordal_allocator = {