remove remaining WITH_ILP uses, fix bug introduced when adapting lpp
authorMatthias Braun <matze@braunis.de>
Thu, 16 Jun 2011 11:50:54 +0000 (13:50 +0200)
committerMatthias Braun <matze@braunis.de>
Thu, 16 Jun 2011 11:50:54 +0000 (13:50 +0200)
ir/be/beblocksched.c
ir/be/becopystat.c
ir/be/becopystat.h
ir/be/bemain.c
ir/be/bemodule.c
ir/lpp/lpp_comm.c

index 54c5bf2..cbc96a8 100644 (file)
 #include "lc_opts.h"
 #include "lc_opts_enum.h"
 
-#ifdef WITH_ILP
-#include <lpp/lpp.h>
-#include <lpp/lpp_net.h>
-#endif /* WITH_ILP */
+#include "lpp.h"
+#include "lpp_net.h"
 
 DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
 
@@ -77,9 +75,7 @@ static int algo = BLOCKSCHED_GREEDY;
 static const lc_opt_enum_int_items_t blockschedalgo_items[] = {
        { "naiv",   BLOCKSCHED_NAIV },
        { "greedy", BLOCKSCHED_GREEDY },
-#ifdef WITH_ILP
        { "ilp",    BLOCKSCHED_ILP },
-#endif /* WITH_ILP */
        { NULL,     0 }
 };
 
@@ -534,7 +530,6 @@ static ir_node **create_block_schedule_greedy(ir_graph *irg, ir_exec_freq *execf
  *
  */
 
-#ifdef WITH_ILP
 typedef struct ilp_edge_t {
        ir_node *block;   /**< source block */
        int     pos;      /**< number of cfg predecessor (target) */
@@ -712,7 +707,6 @@ static ir_node **create_block_schedule_ilp(ir_graph *irg, ir_exec_freq *execfreq
 
        return block_list;
 }
-#endif /* WITH_ILP */
 
 /*
  *  __  __       _
@@ -740,10 +734,8 @@ ir_node **be_create_block_schedule(ir_graph *irg)
        case BLOCKSCHED_GREEDY:
        case BLOCKSCHED_NAIV:
                return create_block_schedule_greedy(irg, execfreqs);
-#ifdef WITH_ILP
        case BLOCKSCHED_ILP:
                return create_block_schedule_ilp(irg, execfreqs);
-#endif /* WITH_ILP */
        }
 
        panic("unknown blocksched algo");
index d3447c4..1c36a17 100644 (file)
@@ -186,8 +186,6 @@ void copystat_add_heur_time(int time)
        curr_vals[I_HEUR_TIME] += time;
 }
 
-#ifdef WITH_ILP
-
 void copystat_add_ilp_5_sec_costs(int costs)
 {
        curr_vals[I_COPIES_5SEC] += costs;
@@ -213,8 +211,6 @@ void copystat_add_ilp_iter(int iters)
        curr_vals[I_ILP_ITER] += iters;
 }
 
-#endif /* WITH_ILP */
-
 /**
  * Opens a file named base.ext with the mode mode.
  */
index d02f51a..7474693 100644 (file)
@@ -40,8 +40,6 @@ void copystat_add_heur_time(int time);
 void copystat_dump(ir_graph *irg);
 void copystat_dump_pretty(ir_graph *irg);
 
-#ifdef WITH_ILP
-
 void copystat_add_ilp_5_sec_costs(int costs);
 void copystat_add_ilp_30_sec_costs(int costs);
 void copystat_add_ilp_time(int time);
@@ -49,6 +47,4 @@ void copystat_add_ilp_vars(int vars);
 void copystat_add_ilp_csts(int csts);
 void copystat_add_ilp_iter(int iters);
 
-#endif /* WITH_ILP */
-
 #endif
index 4a6d462..0eafb66 100644 (file)
@@ -136,10 +136,8 @@ static const lc_opt_table_entry_t be_main_options[] = {
        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)),
 
-#ifdef WITH_ILP
        LC_OPT_ENT_STR ("ilp.server", "the ilp server name", be_options.ilp_server, sizeof(be_options.ilp_server)),
        LC_OPT_ENT_STR ("ilp.solver", "the ilp solver name", be_options.ilp_solver, sizeof(be_options.ilp_solver)),
-#endif /* WITH_ILP */
        LC_OPT_LAST
 };
 
index 7ba3f57..9bf6693 100644 (file)
@@ -116,9 +116,7 @@ void be_init_modules(void)
        be_init_copyheur4();
        be_init_copyheur();
        be_init_copyheur2();
-#ifdef WITH_ILP
        be_init_copyilp2();
-#endif
        be_init_pbqp_coloring();
        be_init_copynone();
        be_init_copystat();
@@ -137,9 +135,7 @@ void be_init_modules(void)
        be_init_arch_amd64();
        be_init_arch_TEMPLATE();
 
-#ifdef WITH_ILP
        be_init_copyilp();
-#endif /* WITH_ILP */
 
 #if PLUGIN_IR_BE_STA
        be_init_arch_sta();
index ea0a0b2..ab0887f 100644 (file)
@@ -49,7 +49,17 @@ struct _lpp_comm_t {
        char *r_buf;
 };
 
-static firm_dbg_module_t *dbg = NULL;
+static inline firm_dbg_module_t *get_dbg_module(void)
+{
+       static firm_dbg_module_t *dbg = NULL;
+       if(!dbg) {
+               dbg = firm_dbg_register("lpp.comm");
+       }
+
+       return dbg;
+}
+
+#define dbg get_dbg_module()
 
 /**
  * Try to read some bytes but block until a certain amount is read.