X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firedges_t.h;h=d82e8a6c68a06040065a299aad17134942ee20df;hb=202b43933e0cc0b71cc7fbe2b092b94efb7fd30e;hp=4fc592091b715ac235d7a06a2dc1ab8ba24e75ef;hpb=eb08138c6b80c169945568e4414f491a9bc20388;p=libfirm diff --git a/ir/ir/iredges_t.h b/ir/ir/iredges_t.h index 4fc592091..d82e8a6c6 100644 --- a/ir/ir/iredges_t.h +++ b/ir/ir/iredges_t.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -17,27 +17,16 @@ * PURPOSE. */ -/* - * Project: libFIRM - * File name: ir/ir/iredges_t.h - * Purpose: Everlasting outs -- private header. - * Author: Sebastian Hack - * Modified by: Andreas Schoesser - * Created: 15.01.2005 - * CVS-ID: $Id$ - * Copyright: (c) 1998-2005 Universit�t Karlsruhe - */ - /** - * 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_IR_EDGES_T_H +#define FIRM_IR_EDGES_T_H -#ifndef _FIRM_EDGES_T_H -#define _FIRM_EDGES_T_H - -#include "firm_config.h" #include "debug.h" #include "set.h" @@ -55,15 +44,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. */ - 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. */ + 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. */ + long src_nr; /**< The node number of the source node. */ + long edge_nr; /**< A unique number identifying the edge. */ #endif }; @@ -87,9 +76,11 @@ struct _ir_edge_t { * @param irn The node. * @return The first out edge that points to this node. */ -static INLINE const ir_edge_t *_get_irn_out_edge_first_kind(const ir_node *irn, ir_edge_kind_t kind) +static inline const ir_edge_t *_get_irn_out_edge_first_kind(const ir_node *irn, ir_edge_kind_t kind) { - const struct list_head *head = _get_irn_outs_head(irn, kind); + const struct list_head *head; + assert(edges_activated_kind(get_irn_irg(irn), kind)); + head = _get_irn_outs_head(irn, kind); return list_empty(head) ? NULL : list_entry(head->next, ir_edge_t, list); } @@ -99,7 +90,7 @@ static INLINE const ir_edge_t *_get_irn_out_edge_first_kind(const ir_node *irn, * @param last The last out edge you have seen. * @return The next out edge in @p irn 's out list after @p last. */ -static INLINE const ir_edge_t *_get_irn_out_edge_next(const ir_node *irn, const ir_edge_t *last) +static inline const ir_edge_t *_get_irn_out_edge_next(const ir_node *irn, const ir_edge_t *last) { struct list_head *next = last->list.next; return next == _get_irn_outs_head(irn, last->kind) ? NULL : list_entry(next, ir_edge_t, list); @@ -110,7 +101,7 @@ static INLINE const ir_edge_t *_get_irn_out_edge_next(const ir_node *irn, const * @param irn The node. * @return The number of edges pointing to this node. */ -static INLINE int _get_irn_n_edges_kind(const ir_node *irn, int kind) +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 0 @@ -124,7 +115,7 @@ static INLINE int _get_irn_n_edges_kind(const ir_node *irn, int kind) #endif } -static INLINE int _edges_activated_kind(const ir_graph *irg, ir_edge_kind_t kind) +static inline int _edges_activated_kind(const ir_graph *irg, ir_edge_kind_t kind) { return _get_irg_edge_info(irg, kind)->activated; } @@ -133,7 +124,7 @@ static INLINE int _edges_activated_kind(const ir_graph *irg, ir_edge_kind_t kind * Assure, that the edges information is present for a certain graph. * @param irg The graph. */ -static INLINE void _edges_assure_kind(ir_graph *irg, int kind) +static inline void _edges_assure_kind(ir_graph *irg, int kind) { if(!_edges_activated_kind(irg, kind)) edges_activate_kind(irg, kind); @@ -171,17 +162,17 @@ int edges_register_private_data(size_t n); * edges_register_private_data(). * @return A pointer to the private data. */ -static INLINE void *_get_edge_private_data(const ir_edge_t *edge, int ofs) +static inline void *_get_edge_private_data(const ir_edge_t *edge, int ofs) { return (void *) ((char *) edge + sizeof(edge[0]) + ofs); } -static INLINE ir_node *_get_edge_src_irn(const ir_edge_t *edge) +static inline ir_node *_get_edge_src_irn(const ir_edge_t *edge) { return edge->src; } -static INLINE int _get_edge_src_pos(const ir_edge_t *edge) +static inline int _get_edge_src_pos(const ir_edge_t *edge) { return edge->pos; } @@ -221,6 +212,4 @@ void edges_invalidate_all(ir_node *irn, ir_graph *irg); #define get_block_succ_next(irn, last) _get_irn_out_edge_next(irn, last) #endif - - -#endif /* _FIRM_EDGES_T_H */ +#endif