From: Michael Beck Date: Tue, 3 Jul 2007 15:30:57 +0000 (+0000) Subject: add sopport for compile without WITH_LIBCORE X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=79ed89a676afd08eb739330d46b85b1d1532aec1;p=libfirm add sopport for compile without WITH_LIBCORE [r14902] --- diff --git a/ir/be/beblocksched.c b/ir/be/beblocksched.c index ee4669ac6..c4096777e 100644 --- a/ir/be/beblocksched.c +++ b/ir/be/beblocksched.c @@ -49,10 +49,6 @@ #include "bemodule.h" #include "be.h" -#include -#include -#include - #ifdef WITH_ILP #include #include @@ -66,6 +62,13 @@ typedef enum _blocksched_algos_t { static int algo = BLOCKSCHED_GREEDY; + +#ifdef WITH_LIBCORE + +#include +#include +#include + static const lc_opt_enum_int_items_t blockschedalgo_items[] = { { "naiv", BLOCKSCHED_NAIV }, { "extbb", BLOCKSCHED_EXTBB }, @@ -84,6 +87,7 @@ static const lc_opt_table_entry_t be_blocksched_options[] = { LC_OPT_ENT_ENUM_INT ("algo", "the block scheduling algorithm", &algo_var), LC_OPT_LAST }; +#endif /* WITH_LIBCORE */ /* * ____ _ @@ -724,11 +728,12 @@ static ir_node **create_extbb_block_schedule(ir_graph *irg, ir_exec_freq *execfr */ void be_init_blocksched(void) { +#ifdef WITH_LIBCORE 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); - +#endif FIRM_DBG_REGISTER(dbg, "firm.be.blocksched"); } diff --git a/ir/be/bechordal_main.c b/ir/be/bechordal_main.c index 962f6f831..79e2a7b47 100644 --- a/ir/be/bechordal_main.c +++ b/ir/be/bechordal_main.c @@ -38,10 +38,6 @@ #include "iterator.h" #include "firm_config.h" -#include -#include -#include - #include "ircons_t.h" #include "irmode_t.h" #include "irgraph_t.h" @@ -123,6 +119,11 @@ static be_ra_timer_t ra_timer = { NULL, }; +#ifdef WITH_LIBCORE +#include +#include +#include + static const lc_opt_enum_int_items_t lower_perm_items[] = { { "copy", BE_CH_LOWER_PERM_COPY }, { "swap", BE_CH_LOWER_PERM_SWAP }, @@ -174,6 +175,7 @@ static const lc_opt_table_entry_t be_chordal_options[] = { LC_OPT_ENT_ENUM_PTR ("vrfy", "verify options", &be_ch_vrfy_var), LC_OPT_LAST }; +#endif /* WITH_LIBCORE */ static void dump(unsigned mask, ir_graph *irg, const arch_register_class_t *cls, @@ -629,12 +631,13 @@ static be_ra_t be_ra_chordal_allocator = { void be_init_chordal_main(void) { +#ifdef WITH_LIBCORE lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra"); lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal"); lc_opt_add_table(chordal_grp, be_chordal_options); - +#endif be_register_allocator("chordal", &be_ra_chordal_allocator); } diff --git a/ir/be/becopyheur2.c b/ir/be/becopyheur2.c index 7dc890e00..dcc363eee 100644 --- a/ir/be/becopyheur2.c +++ b/ir/be/becopyheur2.c @@ -28,9 +28,6 @@ #include "config.h" #endif -#include -#include - #include #include @@ -66,6 +63,10 @@ static int subtree_iter = 4; static int max_depth = 20; static double constr_factor = 0.9; +#ifdef WITH_LIBCORE +#include +#include + /* Options using libcore */ static const lc_opt_enum_mask_items_t dump_items[] = { { "before", DUMP_BEFORE }, @@ -86,15 +87,18 @@ static const lc_opt_table_entry_t options[] = { LC_OPT_ENT_INT ("max", "maximum recursion depth", &max_depth), LC_OPT_LAST }; +#endif /* WITH_LIBCORE */ void be_init_copyheur2(void) { +#ifdef WITH_LIBCORE lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra"); lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal"); lc_opt_entry_t *co2_grp = lc_opt_get_grp(chordal_grp, "co2"); lc_opt_add_table(co2_grp, options); +#endif } BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur2); diff --git a/ir/be/becopyheur3.c b/ir/be/becopyheur3.c index d8de8b2af..bc5c9f118 100644 --- a/ir/be/becopyheur3.c +++ b/ir/be/becopyheur3.c @@ -28,9 +28,6 @@ #include "config.h" #endif -#include -#include - #include #include @@ -66,6 +63,10 @@ static unsigned dump_flags = 0; static int dbg_level = 0; +#ifdef WITH_LIBCORE +#include +#include + static const lc_opt_enum_mask_items_t dump_items[] = { { "before", DUMP_BEFORE }, { "after", DUMP_AFTER }, @@ -82,15 +83,18 @@ static const lc_opt_table_entry_t options[] = { LC_OPT_ENT_INT ("dbg", "debug level for the Java coalescer", &dbg_level), LC_OPT_LAST }; +#endif /* WITH_LIBCORE */ void be_init_copyheur3(void) { +#ifdef WITH_LIBCORE lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra"); lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal"); lc_opt_entry_t *co3_grp = lc_opt_get_grp(chordal_grp, "co3"); lc_opt_add_table(co3_grp, options); +#endif } BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copyheur3); diff --git a/ir/be/becopyopt.c b/ir/be/becopyopt.c index 70ebdfcac..9a7540f82 100644 --- a/ir/be/becopyopt.c +++ b/ir/be/becopyopt.c @@ -66,10 +66,6 @@ #include "beirg_t.h" #include "error.h" -#include -#include -#include - #define DUMP_BEFORE 1 #define DUMP_AFTER 2 #define DUMP_APPEL 4 @@ -86,6 +82,11 @@ static cost_fct_t cost_func = co_get_costs_exec_freq; static unsigned algo = CO_ALGO_HEUR4; static int improve = 1; +#ifdef WITH_LIBCORE +#include +#include +#include + static const lc_opt_enum_mask_items_t dump_items[] = { { "before", DUMP_BEFORE }, { "after", DUMP_AFTER }, @@ -151,6 +152,7 @@ static const lc_opt_table_entry_t options[] = { LC_OPT_ENT_BOOL ("improve", "run heur3 before if algo can exploit start solutions", &improve), LC_OPT_LAST }; +#endif /* WITH_LIBCORE */ /* Insert additional options registration functions here. */ extern void be_co_ilp_register_options(lc_opt_entry_t *grp); @@ -159,12 +161,14 @@ extern void be_co3_register_options(lc_opt_entry_t *grp); void be_init_copycoal(void) { +#ifdef WITH_LIBCORE lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra"); lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal"); lc_opt_entry_t *co_grp = lc_opt_get_grp(chordal_grp, "co"); lc_opt_add_table(co_grp, options); +#endif } BE_REGISTER_MODULE_CONSTRUCTOR(be_init_copycoal); diff --git a/ir/be/beifg.c b/ir/be/beifg.c index fd020cebf..50e08994d 100644 --- a/ir/be/beifg.c +++ b/ir/be/beifg.c @@ -30,10 +30,6 @@ #include -#include -#include -#include - #include "bitset.h" #include "irgwalk.h" #include "irnode_t.h" @@ -706,6 +702,11 @@ enum { static int ifg_flavor = BE_IFG_STD; +#ifdef WITH_LIBCORE +#include +#include +#include + static const lc_opt_enum_int_items_t ifg_flavor_items[] = { { "std", BE_IFG_STD }, { "fast", BE_IFG_FAST }, @@ -724,13 +725,16 @@ static const lc_opt_table_entry_t be_ifg_options[] = { LC_OPT_ENT_ENUM_PTR ("ifg", "interference graph flavour", &ifg_flavor_var), LC_OPT_LAST }; +#endif /* WITH_LIBCORE */ void be_init_ifg(void) { +#ifdef WITH_LIBCORE lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); lc_opt_entry_t *ifg_grp = lc_opt_get_grp(be_grp, "ifg"); lc_opt_add_table(ifg_grp, be_ifg_options); +#endif } BE_REGISTER_MODULE_CONSTRUCTOR(be_init_ifg); diff --git a/ir/be/belistsched.c b/ir/be/belistsched.c index 5edf3a431..890248a3a 100644 --- a/ir/be/belistsched.c +++ b/ir/be/belistsched.c @@ -61,9 +61,6 @@ #include "bestat.h" #include "beirg_t.h" -#include -#include - DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL); #define BE_SCHED_NODE(irn) (be_is_Keep(irn) || be_is_CopyKeep(irn) || be_is_RegParams(irn)) @@ -93,6 +90,11 @@ static list_sched_options_t list_sched_options = { BE_SCHED_PREP_NONE, /* no scheduling preparation */ }; + +#ifdef WITH_LIBCORE +#include +#include + /* schedule selector options. */ static const lc_opt_enum_int_items_t sched_select_items[] = { { "trivial", BE_SCHED_SELECT_TRIVIAL }, @@ -125,6 +127,7 @@ static const lc_opt_table_entry_t list_sched_option_table[] = { LC_OPT_ENT_ENUM_PTR("select", "node selector", &sched_select_var), LC_OPT_LAST }; +#endif /* WITH_LIBCORE */ /** * All scheduling info needed per node. @@ -729,11 +732,12 @@ void list_sched_single_block(const be_irg_t *birg, ir_node *block, * Register list scheduler options. */ void be_init_listsched(void) { +#ifdef WITH_LIBCORE lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); lc_opt_entry_t *sched_grp = lc_opt_get_grp(be_grp, "listsched"); lc_opt_add_table(sched_grp, list_sched_option_table); - +#endif FIRM_DBG_REGISTER(dbg, "firm.be.sched"); } diff --git a/ir/be/bemain.c b/ir/be/bemain.c index e58b8086d..ef17abea1 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -31,10 +31,6 @@ #include #include -#include -#include -#include - #include "obst.h" #include "bitset.h" @@ -102,6 +98,11 @@ static char config_file[256] = { 0 }; /* back end instruction set architecture to use */ static const arch_isa_if_t *isa_if = NULL; +#ifdef WITH_LIBCORE +#include +#include +#include + /* possible dumping options */ static const lc_opt_enum_mask_items_t dump_items[] = { { "none", DUMP_NONE }, @@ -162,6 +163,7 @@ static const lc_opt_table_entry_t be_main_options[] = { #endif /* WITH_ILP */ LC_OPT_LAST }; +#endif /* WITH_LIBCORE */ static be_module_list_entry_t *isa_ifs = NULL; @@ -185,21 +187,27 @@ void be_opt_register(void) be_init_modules(); +#ifdef WITH_LIBCORE be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); lc_opt_add_table(be_grp, be_main_options); be_add_module_list_opt(be_grp, "isa", "the instruction set architecture", &isa_ifs, (void**) &isa_if); +#endif } /* Parse one argument. */ int be_parse_arg(const char *arg) { +#ifdef WITH_LIBCORE lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); if (strcmp(arg, "help") == 0 || (arg[0] == '?' && arg[1] == '\0')) { lc_opt_print_help(be_grp, stdout); return -1; } return lc_opt_from_single_arg(be_grp, NULL, arg, NULL); +#else + return 0; +#endif } /** The be parameters returned by default, all off. */ diff --git a/ir/be/bera.c b/ir/be/bera.c index b673befe3..4eb3aa900 100644 --- a/ir/be/bera.c +++ b/ir/be/bera.c @@ -65,11 +65,12 @@ void be_allocate_registers(be_irg_t *birg) } } -void be_init_ra(void) -{ +void be_init_ra(void) { +#ifdef WITH_LIBCORE lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); be_add_module_list_opt(be_grp, "regalloc", "register allocator", ®ister_allocators, (void**) &selected_allocator); +#endif } BE_REGISTER_MODULE_CONSTRUCTOR(init_be_ra); diff --git a/ir/be/beschedrss.c b/ir/be/beschedrss.c index 633e89776..6f518dffa 100644 --- a/ir/be/beschedrss.c +++ b/ir/be/beschedrss.c @@ -59,10 +59,6 @@ #include "besched_t.h" #include "beirg_t.h" -#include -#include - - #define ARR_LEN_SAFE(arr) ((arr) != NULL ? ARR_LEN((arr)) : 0) #define HASH_RSS_EDGE(edge) ((get_irn_node_nr((edge)->src) << 16) | (get_irn_node_nr((edge)->tgt) & 0xFFFF)) @@ -201,6 +197,10 @@ static rss_opts_t rss_options = { RSS_DUMP_NONE, }; +#ifdef WITH_LIBCORE +#include +#include + static const lc_opt_enum_int_items_t dump_items[] = { { "none", RSS_DUMP_NONE }, { "cbc", RSS_DUMP_CBC }, @@ -220,6 +220,7 @@ static const lc_opt_table_entry_t rss_option_table[] = { LC_OPT_ENT_ENUM_MASK("dump", "dump phases", &dump_var), LC_OPT_LAST }; +#endif /* WITH_LIBCORE */ /****************************************************************************** * _ _ __ _ _ @@ -2136,11 +2137,13 @@ static void process_block(ir_node *block, void *env) { * Register the options. */ void be_init_schedrss(void) { +#ifdef WITH_LIBCORE lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be"); lc_opt_entry_t *sched_grp = lc_opt_get_grp(be_grp, "sched"); lc_opt_entry_t *rss_grp = lc_opt_get_grp(sched_grp, "rss"); lc_opt_add_table(rss_grp, rss_option_table); +#endif } BE_REGISTER_MODULE_CONSTRUCTOR(be_init_schedrss); diff --git a/ir/be/bespilloptions.c b/ir/be/bespilloptions.c index 2a472098f..caf9ab379 100644 --- a/ir/be/bespilloptions.c +++ b/ir/be/bespilloptions.c @@ -34,18 +34,21 @@ #include "bemodule.h" #include "be.h" -#include -#include -#include int be_coalesce_spill_slots = 1; int be_do_remats = 1; +#ifdef WITH_LIBCORE +#include +#include +#include + 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), LC_OPT_LAST }; +#endif /* WITH_LIBCORE */ static be_module_list_entry_t *spillers = NULL; static be_spiller_t *selected_spiller = NULL; @@ -67,12 +70,14 @@ void be_do_spill(be_irg_t *birg, const arch_register_class_t* cls) void be_init_spilloptions(void) { +#ifdef WITH_LIBCORE 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"); lc_opt_add_table(spill_grp, be_spill_options); be_add_module_list_opt(spill_grp, "spiller", "spill algorithm", &spillers, (void**) &selected_spiller); +#endif /* WITH_LIBCORE */ } BE_REGISTER_MODULE_CONSTRUCTOR(be_init_spilloptions);