Commit 093d930a authored by Matthias Braun's avatar Matthias Braun
Browse files

get rid of unnecessary be_spiller_t struct

parent 8bf06a8b
......@@ -206,10 +206,10 @@ static const lc_opt_table_entry_t be_spill_options[] = {
LC_OPT_LAST
};
static be_module_list_entry_t *spillers = NULL;
static const be_spiller_t *selected_spiller = NULL;
static be_module_list_entry_t *spillers;
static be_spill_func selected_spiller;
void be_register_spiller(const char *name, be_spiller_t *spiller)
void be_register_spiller(const char *name, be_spill_func spiller)
{
if (selected_spiller == NULL)
selected_spiller = spiller;
......@@ -219,8 +219,7 @@ void be_register_spiller(const char *name, be_spiller_t *spiller)
void be_do_spill(ir_graph *irg, const arch_register_class_t *cls)
{
assert(selected_spiller != NULL);
selected_spiller->spill(irg, cls);
selected_spiller(irg, cls);
}
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spilloptions)
......
......@@ -17,18 +17,7 @@
extern int be_coalesce_spill_slots;
extern int be_do_remats;
/**
* An entry in the list of spill-algorithms.
*/
typedef struct be_spiller_t {
/**
* The spill function.
*
* @param irg the graph to spill on
* @param cls the register class to spill
*/
void (*spill)(ir_graph *irg, const arch_register_class_t *cls);
} be_spiller_t;
typedef void (*be_spill_func)(ir_graph *irg, const arch_register_class_t *cls);
/**
* Register a new spill algorithm.
......@@ -37,7 +26,7 @@ typedef struct be_spiller_t {
* used to select it
* @param spiller a spill entry
*/
void be_register_spiller(const char *name, be_spiller_t *spiller);
void be_register_spiller(const char *name, be_spill_func spiller);
/**
* Execute the selected spill algorithm
......
......@@ -888,13 +888,10 @@ static void be_spill_belady(ir_graph *irg, const arch_register_class_t *rcls)
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spillbelady)
void be_init_spillbelady(void)
{
static be_spiller_t belady_spiller = {
be_spill_belady
};
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *belady_group = lc_opt_get_grp(be_grp, "belady");
lc_opt_add_table(belady_group, options);
be_register_spiller("belady", &belady_spiller);
be_register_spiller("belady", be_spill_belady);
FIRM_DBG_REGISTER(dbg, "firm.be.spill.belady");
}
......@@ -344,10 +344,6 @@ static void be_spill_daemel(ir_graph *irg, const arch_register_class_t *new_cls)
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_daemelspill)
void be_init_daemelspill(void)
{
static be_spiller_t daemel_spiller = {
be_spill_daemel
};
be_register_spiller("daemel", &daemel_spiller);
be_register_spiller("daemel", &be_spill_daemel);
FIRM_DBG_REGISTER(dbg, "firm.be.spilldaemel");
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment