add sopport for compile without WITH_LIBCORE
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Tue, 3 Jul 2007 15:30:57 +0000 (15:30 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Tue, 3 Jul 2007 15:30:57 +0000 (15:30 +0000)
[r14902]

ir/be/beblocksched.c
ir/be/bechordal_main.c
ir/be/becopyheur2.c
ir/be/becopyheur3.c
ir/be/becopyopt.c
ir/be/beifg.c
ir/be/belistsched.c
ir/be/bemain.c
ir/be/bera.c
ir/be/beschedrss.c
ir/be/bespilloptions.c

index ee4669a..c409677 100644 (file)
 #include "bemodule.h"
 #include "be.h"
 
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-#include <libcore/lc_timing.h>
-
 #ifdef WITH_ILP
 #include <lpp/lpp.h>
 #include <lpp/lpp_net.h>
@@ -66,6 +62,13 @@ typedef enum _blocksched_algos_t {
 
 static int algo = BLOCKSCHED_GREEDY;
 
+
+#ifdef WITH_LIBCORE
+
+#include <libcore/lc_opts.h>
+#include <libcore/lc_opts_enum.h>
+#include <libcore/lc_timing.h>
+
 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");
 }
 
index 962f6f8..79e2a7b 100644 (file)
 #include "iterator.h"
 #include "firm_config.h"
 
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-#include <libcore/lc_timing.h>
-
 #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 <libcore/lc_opts.h>
+#include <libcore/lc_opts_enum.h>
+#include <libcore/lc_timing.h>
+
 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);
 }
 
index 7dc890e..dcc363e 100644 (file)
@@ -28,9 +28,6 @@
 #include "config.h"
 #endif
 
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-
 #include <stdlib.h>
 #include <limits.h>
 
@@ -66,6 +63,10 @@ static int      subtree_iter    = 4;
 static int      max_depth       = 20;
 static double   constr_factor   = 0.9;
 
+#ifdef WITH_LIBCORE
+#include <libcore/lc_opts.h>
+#include <libcore/lc_opts_enum.h>
+
 /* 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);
index d8de8b2..bc5c9f1 100644 (file)
@@ -28,9 +28,6 @@
 #include "config.h"
 #endif
 
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-
 #include <stdlib.h>
 #include <limits.h>
 
 static unsigned dump_flags = 0;
 static int      dbg_level  = 0;
 
+#ifdef WITH_LIBCORE
+#include <libcore/lc_opts.h>
+#include <libcore/lc_opts_enum.h>
+
 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);
index 70ebdfc..9a7540f 100644 (file)
 #include "beirg_t.h"
 #include "error.h"
 
-#include <libcore/lc_timing.h>
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-
 #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 <libcore/lc_timing.h>
+#include <libcore/lc_opts.h>
+#include <libcore/lc_opts_enum.h>
+
 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);
index fd020ce..50e0899 100644 (file)
 
 #include <stdlib.h>
 
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-#include <libcore/lc_timing.h>
-
 #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 <libcore/lc_opts.h>
+#include <libcore/lc_opts_enum.h>
+#include <libcore/lc_timing.h>
+
 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);
index 5edf3a4..890248a 100644 (file)
@@ -61,9 +61,6 @@
 #include "bestat.h"
 #include "beirg_t.h"
 
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-
 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 <libcore/lc_opts.h>
+#include <libcore/lc_opts_enum.h>
+
 /* 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");
 }
 
index e58b808..ef17abe 100644 (file)
 #include <stdarg.h>
 #include <stdio.h>
 
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-#include <libcore/lc_timing.h>
-
 #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 <libcore/lc_opts.h>
+#include <libcore/lc_opts_enum.h>
+#include <libcore/lc_timing.h>
+
 /* 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. */
index b673bef..4eb3aa9 100644 (file)
@@ -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",
                               &register_allocators, (void**) &selected_allocator);
+#endif
 }
 BE_REGISTER_MODULE_CONSTRUCTOR(init_be_ra);
index 633e897..6f518df 100644 (file)
 #include "besched_t.h"
 #include "beirg_t.h"
 
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-
-
 #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 <libcore/lc_opts.h>
+#include <libcore/lc_opts_enum.h>
+
 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);
index 2a47209..caf9ab3 100644 (file)
 #include "bemodule.h"
 #include "be.h"
 
-#include <libcore/lc_opts.h>
-#include <libcore/lc_opts_enum.h>
-#include <libcore/lc_timing.h>
 
 int be_coalesce_spill_slots = 1;
 int be_do_remats = 1;
 
+#ifdef WITH_LIBCORE
+#include <libcore/lc_opts.h>
+#include <libcore/lc_opts_enum.h>
+#include <libcore/lc_timing.h>
+
 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);