check constraints only for scheduled nodes
[libfirm] / ir / be / bemodule.c
index 64473f6..5575b3c 100644 (file)
@@ -27,11 +27,15 @@ void be_init_arch_ia32(void);
 void be_init_arch_ppc32(void);
 void be_init_arch_mips(void);
 void be_init_arch_arm(void);
+void be_init_arch_sta(void);
 void be_init_ilpsched(void);
 void be_init_copyilp(void);
-void be_init_spillremat(void);
 void be_init_javacoal(void);
 void be_init_ra(void);
+void be_init_spillbelady(void);
+void be_init_spillmorgan(void);
+void be_init_spillremat(void);
+void be_init_ifg(void);
 
 void be_quit_copystat(void);
 
@@ -54,6 +58,9 @@ void be_init_modules(void)
        be_init_raextern();
        be_init_copystat();
        be_init_ra();
+       be_init_spillbelady();
+       be_init_spillmorgan();
+       be_init_ifg();
 
        be_init_arch_ia32();
        be_init_arch_ppc32();
@@ -69,6 +76,10 @@ void be_init_modules(void)
 #ifdef WITH_JVM
        be_init_javacoal();
 #endif
+
+#ifdef WITH_STA
+       be_init_arch_sta();
+#endif
 }
 
 void be_quit_modules(void)
@@ -78,17 +89,23 @@ void be_quit_modules(void)
 
 //---------------------------------------------------------------------------
 
+#ifdef WITH_LIBCORE
 typedef struct module_opt_data_t {
        void **var;
-       const be_module_list_entry_t * const *list_head;
+       be_module_list_entry_t * const *list_head;
 } module_opt_data_t;
 
-static int set_opt_module(const char *name, lc_opt_type_t type, void *data, size_t length, ...)
+/**
+ * Beware: return value of 0 means error.
+ */
+static int set_opt_module(const char *name, lc_opt_type_t type, void *data,
+                          size_t length, ...)
 {
        module_opt_data_t *moddata = data;
        va_list args;
        const char* opt;
        const be_module_list_entry_t *module;
+       int res = 0;
 
        va_start(args, length);
        opt = va_arg(args, const char*);
@@ -96,12 +113,13 @@ static int set_opt_module(const char *name, lc_opt_type_t type, void *data, size
        for(module = *(moddata->list_head); module != NULL; module = module->next) {
                if(strcmp(module->name, opt) == 0) {
                        *(moddata->var) = module->data;
+                       res = 1;
                        break;
                }
        }
        va_end(args);
 
-       return 0;
+       return res;
 }
 
 int dump_opt_module(char *buf, size_t buflen, const char *name,
@@ -154,12 +172,12 @@ void be_add_module_to_list(be_module_list_entry_t **list_head, const char *name,
        entry->name = name;
        entry->data = module;
        entry->next = *list_head;
-       *list_head = entry->next;
+       *list_head = entry;
 }
 
 void be_add_module_list_opt(lc_opt_entry_t *grp, const char *name,
                             const char *description,
-                            const be_module_list_entry_t * const * list_head,
+                            be_module_list_entry_t * const * list_head,
                             void **var)
 {
        module_opt_data_t *moddata = xmalloc(sizeof(moddata[0]));
@@ -171,3 +189,5 @@ void be_add_module_list_opt(lc_opt_entry_t *grp, const char *name,
                       set_opt_module, dump_opt_module, dump_opt_module_vals,
                                   NULL);
 }
+
+#endif