fixed precedence constraint
[libfirm] / ir / be / becopyheur2.c
index 04270fc..10ae5b6 100644 (file)
@@ -9,10 +9,8 @@
 #include "config.h"
 #endif
 
-#ifdef WITH_LIBCORE
 #include <libcore/lc_opts.h>
 #include <libcore/lc_opts_enum.h>
-#endif /* WITH_LIBCORE */
 
 #include <stdlib.h>
 #include <limits.h>
@@ -30,6 +28,7 @@
 #include "irprintf.h"
 #include "irtools.h"
 
+#include "bemodule.h"
 #include "beabi.h"
 #include "benode_t.h"
 #include "becopyopt.h"
@@ -47,8 +46,6 @@ static int      max_depth       = 20;
 static double   constr_factor   = 0.9;
 
 /* Options using libcore */
-#ifdef WITH_LIBCORE
-
 static const lc_opt_enum_mask_items_t dump_items[] = {
        { "before",  DUMP_BEFORE },
        { "after",   DUMP_AFTER  },
@@ -69,12 +66,17 @@ static const lc_opt_table_entry_t options[] = {
        { NULL }
 };
 
-void be_co2_register_options(lc_opt_entry_t *grp)
+void be_init_copyheur2(void)
 {
-       lc_opt_entry_t *co2_grp = lc_opt_get_grp(grp, "co2");
+       lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
+       lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra");
+       lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal");
+       lc_opt_entry_t *co2_grp = lc_opt_get_grp(chordal_grp, "co2");
+
        lc_opt_add_table(co2_grp, options);
 }
-#endif
+
+BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur2);
 
 /*
   ____  _             _
@@ -953,7 +955,7 @@ static void process_cloud(co2_cloud_t *cloud)
 
        DBG((env->dbg, LEVEL_3, "mst:\n"));
        for(i = 0; i < cloud->n_memb; ++i) {
-               co2_cloud_irn_t *ci = cloud->seq[i];
+               DEBUG_ONLY(co2_cloud_irn_t *ci = cloud->seq[i]);
                DBG((env->dbg, LEVEL_3, "\t%+F -> %+F\n", ci->inh.irn, ci->mst_parent->inh.irn));
        }