X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firedges_t.h;h=b0afdce27998332abb90c5cda952da41dbf55266;hb=f600524c363556c785b85c0dff8792d04f73e252;hp=40ab9ddf1d0f9689fe18905b715446201f7ca4fc;hpb=a953ba0dad38aea06301d00e215829a909c1ffe7;p=libfirm diff --git a/ir/ir/iredges_t.h b/ir/ir/iredges_t.h index 40ab9ddf1..b0afdce27 100644 --- a/ir/ir/iredges_t.h +++ b/ir/ir/iredges_t.h @@ -1,22 +1,31 @@ /* - * Project: libFIRM - * File name: ir/ir/iredges_t.h - * Purpose: Everlasting outs -- private header. - * Author: Sebastian Hack - * Created: 15.01.2005 - * CVS-ID: $Id$ - * Copyright: (c) 1998-2005 Universit�t Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + * 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. */ /** - * everlasting outs. - * @author Sebastian Hack - * @date 15.1.2005 + * @file + * @brief Everlasting outs -- private header. + * @author Sebastian Hack, Andreas Schoesser + * @date 15.01.2005 + * @version $Id$ */ - -#ifndef _FIRM_EDGES_T_H -#define _FIRM_EDGES_T_H +#ifndef FIRM_IR_EDGES_T_H +#define FIRM_IR_EDGES_T_H #include "firm_config.h" #include "debug.h" @@ -36,14 +45,15 @@ * An edge. */ struct _ir_edge_t { - ir_node *src; /**< The source node of the edge. */ - int pos; /**< The position of the edge at @p src. */ + ir_node *src; /**< The source node of the edge. */ + int pos; /**< The position of the edge at @p src. */ unsigned invalid : 1; /**< edges that are removed are marked invalid. */ unsigned present : 1; /**< Used by the verifier. Don't rely on its content. */ unsigned kind : 4; /**< The kind of the edge. */ struct list_head list; /**< The list head to queue all out edges at a node. */ #ifdef DEBUG_libfirm long src_nr; /**< The node number of the source node. */ + long edge_nr; /**< A unique number identifying the edge. */ #endif }; @@ -93,14 +103,14 @@ static INLINE const ir_edge_t *_get_irn_out_edge_next(const ir_node *irn, const static INLINE int _get_irn_n_edges_kind(const ir_node *irn, int kind) { /* Perhaps out_count was buggy. This code does it more safely. */ -#if 1 +#if 0 int res = 0; const struct list_head *pos, *head = _get_irn_outs_head(irn, kind); list_for_each(pos, head) res++; return res; #else - return _get_irn_edge_info(irn)->out_count; + return _get_irn_edge_info(irn, kind)->out_count; #endif } @@ -119,8 +129,6 @@ static INLINE void _edges_assure_kind(ir_graph *irg, int kind) edges_activate_kind(irg, kind); } -void edges_reroute_kind(ir_node *old, ir_node *nw, ir_edge_kind_t kind, ir_graph *irg); - void edges_init_graph_kind(ir_graph *irg, ir_edge_kind_t kind); /** @@ -174,6 +182,11 @@ static INLINE int _get_edge_src_pos(const ir_edge_t *edge) */ extern void init_edges(void); +/** + * Set dbg information for edges. + */ +void edges_init_dbg(int do_dbg); + void edges_invalidate_all(ir_node *irn, ir_graph *irg); #define get_irn_n_edges_kind(irn, kind) _get_irn_n_edges_kind(irn, kind) @@ -183,21 +196,19 @@ void edges_invalidate_all(ir_node *irn, ir_graph *irg); #define get_irn_out_edge_next(irn, last) _get_irn_out_edge_next(irn, last) #ifndef get_irn_n_edges -#define get_irn_n_edges(irn) _get_irn_n_edges_kind(irn, EDGE_KIND_NORMAL) +#define get_irn_n_edges(irn) _get_irn_n_edges_kind(irn, EDGE_KIND_NORMAL) #endif #ifndef get_irn_out_edge_first -#define get_irn_out_edge_first(irn) _get_irn_out_edge_first_kind(irn, EDGE_KIND_NORMAL) +#define get_irn_out_edge_first(irn) _get_irn_out_edge_first_kind(irn, EDGE_KIND_NORMAL) #endif #ifndef get_block_succ_first -#define get_block_succ_first(irn) _get_irn_out_edge_first_kind(irn, EDGE_KIND_BLOCK) +#define get_block_succ_first(irn) _get_irn_out_edge_first_kind(irn, EDGE_KIND_BLOCK) #endif #ifndef get_block_succ_next -#define get_block_succ_next(irn, last) _get_irn_out_edge_next(irn, last) +#define get_block_succ_next(irn, last) _get_irn_out_edge_next(irn, last) #endif - - -#endif /* _FIRM_EDGES_T_H */ +#endif