X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbessadestrsimple.c;h=2c80476cdbb4327bc30e30f91adc6c84d7e3622d;hb=5efe7ce7c1754fb95defcc569412b2498fcfe436;hp=8c84b201169835c09955f440c73c6ea777c09020;hpb=6981dd3274e6753e50f66c8cbe17b37bd41708e5;p=libfirm diff --git a/ir/be/bessadestrsimple.c b/ir/be/bessadestrsimple.c index 8c84b2011..2c80476cd 100644 --- a/ir/be/bessadestrsimple.c +++ b/ir/be/bessadestrsimple.c @@ -1,22 +1,32 @@ -/** - * Author: Daniel Grund - * Date: 17.01.2006 - * Copyright: (c) Universitaet Karlsruhe - * Licence: This file 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. */ +/** + * @file + * @brief Simple SSA destruction. + * @author Daniel Grund + * @date 17.01.2006 + * @version $Id$ + */ +#ifdef NOT_PORTED -#ifdef HAVE_CONFIG_H #include "config.h" -#endif - -#ifdef HAVE_MALLOC_H - #include -#endif -#ifdef HAVE_ALLOCA_H - #include -#endif #include #include @@ -35,9 +45,8 @@ #include "irdom_t.h" #include "phiclass.h" -#include "beraextern.h" #include "beabi.h" -#include "bearch.h" +#include "bearch_t.h" #include "benode_t.h" #include "beirgmod.h" #include "besched_t.h" @@ -52,7 +61,6 @@ typedef struct _ssa_destr_env_t { ir_graph *irg; const arch_register_class_t *cls; - const arch_env_t *aenv; set *vars; } ssa_destr_env_t; @@ -129,7 +137,7 @@ pset *be_get_var_values(set *vars, int var_nr) { return vi->values; } -static INLINE ir_node *get_first_phi(ir_node **s) { +static inline ir_node *get_first_phi(ir_node **s) { int i; for (i = ARR_LEN(s) - 1; i >= 0; --i) { @@ -152,7 +160,7 @@ static void values_to_vars(ir_node *irn, void *env) { int nr, i, build_vals = 0; ir_node **vals; - if (arch_get_irn_reg_class(sde->aenv, irn, -1) == NULL) + if (arch_get_irn_reg_class_out(irn) == NULL) return; vals = get_phi_class(pc, irn); @@ -229,7 +237,7 @@ static ir_node *insert_copies(ssa_destr_env_t *sde, const arch_register_class_t /* In case this is a 'normal' phi we insert at the * end of the pred block before cf nodes */ - last_cpy = sched_skip(pred_blk, 0, sched_skip_cf_predicator, (void *)sde->aenv); + last_cpy = sched_skip(pred_blk, 0, sched_skip_cf_predicator, NULL); last_cpy = sched_next(last_cpy); /* If we detect a loop stop recursion. */ @@ -286,21 +294,21 @@ static void ssa_destr_simple_walker(ir_node *blk, void *env) { if (!is_Phi(phi)) break; - if (arch_irn_is(sde->aenv, phi, ignore)) + if (arch_irn_is(phi, ignore)) continue; - cls = arch_get_irn_reg_class(sde->aenv, phi, -1); + cls = arch_get_irn_reg_class_out(phi); insert_copies(sde, cls, phi, pos, phi); } } } -set *be_ssa_destr_simple(ir_graph *irg, const arch_env_t *aenv) { +set *be_ssa_destr_simple(ir_graph *irg) +{ ssa_destr_env_t sde; sde.irg = irg; - sde.aenv = aenv; sde.vars = new_set(compare_var_infos, 16); be_clear_links(irg); @@ -324,3 +332,5 @@ void free_ssa_destr_simple(set *vars) del_set(vars); phi_class_free(pc); } + +#endif /* NOT_PORTED */