X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Fpseudo_irg.c;h=8968d2fd560641f25b42a12f53a8b95f41ff7cd6;hb=af9b9a12e6cd2aaf7a0d71c262f068a516a8735f;hp=fdc3e2eec26e97dfb184b3c519af1b69ebb7cbf9;hpb=75bba3420ce91776ab8690b6cd3fc9ad1c5be965;p=libfirm diff --git a/ir/ir/pseudo_irg.c b/ir/ir/pseudo_irg.c index fdc3e2eec..8968d2fd5 100644 --- a/ir/ir/pseudo_irg.c +++ b/ir/ir/pseudo_irg.c @@ -1,20 +1,30 @@ -/* -*- c -*- */ - /* - * Project: libFIRM - * File name: ir/external/pseudo_irg.c - * Purpose: implementation - * Author: G"otz Lindenmaier - * Modified by: Boris Boesler - * Created: xx.10.2004 - * CVS-ID: $Id$ - * Copyright: (c) 1999-2004 Universität Karlsruhe - * Licence: This file is 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. */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +/** + * @file + * @brief pseudo irg implementation + * @author Goetz Lindenmaier, Boris Boesler + * @date Oktober 2004 + * @version $Id$ + */ +#include "config.h" #include "pseudo_irg.h" @@ -26,19 +36,19 @@ /* Returns the number of pseudo graphs in the program. */ int get_irp_n_pseudo_irgs(void) { - assert (irp && irp->pseudo_graphs); - return ARR_LEN(irp->pseudo_graphs); + assert (irp && irp->pseudo_graphs); + return ARR_LEN(irp->pseudo_graphs); } /* Returns the pos'th pseudo graph in the program. */ ir_graph *get_irp_pseudo_irg(int pos) { - assert(0 <= pos && pos <= get_irp_n_pseudo_irgs()); - return irp->pseudo_graphs[pos]; + assert(0 <= pos && pos <= get_irp_n_pseudo_irgs()); + return irp->pseudo_graphs[pos]; } void add_irp_pseudo_irg(ir_graph *irg) { - assert (irp && irp->pseudo_graphs); - ARR_APP1(ir_graph *, irp->pseudo_graphs, irg); + assert (irp && irp->pseudo_graphs); + ARR_APP1(ir_graph *, irp->pseudo_graphs, irg); } @@ -49,32 +59,32 @@ void add_irp_pseudo_irg(ir_graph *irg) { */ ir_graph * new_pseudo_ir_graph(ir_entity *ent, int n_loc) { - ir_graph *res = new_r_ir_graph (ent, n_loc); - add_irp_pseudo_irg(res); /* remember this graph global. */ - return res; + ir_graph *res = new_r_ir_graph(ent, n_loc); + add_irp_pseudo_irg(res); /* remember this graph global. */ + return res; } /* Returns non-zero ir ir_graph is pseudo graph. */ -int is_pseudo_ir_graph(ir_graph *irg) -{ - int i, n_pseudo_irgs; - - assert(irg && "nothing here"); - assert(is_ir_graph(irg) && "no ir_graph given"); - - n_pseudo_irgs = get_irp_n_pseudo_irgs(); - for (i = 0; i < n_pseudo_irgs; ++i) { - if (irg == get_irp_pseudo_irg(i)) return 1; - } - return 0; +int is_pseudo_ir_graph(ir_graph *irg) { + int i, n_pseudo_irgs; + + assert(irg && "nothing here"); + assert(is_ir_graph(irg) && "no ir_graph given"); + + n_pseudo_irgs = get_irp_n_pseudo_irgs(); + for (i = 0; i < n_pseudo_irgs; ++i) { + if (irg == get_irp_pseudo_irg(i)) + return 1; + } + return 0; } static int visit_pseudo_irgs = 0; void set_visit_pseudo_irgs(int x) { - visit_pseudo_irgs = x; + visit_pseudo_irgs = x; } int get_visit_pseudo_irgs(void) { - return visit_pseudo_irgs; + return visit_pseudo_irgs; }