Commit 2fafc006 authored by Matthias Braun's avatar Matthias Braun
Browse files

cleanup/flatten some backend options

parent a09efb2c
......@@ -65,9 +65,7 @@ struct be_options_t {
int opt_profile; /**< instrument code for profiling */
int omit_fp; /**< try to omit the frame pointer */
int pic; /**< create position independent code */
int gprof; /**< create gprof compatible profiling code */
int verify_option; /**< backend verify option */
char target_os[128]; /**< target operating system name */
char ilp_server[128]; /**< the ilp server name */
char ilp_solver[128]; /**< the ilp solver name */
int statev; /**< enable stat event dumping */
......
......@@ -88,7 +88,7 @@ static lc_opt_enum_int_var_t algo_var = {
};
static const lc_opt_table_entry_t be_blocksched_options[] = {
LC_OPT_ENT_ENUM_INT ("algo", "the block scheduling algorithm", &algo_var),
LC_OPT_ENT_ENUM_INT ("blockscheduler", "the block scheduling algorithm", &algo_var),
LC_OPT_LAST
};
......@@ -726,9 +726,8 @@ BE_REGISTER_MODULE_CONSTRUCTOR(be_init_blocksched);
void be_init_blocksched(void)
{
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *blocksched_grp = lc_opt_get_grp(be_grp, "blocksched");
lc_opt_add_table(blocksched_grp, be_blocksched_options);
lc_opt_add_table(be_grp, be_blocksched_options);
FIRM_DBG_REGISTER(dbg, "firm.be.blocksched");
}
......
......@@ -83,18 +83,13 @@ static be_options_t be_options = {
0, /* no opt profile */
0, /* try to omit frame pointer */
0, /* create PIC code */
0, /* create gprof compatible profiling code */
BE_VERIFY_WARN, /* verification level: warn */
"linux", /* target OS name */
"i44pc52.info.uni-karlsruhe.de", /* ilp server */
"cplex", /* ilp solver */
0, /* enable statistic event dumping */
"", /* print stat events */
};
/* config file. */
static char config_file[256] = { 0 };
/* back end instruction set architecture to use */
static const arch_isa_if_t *isa_if = NULL;
......@@ -129,15 +124,12 @@ static lc_opt_enum_int_var_t verify_var = {
};
static const lc_opt_table_entry_t be_main_options[] = {
LC_OPT_ENT_STR ("config", "read another config file containing backend options", config_file, sizeof(config_file)),
LC_OPT_ENT_ENUM_MASK("dump", "dump irg on several occasions", &dump_var),
LC_OPT_ENT_BOOL ("omitfp", "omit frame pointer", &be_options.omit_fp),
LC_OPT_ENT_BOOL ("pic", "create PIC code", &be_options.pic),
LC_OPT_ENT_BOOL ("gprof", "create gprof profiling code", &be_options.gprof),
LC_OPT_ENT_ENUM_PTR ("verify", "verify the backend irg", &verify_var),
LC_OPT_ENT_BOOL ("time", "get backend timing statistics", &be_options.timing),
LC_OPT_ENT_BOOL ("profile", "instrument the code for execution count profiling", &be_options.opt_profile),
LC_OPT_ENT_STR ("os", "specify target operating system", &be_options.target_os, sizeof(be_options.target_os)),
#ifdef FIRM_STATISTICS
LC_OPT_ENT_BOOL ("statev", "dump statistic events", &be_options.statev),
LC_OPT_ENT_STR ("filtev", "filter for stat events (regex if support is active", &be_options.filtev, sizeof(be_options.filtev)),
......@@ -816,18 +808,6 @@ void be_main(FILE *file_handle, const char *cup_name)
{
ir_timer_t *t = NULL;
/* The user specified another config file to read. do that now. */
if (config_file[0] != '\0') {
FILE *f = fopen(config_file, "rt");
if (f != NULL) {
lc_opt_from_file(config_file, f, NULL);
fclose(f);
} else {
fprintf(stderr, "Warning: Cannot open config file '%s'\n", config_file);
}
}
if (be_options.timing == BE_TIME_ON) {
t = ir_timer_new();
......
......@@ -288,7 +288,7 @@ void be_init_spilloptions(void)
lc_opt_entry_t *spill_grp = lc_opt_get_grp(be_grp, "spill");
lc_opt_add_table(spill_grp, be_spill_options);
be_add_module_list_opt(spill_grp, "spiller", "spill algorithm",
be_add_module_list_opt(be_grp, "spiller", "spill algorithm",
&spillers, (void**) &selected_spiller);
FIRM_DBG_REGISTER(dbg, "firm.be.spillprepare");
......
......@@ -790,10 +790,11 @@ static const arch_irn_ops_t ia32_irn_ops = {
};
static ir_entity *mcount = NULL;
static int gprof = 0;
static void ia32_before_abi(ir_graph *irg)
{
if (be_get_irg_options(irg)->gprof) {
if (gprof) {
if (mcount == NULL) {
ir_type *tp = new_type_method(0, 0);
ident *id = new_id_from_str("mcount");
......@@ -1400,7 +1401,7 @@ static void ia32_init_graph(ir_graph *irg)
irg_data->dump = (be_get_irg_options(irg)->dump_flags & DUMP_BE) ? 1 : 0;
if (be_get_irg_options(irg)->gprof) {
if (gprof) {
/* Linux gprof implementation needs base pointer */
be_get_irg_options(irg)->omit_fp = 0;
}
......@@ -2163,8 +2164,9 @@ static const lc_opt_table_entry_t ia32_options[] = {
#ifdef FIRM_GRGEN_BE
LC_OPT_ENT_ENUM_INT("transformer", "the transformer used for code selection", &transformer_var),
#endif
LC_OPT_ENT_INT("stackalign", "set power of two stack alignment for calls",
&ia32_isa_template.base.stack_alignment),
LC_OPT_ENT_INT ("stackalign", "set power of two stack alignment for calls",
&ia32_isa_template.base.stack_alignment),
LC_OPT_ENT_BOOL("gprof", "create gprof profiling code", &gprof),
LC_OPT_LAST
};
......
Supports Markdown
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