put bespill options into separate file
[libfirm] / ir / be / bespilloptions.c
1 /*
2  * Author:      Daniel Grund, Sebastian Hack, Matthias Braun
3  * Date:                29.09.2005
4  * Copyright:   (c) Universitaet Karlsruhe
5  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
6  */
7 #ifdef HAVE_CONFIG_H
8 #include "config.h"
9 #endif
10
11 #include "bespilloptions.h"
12
13 #ifdef WITH_LIBCORE
14 #include <libcore/lc_opts.h>
15 #include <libcore/lc_opts_enum.h>
16 #include <libcore/lc_timing.h>
17 #endif /* WITH_LIBCORE */
18
19 int be_coalesce_spill_slots = 1;
20 int be_do_remats = 1;
21
22 #ifdef WITH_LIBCORE
23 static const lc_opt_table_entry_t be_spill_options[] = {
24         LC_OPT_ENT_BOOL ("coalesce_slots", "coalesce the spill slots", &be_coalesce_spill_slots),
25         LC_OPT_ENT_BOOL ("remat", "try to rematerialize values instead of reloading", &be_do_remats),
26         { NULL }
27 };
28
29 void be_spill_register_options(lc_opt_entry_t *grp)
30 {
31         static int     run_once = 0;
32         lc_opt_entry_t *spill_grp;
33
34         if (run_once)
35                 return;
36
37         run_once       = 1;
38         spill_grp = lc_opt_get_grp(grp, "spill");
39
40         lc_opt_add_table(spill_grp, be_spill_options);
41 }
42 #endif /* WITH_LIBCORE */