Fixed register allocation for fp != sp
[libfirm] / ir / be / becopyilp.c
index ee1a6f3..3e2469e 100644 (file)
@@ -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 <stdio.h>
 
 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 */