From: Matthias Braun Date: Thu, 21 Dec 2006 15:07:03 +0000 (+0000) Subject: start register allocator again, fix typo X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=80a6158fdd766f42ee6c508a773bc114ff1b61f3;p=libfirm start register allocator again, fix typo --- diff --git a/ir/be/bemain.c b/ir/be/bemain.c index 5a671645c..1cd2c1a9e 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -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 diff --git a/ir/be/bemodule.c b/ir/be/bemodule.c index 32c1f61a5..57d05bca5 100644 --- a/ir/be/bemodule.c +++ b/ir/be/bemodule.c @@ -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, diff --git a/ir/be/bera.c b/ir/be/bera.c index 3525d7f51..36276690b 100644 --- a/ir/be/bera.c +++ b/ir/be/bera.c @@ -122,6 +122,14 @@ void be_register_allocator(const char *name, be_ra_t *allocator) be_add_module_to_list(®ister_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");