X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Flower%2Flower_calls.c;h=b222e2c47a4c9687ff4f5723aa99ccb8cda07b6f;hb=f3b034366a1be7a8ee7f743d673b0343af79772c;hp=1b2f23156a8404f4d49a9cf3ec8f39b4842682c9;hpb=1db8368bacb40c8d2e7d3223788d87bd0f8ba78b;p=libfirm diff --git a/ir/lower/lower_calls.c b/ir/lower/lower_calls.c index 1b2f23156..b222e2c47 100644 --- a/ir/lower/lower_calls.c +++ b/ir/lower/lower_calls.c @@ -1,25 +1,33 @@ /* - * 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 "irprog_t.h" #include "irnode_t.h" #include "type_t.h" @@ -33,6 +41,7 @@ #include "irtools.h" #include "array.h" #include "pmap.h" +#include "xmalloc.h" /** A type map for def_find_pointer_type. */ static pmap *type_map; @@ -297,7 +306,7 @@ static void fix_args_and_collect_calls(ir_node *n, void *ctx) { */ static int is_compound_address(ir_type *ft, ir_node *adr) { - entity *ent; + ir_entity *ent; if (! is_Sel(adr)) return 0; @@ -309,7 +318,7 @@ static int is_compound_address(ir_type *ft, ir_node *adr) /** A pair for the copy-return-optimization. */ typedef struct cr_pair { - entity *ent; /**< the entity than can be removed from the frame */ + ir_entity *ent; /**< the entity than can be removed from the frame */ ir_node *arg; /**< the argument that replaces the entities address */ } cr_pair; @@ -326,7 +335,7 @@ static void do_copy_return_opt(ir_node *n, void *ctx) { int i; if (is_Sel(n)) { - entity *ent = get_Sel_entity(n); + ir_entity *ent = get_Sel_entity(n); for (i = ARR_LEN(arr) - 1; i >= 0; --i) { if (ent == arr[i].ent) { @@ -351,7 +360,7 @@ static void do_copy_return_opt(ir_node *n, void *ctx) { */ static ir_node *get_dummy_sel(ir_graph *irg, ir_node *block, ir_type *tp, wlk_env *env) { - entity *ent; + ir_entity *ent; pmap_entry *e; /* use a map the check if we already create such an entity */ @@ -391,7 +400,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; - entity *ent; + ir_entity *ent; ir_type *owner; int idx, n_args; @@ -511,9 +520,9 @@ static void fix_call_list(ir_graph *irg, wlk_env *env) { */ static void transform_irg(const lower_params_t *lp, ir_graph *irg) { - entity *ent = get_irg_entity(irg); + ir_entity *ent = get_irg_entity(irg); ir_type *mtp, *lowered_mtp, *tp, *ft; - int i, j, k, n_ress, n_ret_com, n_cr_opt; + int i, j, k, n_ress = 0, n_ret_com = 0, n_cr_opt; ir_node **new_in, *ret, *endbl, *bl, *mem, *copy; cr_pair *cr_opt; wlk_env env; @@ -696,7 +705,7 @@ static void lower_method_types(type_or_ent *tore, void *env) /* fix method entities */ if (is_entity(tore)) { - entity *ent = (entity *)tore; + ir_entity *ent = (ir_entity *)tore; tp = get_entity_type(ent); if (must_be_lowered(lp, tp)) {