ia32: Remove (empty) emitters from nodes, which should never be emitted.
[libfirm] / ir / kaps / kaps.c
index 78b4c0d..7205cd9 100644 (file)
@@ -22,7 +22,6 @@
  * @brief   Partitioned Boolean Quadratic Problem (PBQP) solver.
  * @date    02.10.2008
  * @author  Sebastian Buchwald
- * @version $Id$
  */
 #include "config.h"
 
@@ -44,8 +43,10 @@ pbqp_node_t *get_node(pbqp_t *pbqp, unsigned index)
 
 pbqp_edge_t *get_edge(pbqp_t *pbqp, unsigned src_index, unsigned tgt_index)
 {
-       int i;
-       int len;
+       size_t i;
+       size_t len;
+       pbqp_node_t *src_node;
+       pbqp_node_t *tgt_node;
 
        if (tgt_index < src_index) {
                unsigned tmp = src_index;
@@ -53,8 +54,8 @@ pbqp_edge_t *get_edge(pbqp_t *pbqp, unsigned src_index, unsigned tgt_index)
                tgt_index    = tmp;
        }
 
-       pbqp_node_t *src_node = get_node(pbqp, src_index);
-       pbqp_node_t *tgt_node = get_node(pbqp, tgt_index);
+       src_node = get_node(pbqp, src_index);
+       tgt_node = get_node(pbqp, tgt_index);
        assert(tgt_node);
 
        len = ARR_LEN(src_node->edges);
@@ -77,7 +78,7 @@ pbqp_t *alloc_pbqp(unsigned number_nodes)
 
        pbqp->solution = 0;
        pbqp->num_nodes = number_nodes;
-#if    KAPS_DUMP
+#if KAPS_DUMP
        pbqp->dump_file = NULL;
 #endif
        pbqp->nodes = OALLOCNZ(&pbqp->obstack, pbqp_node_t*, number_nodes);
@@ -124,7 +125,7 @@ void add_edge_costs(pbqp_t *pbqp, unsigned src_index, unsigned tgt_index,
        }
 
        if (edge == NULL) {
-               edge = alloc_edge(pbqp, src_index, tgt_index, costs);
+               alloc_edge(pbqp, src_index, tgt_index, costs);
        } else {
                pbqp_matrix_add(edge->costs, costs);
        }
@@ -142,7 +143,7 @@ num get_solution(pbqp_t *pbqp)
        return pbqp->solution;
 }
 
-#if    KAPS_DUMP
+#if KAPS_DUMP
 void set_dumpfile(pbqp *pbqp, FILE *f)
 {
        pbqp->dump_file = f;