becopyilp: Inline struct size_red_t into struct ilp_env_t.
[libfirm] / ir / kaps / pbqp_edge.c
index 8a1d0c4..d016084 100644 (file)
@@ -1,20 +1,6 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
- *
  * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
 /**
@@ -22,7 +8,6 @@
  * @brief   PBQP edges.
  * @date    02.10.2008
  * @author  Sebastian Buchwald
- * @version $Id$
  */
 #include "config.h"
 
@@ -42,6 +27,9 @@ pbqp_edge_t *alloc_edge(pbqp_t *pbqp, int src_index, int tgt_index,
                         pbqp_matrix_t *costs)
 {
        int transpose = 0;
+       pbqp_edge_t *edge = OALLOC(&pbqp->obstack, pbqp_edge_t);
+       pbqp_node_t *src_node;
+       pbqp_node_t *tgt_node;
 
        if (tgt_index < src_index) {
                int tmp = src_index;
@@ -51,14 +39,9 @@ pbqp_edge_t *alloc_edge(pbqp_t *pbqp, int src_index, int tgt_index,
                transpose = 1;
        }
 
-       pbqp_edge_t *edge = OALLOC(&pbqp->obstack, pbqp_edge_t);
-       assert(edge);
+       src_node = get_node(pbqp, src_index);
 
-       pbqp_node_t *src_node = get_node(pbqp, src_index);
-       assert(src_node);
-
-       pbqp_node_t *tgt_node = get_node(pbqp, tgt_index);
-       assert(tgt_node);
+       tgt_node = get_node(pbqp, tgt_index);
 
        if (transpose) {
                edge->costs = pbqp_matrix_copy_and_transpose(pbqp, costs);
@@ -84,12 +67,8 @@ void delete_edge(pbqp_edge_t *edge)
        pbqp_node_t  *src_node;
        pbqp_node_t  *tgt_node;
 
-       assert(edge);
-
        src_node = edge->src;
        tgt_node = edge->tgt;
-       assert(src_node);
-       assert(tgt_node);
 
        disconnect_edge(src_node, edge);
        disconnect_edge(tgt_node, edge);
@@ -105,8 +84,6 @@ unsigned is_deleted(pbqp_edge_t *edge)
 {
        unsigned deleted;
 
-       assert(edge);
-
        deleted = (edge->src == NULL) && (edge-> tgt == NULL);
 
        return deleted;