X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbecopyilp.c;h=3e2469e2ca4e8010c57948cda09ca89180056007;hb=ca1b1615fbe23a4d5cf72e7be5d2ee831615cbc2;hp=ee1a6f3ceacf39f4145054f453d3e49399e9d825;hpb=87d3e7eba011a02e25e216fc299dd41f82d6e30d;p=libfirm diff --git a/ir/be/becopyilp.c b/ir/be/becopyilp.c index ee1a6f3ce..3e2469e2c 100644 --- a/ir/be/becopyilp.c +++ b/ir/be/becopyilp.c @@ -8,6 +8,12 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif /* HAVE_CONFIG_H */ + +#ifdef WITH_ILP + #include "becopyilp_t.h" #include "beifg_t.h" @@ -23,7 +29,7 @@ size_red_t *new_size_red(copy_opt_t *co) { - size_red_t *res = malloc(sizeof(*res)); + size_red_t *res = xmalloc(sizeof(*res)); res->co = co; res->all_removed = pset_new_ptr_default(); @@ -137,7 +143,7 @@ void free_size_red(size_red_t *sr) { #include ilp_env_t *new_ilp_env(copy_opt_t *co, ilp_callback build, ilp_callback apply, void *env) { - ilp_env_t *res = malloc(sizeof(*res)); + ilp_env_t *res = xmalloc(sizeof(*res)); assert(res); res->co = co; @@ -152,13 +158,14 @@ ilp_env_t *new_ilp_env(copy_opt_t *co, ilp_callback build, ilp_callback apply, v lpp_sol_state_t ilp_go(ilp_env_t *ienv) { FILE *f; char buf[256]; + be_main_env_t *main_env = ienv->co->cenv->birg->main_env; sr_remove(ienv->sr); ienv->build(ienv); #ifdef LPP_SOLVE_NET - lpp_solve_net(ienv->lp, LPP_HOST, LPP_SOLVER); + lpp_solve_net(ienv->lp, main_env->options->ilp_server, main_env->options->ilp_solver); #else lpp_solve_cplex(ienv->lp); #endif @@ -180,3 +187,10 @@ void free_ilp_env(ilp_env_t *ienv) { free_lpp(ienv->lp); free(ienv); } + +#else /* WITH_ILP */ + +static void only_that_you_can_compile_without_WITH_ILP_defined(void) { +} + +#endif /* WITH_ILP */