X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbespilloptions.c;h=f6cfb73166e1940ae82bbc046039f33afd0eb7ef;hb=330af274dc3552a170f6ea14605a3d6cfb977373;hp=b25b237c0a59146210603312a304f0f113f286f3;hpb=4d5c3365a58cba59993045a9e08e686d8ae079a7;p=libfirm diff --git a/ir/be/bespilloptions.c b/ir/be/bespilloptions.c index b25b237c0..f6cfb7316 100644 --- a/ir/be/bespilloptions.c +++ b/ir/be/bespilloptions.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -17,15 +17,14 @@ * PURPOSE. */ -/* - * Author: Daniel Grund, Sebastian Hack, Matthias Braun - * Date: 29.09.2005 - * Copyright: (c) Universitaet Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. +/** + * @file + * @brief Option handling for spiller. + * @author Daniel Grund, Sebastian Hack, Matthias Braun + * @date 29.09.2005 + * @version $Id$ */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include "irtools.h" @@ -33,9 +32,8 @@ #include "bemodule.h" #include "be.h" -#include -#include -#include +#include "lc_opts.h" +#include "lc_opts_enum.h" int be_coalesce_spill_slots = 1; int be_do_remats = 1; @@ -43,28 +41,28 @@ int be_do_remats = 1; static const lc_opt_table_entry_t be_spill_options[] = { LC_OPT_ENT_BOOL ("coalesce_slots", "coalesce the spill slots", &be_coalesce_spill_slots), LC_OPT_ENT_BOOL ("remat", "try to rematerialize values instead of reloading", &be_do_remats), - { NULL } + LC_OPT_LAST }; static be_module_list_entry_t *spillers = NULL; -static be_spiller_t *selected_spiller = NULL; +static const be_spiller_t *selected_spiller = NULL; void be_register_spiller(const char *name, be_spiller_t *spiller) { - if(selected_spiller == NULL) + if (selected_spiller == NULL) selected_spiller = spiller; be_add_module_to_list(&spillers, name, spiller); } -void be_do_spill(be_irg_t *birg, const arch_register_class_t* cls) +void be_do_spill(be_irg_t *birg, const arch_register_class_t *cls) { assert(selected_spiller != NULL); - if(selected_spiller != NULL) { + if (selected_spiller != NULL) { selected_spiller->spill(birg, cls); } } -void be_init_spill(void) +void be_init_spilloptions(void) { lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); lc_opt_entry_t *spill_grp = lc_opt_get_grp(be_grp, "spill"); @@ -74,4 +72,4 @@ void be_init_spill(void) &spillers, (void**) &selected_spiller); } -BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spill); +BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spilloptions);