X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Firsimpletype.c;h=87ad75f8a3d9d052dc94b572de123c9961e8a636;hb=cf79ddfe6713891acdc41aa3ecd5f5a61034ee94;hp=eab5b91c2e61554713ba2d5ce244685e1bc63e1b;hpb=ed9c74ceca0655fb484f0537dbea43afa2ca0a7e;p=libfirm diff --git a/ir/ana/irsimpletype.c b/ir/ana/irsimpletype.c index eab5b91c2..87ad75f8a 100644 --- a/ir/ana/irsimpletype.c +++ b/ir/ana/irsimpletype.c @@ -1,39 +1,49 @@ /* - * File name: ir/ana/irsimpletype.c - * Purpose: Run most simple type analyses. - * Author: Goetz Lindenmaier - * Modified by: - * Created: 22.8.2003 - * CVS-ID: $Id$ - * Copyright: (c) 2003 Universität Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. - */ - -/** - * @file irsimpletype.c + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * - * Runs most simple type analyses. + * This file is part of libFirm. * - * We compute type information for each node. It is derived from the - * types of the origines of values, e.g. parameter types can be derived - * from the method type. - * The type information so far is saved in the link field. + * 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. * - * @author Goetz Lindenmaier + * 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. */ +/** + * @file + * @brief Run most simple type analyses. + * @author Goetz Lindenmaier + * @date 22.8.2003 + * @version $Id$ + * @summary + * Runs most simple type analyses. + * + * We compute type information for each node. It is derived from the + * types of the origines of values, e.g. parameter types can be derived + * from the method type. + * The type information so far is saved in the link field. + */ #ifdef HAVE_CONFIG_H # include "config.h" #endif -# include "irtypeinfo.h" -# include "irsimpletype.h" +#include "irtypeinfo.h" +#include "irsimpletype.h" -# include "irnode_t.h" -# include "irprog_t.h" -# include "irgwalk.h" -# include "ident.h" -# include "trouts.h" +#include "irnode_t.h" +#include "irprog_t.h" +#include "irgwalk.h" +#include "ident.h" +#include "trouts.h" +#include "error.h" #define VERBOSE_UNKNOWN_TYPE(s) printf s @@ -113,7 +123,7 @@ static ir_type *find_type_for_Proj(ir_node *n) { ir_type *mtp = get_Call_type(pred_pred); tp = get_method_res_type(mtp, get_Proj_proj(n)); } else if (get_irn_op(pred_pred) == op_Tuple) { - assert(0 && "Encountered nested Tuple"); + panic("Encountered nested Tuple"); } else { VERBOSE_UNKNOWN_TYPE(("Proj %ld from Proj from ??: unknown type\n", get_irn_node_nr(n))); tp = firm_unknown_type; @@ -387,12 +397,10 @@ default_code: { break; } - printf(" not implemented: "); DDMN(n); + panic(" not implemented: %+F", n); } break; /* default */ } /* end switch */ - /* printf (" found %s ", get_type_name(tp)); DDM; */ - return tp; } @@ -405,8 +413,6 @@ static ir_type *compute_irn_type(ir_node *n) { set_irn_typeinfo_type(n, tp); } - /* printf (" found %s ", get_type_name(tp)); DDM; */ - return tp; } @@ -419,6 +425,7 @@ static ir_type *compute_irn_type(ir_node *n) { static void compute_type(ir_node *n, void *env) { ir_type *tp = get_irn_typeinfo_type(n); + (void) env; if (tp == phi_cycle_type) { /* printf(" recomputing for phi_cycle_type "); DDMN(n); */ set_irn_typeinfo_type(n, initial_type); @@ -449,7 +456,7 @@ static void init_irsimpletype(void) { void simple_analyse_types(void) { int i; init_irsimpletype(); - for (i = 0; i < get_irp_n_irgs(); i++) { + for (i = get_irp_n_irgs() - 1; i >= 0; --i) { ir_graph *irg = get_irp_irg(i); analyse_irg(irg); }