X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Firbackedge_t.h;h=808fdfc919856314da050c43cb6434771268c86d;hb=6f068af98daa4725d60e5d23a8f98ec2841cfa44;hp=4f3d9188f1a3f5bf01edb4e98586e969cb07de8a;hpb=45fa79efe8fc4f4a887f7f5243bed08597cc0865;p=libfirm diff --git a/ir/ana/irbackedge_t.h b/ir/ana/irbackedge_t.h index 4f3d9188f..808fdfc91 100644 --- a/ir/ana/irbackedge_t.h +++ b/ir/ana/irbackedge_t.h @@ -1,27 +1,45 @@ -#ifndef _IRBACKEDGE_T_H_ -#define _IRBACKEDGE_T_H_ +/* + * Copyright (C) 1995-2011 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. + */ -# include "string.h" +/** + * @file + * @brief Access function for backedges -- private header. + * @author Goetz Lindenmaier + * @date 7.2002 + * @version $Id$ + */ +#ifndef FIRM_ANA_IRBACKEDGE_T_H +#define FIRM_ANA_IRBACKEDGE_T_H -static INLINE int * new_backedge_arr(struct obstack *obst, int size) { - int *res = NEW_ARR_D (int, obst, size); - memset(res, 0, sizeof(int) * size); - return res; -} +/** + * Allocate a new backedge array on the obstack for given size. + * + * @param obst the obstack to allocate the array on + * @param size the size of the backedge array + */ +bitset_t *new_backedge_arr(struct obstack *obst, size_t size); +/** + * Adapts backedges array to new size. + * Must be called if the in array of an IR node is changed. Else + * Segmentation faults might occur. + */ +void fix_backedges(struct obstack *obst, ir_node *n); -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); -} - -#endif /* _IRBACKEDGE_T_H_ */ +#endif