X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Firbackedge_t.h;h=592f3b5b85c86b359c75890006cdaa238865b7db;hb=4bad1346ff2abc3923beea23e5ac949acc7ca514;hp=4f3d9188f1a3f5bf01edb4e98586e969cb07de8a;hpb=45fa79efe8fc4f4a887f7f5243bed08597cc0865;p=libfirm diff --git a/ir/ana/irbackedge_t.h b/ir/ana/irbackedge_t.h index 4f3d9188f..592f3b5b8 100644 --- a/ir/ana/irbackedge_t.h +++ b/ir/ana/irbackedge_t.h @@ -1,7 +1,19 @@ +/* + * Project: libFIRM + * File name: ir/ana/irbackedge_t.h + * Purpose: Access function for backedges -- private header. + * Author: Goetz Lindenmaier + * Modified by: + * Created: 7.2002 + * CVS-ID: $Id$ + * Copyright: (c) 2002-2003 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ + #ifndef _IRBACKEDGE_T_H_ #define _IRBACKEDGE_T_H_ -# include "string.h" +# include static INLINE int * new_backedge_arr(struct obstack *obst, int size) { int *res = NEW_ARR_D (int, obst, size); @@ -9,19 +21,9 @@ static INLINE int * new_backedge_arr(struct obstack *obst, int size) { return res; } - -static INLINE void fix_backedges(struct obstack *obst, ir_node *n) { - opcode opc = get_irn_opcode(n); - int ** arr = NULL; - if (opc == iro_Phi) arr = &n->attr.phi_backedge; - if ((opc == iro_Block) && !interprocedural_view) - arr = &n->attr.block.backedge; - if ((opc == iro_Block) && interprocedural_view) - arr = &n->attr.block.cg_backedge; - if (opc == iro_Filter) arr = &n->attr.filter.backedge; - - if (ARR_LEN(arr) != ARR_LEN(get_irn_in(n))-1) - *arr = new_backedge_arr(obst, ARR_LEN(get_irn_in(n))-1); -} +/* Adapts backedges array to new size. + Must be called if in array of irnode is changed. Else + Segmentation faults might occur. */ +void fix_backedges(struct obstack *obst, ir_node *n); #endif /* _IRBACKEDGE_T_H_ */