start register allocator again, fix typo
authorMatthias Braun <matze@braunis.de>
Thu, 21 Dec 2006 15:07:03 +0000 (15:07 +0000)
committerMatthias Braun <matze@braunis.de>
Thu, 21 Dec 2006 15:07:03 +0000 (15:07 +0000)
ir/be/bemain.c
ir/be/bemodule.c
ir/be/bera.c

index 5a67164..1cd2c1a 100644 (file)
@@ -89,9 +89,6 @@ static be_options_t be_options = {
 /* config file. */
 static char config_file[256] = { 0 };
 
-/* register allocator to use. */
-//static const be_ra_t *ra = &be_ra_chordal_allocator;
-
 /* back end instruction set architecture to use */
 static const arch_isa_if_t *isa_if = &ia32_isa_if;
 
@@ -625,7 +622,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
 
                /* Do register allocation */
                BE_TIMER_PUSH(t_regalloc);
-               //ra_timer = ra->allocate(birg);
+               be_allocate_registers(birg);
                BE_TIMER_POP(t_regalloc);
 
 #ifdef FIRM_STATISTICS
index 32c1f61..57d05bc 100644 (file)
@@ -156,7 +156,7 @@ 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,
index 3525d7f..3627669 100644 (file)
@@ -122,6 +122,14 @@ void be_register_allocator(const char *name, be_ra_t *allocator)
        be_add_module_to_list(&register_allocators, name, allocator);
 }
 
+void be_allocate_registers(be_irg_t *birg)
+{
+       assert(selected_allocator != NULL);
+       if(selected_allocator != NULL) {
+               selected_allocator->allocate(birg);
+       }
+}
+
 void be_init_ra(void)
 {
        lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");