be: remove unused reg_class_for_mode callback
[libfirm] / ir / lpp / lpp.c
index 559b012..2d2c8a9 100644 (file)
@@ -32,6 +32,7 @@
 #include "hashptr.h"
 #include "debug.h"
 #include "set.h"
+#include "debug.h"
 
 #include "sp_matrix.h"
 #include "mps.h"
@@ -42,7 +43,7 @@
 
 #define HASH_NAME_T(n) HASH_STR((n)->name, strlen((n)->name))
 
-static firm_dbg_module_t *dbg = NULL;
+DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
 
 static inline char *obst_xstrdup(struct obstack *obst, const char *str)
 {
@@ -67,18 +68,19 @@ static void update_stats(lpp_t *lpp)
        lpp->density    = (double)lpp->n_elems / (double)(lpp->cst_next * lpp->var_next) * 100.0;
 }
 
-lpp_t *new_lpp(const char *name, lpp_opt_t opt_type)
+lpp_t *lpp_new(const char *name, lpp_opt_t opt_type)
 {
-       return new_lpp_userdef(name, opt_type, 64, 64, 2.0);
+       return lpp_new_userdef(name, opt_type, 64, 64, 2.0);
 }
 
-lpp_t *new_lpp_userdef(const char *name, lpp_opt_t opt_type,
-                          int estimated_vars, int estimated_csts, double grow_factor)
+lpp_t *lpp_new_userdef(const char *name, lpp_opt_t opt_type,
+                                  int estimated_vars, int estimated_csts,
+                                  double grow_factor)
 {
        lpp_t *lpp;
        int   idx;
 
-       dbg = firm_dbg_register("lpp");
+       DEBUG_ONLY(dbg = firm_dbg_register("lpp");)
        lpp = XMALLOCZ(lpp_t);
        obstack_init(&lpp->obst);
 
@@ -101,13 +103,13 @@ lpp_t *new_lpp_userdef(const char *name, lpp_opt_t opt_type,
        return lpp;
 }
 
-void free_lpp_matrix(lpp_t *lpp)
+void lpp_free_matrix(lpp_t *lpp)
 {
        del_matrix(lpp->m);
        lpp->m = NULL;
 }
 
-void free_lpp(lpp_t *lpp)
+void lpp_free(lpp_t *lpp)
 {
        obstack_free(&lpp->obst, NULL);
 
@@ -362,14 +364,14 @@ void lpp_check_startvals(lpp_t *lpp)
                                        fprintf(stderr, "constraint %s unsatisfied: %g != %g\n", cst->name, sum, cst_val);
                                }
                                break;
-                       case lpp_less:
+                       case lpp_less_equal:
                                if(sum > cst_val) {
-                                       fprintf(stderr, "constraint %s unsatisfied: %g > %g\n", cst->name, sum, cst_val);
+                                       fprintf(stderr, "constraint %s unsatisfied: %g >= %g\n", cst->name, sum, cst_val);
                                }
                                break;
-                       case lpp_greater:
+                       case lpp_greater_equal:
                                if(sum < cst_val) {
-                                       fprintf(stderr, "constraint %s unsatisfied: %g < %g\n", cst->name, sum, cst_val);
+                                       fprintf(stderr, "constraint %s unsatisfied: %g <= %g\n", cst->name, sum, cst_val);
                                }
                                break;
                        default:
@@ -397,9 +399,9 @@ static const char *lpp_cst_op_to_str(lpp_cst_t cst)
        switch(cst) {
        case lpp_equal:
                return "=";
-       case lpp_less:
+       case lpp_less_equal:
                return "<=";
-       case lpp_greater:
+       case lpp_greater_equal:
                return ">=";
        default:
                return "";