/*
- * 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.
*/
/**
* @brief PBQP edges.
* @date 02.10.2008
* @author Sebastian Buchwald
- * @version $Id$
*/
#include "config.h"
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;
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);
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);
{
unsigned deleted;
- assert(edge);
-
deleted = (edge->src == NULL) && (edge-> tgt == NULL);
return deleted;