X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Flower%2Flower_calls.c;h=606d9f77be2852ea4035c4937a8e893ba36f0d07;hb=77105a553a245389095f3849d2143cb90b5d77ff;hp=9555706b35e8d66f2a8439b8e94c8962c51e1107;hpb=75bba3420ce91776ab8690b6cd3fc9ad1c5be965;p=libfirm diff --git a/ir/lower/lower_calls.c b/ir/lower/lower_calls.c index 9555706b3..606d9f77b 100644 --- a/ir/lower/lower_calls.c +++ b/ir/lower/lower_calls.c @@ -1,25 +1,34 @@ /* - * Project: libFIRM - * File name: ir/lower/lower_calls.c - * Purpose: lowering of Calls with compound parameters - * Author: Michael Beck - * Created: - * CVS-ID: $Id$ - * Copyright: (c) 1998-2005 Universität Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + * Copyright (C) 1995-2007 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. + */ + +/** + * @file + * @brief Lowering of Calls with compound parameters and return types. + * @author Michael Beck + * @version $Id$ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#ifdef HAVE_ALLOCA_H -#include -#endif -#ifdef HAVE_MALLOC_H -#include -#endif - +#include "lowering.h" #include "irprog_t.h" #include "irnode_t.h" #include "type_t.h" @@ -27,12 +36,11 @@ #include "ircons.h" #include "irgmod.h" #include "irgwalk.h" -#include "typewalk.h" -#include "lower_calls.h" -#include "return.h" #include "irtools.h" +#include "iroptimize.h" #include "array.h" #include "pmap.h" +#include "xmalloc.h" /** A type map for def_find_pointer_type. */ static pmap *type_map; @@ -390,7 +398,7 @@ static ir_node *get_dummy_sel(ir_graph *irg, ir_node *block, ir_type *tp, wlk_en */ static void add_hidden_param(ir_graph *irg, int n_com, ir_node **ins, cl_entry *entry, wlk_env *env) { - ir_node *p, *n, *src, *mem; + ir_node *p, *n, *src, *mem, *blk; ir_entity *ent; ir_type *owner; int idx, n_args; @@ -418,12 +426,14 @@ static void add_hidden_param(ir_graph *irg, int n_com, ir_node **ins, cl_entry * ins[idx] = get_CopyB_dst(p); mem = get_CopyB_mem(p); + blk = get_nodes_block(p); /* get rid of the CopyB */ turn_into_tuple(p, pn_CopyB_max); set_Tuple_pred(p, pn_CopyB_M_regular, mem); - set_Tuple_pred(p, pn_CopyB_M_except, get_irg_bad(irg)); - set_Tuple_pred(p, pn_CopyB_X_except, get_irg_bad(irg)); + set_Tuple_pred(p, pn_CopyB_M_except, get_irg_bad(irg)); + set_Tuple_pred(p, pn_CopyB_X_regular, new_r_Jmp(irg, blk)); + set_Tuple_pred(p, pn_CopyB_X_except, get_irg_bad(irg)); ++n_args; }