X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fescape_ana.c;h=be3ee27c311f70314a2ec976e37566651d877858;hb=8c9921a1fc166552f6e416434fd8394a4fc210a3;hp=29e4e0fe298d4543b94fed0b77acdcd5a042d50e;hpb=b27ae245166bb695bc4e418ff416d91bc37d0f28;p=libfirm diff --git a/ir/opt/escape_ana.c b/ir/opt/escape_ana.c index 29e4e0fe2..be3ee27c3 100644 --- a/ir/opt/escape_ana.c +++ b/ir/opt/escape_ana.c @@ -17,21 +17,11 @@ * PURPOSE. */ -/* - * Project: libFIRM - * File name: ir/opt/escape_ana.c - * Purpose: escape analysis and optimization - * Author: Michael Beck - * Modified by: - * Created: 03.11.2005 - * CVS-ID: $Id$ - * Copyright: (c) 1999-2005 Universität Karlsruhe - */ - /** - * @file escape_ana.c - * - * A fast and simple Escape analysis. + * @file + * @author Michael Beck + * @date 03.11.2005 + * @brief A fast and simple Escape analysis. */ #include "config.h" @@ -66,7 +56,7 @@ typedef struct walk_env { } walk_env_t; /** debug handle */ -DEBUG_ONLY(firm_dbg_module_t *dbgHandle;) +DEBUG_ONLY(static firm_dbg_module_t *dbgHandle;) /** * checks whether a Raise leaves a method @@ -393,7 +383,7 @@ static void transform_allocs(ir_graph *irg, walk_env_t *env) mem = get_Alloc_mem(alloc); blk = get_nodes_block(alloc); - turn_into_tuple(alloc, pn_Alloc_max); + turn_into_tuple(alloc, pn_Alloc_max+1); set_Tuple_pred(alloc, pn_Alloc_M, mem); set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(blk)); set_Tuple_pred(alloc, pn_Alloc_X_except, new_r_Bad(irg, mode_X)); @@ -438,7 +428,7 @@ static void transform_allocs(ir_graph *irg, walk_env_t *env) sel = new_rd_simpleSel(dbg, get_nodes_block(alloc), get_irg_no_mem(irg), get_irg_frame(irg), ent); mem = get_Alloc_mem(alloc); - turn_into_tuple(alloc, pn_Alloc_max); + turn_into_tuple(alloc, pn_Alloc_max+1); set_Tuple_pred(alloc, pn_Alloc_M, mem); set_Tuple_pred(alloc, pn_Alloc_X_regular, new_r_Jmp(blk)); set_Tuple_pred(alloc, pn_Alloc_X_except, new_r_Bad(irg, mode_X)); @@ -461,7 +451,7 @@ static void transform_allocs(ir_graph *irg, walk_env_t *env) /* if allocs were removed somehow */ if (env->nr_removed && env->nr_deads) { /* exception control flow might have been changed */ - set_irg_doms_inconsistent(irg); + clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE); } } @@ -472,7 +462,6 @@ static void transform_allocs(ir_graph *irg, walk_env_t *env) static void transform_alloc_calls(ir_graph *irg, walk_env_t *env) { ir_node *call, *next, *mem, *blk; - ir_type *ftp; /* kill all dead allocs */ for (call = env->dead_allocs; call; call = next) { @@ -482,7 +471,7 @@ static void transform_alloc_calls(ir_graph *irg, walk_env_t *env) mem = get_Call_mem(call); blk = get_nodes_block(call); - turn_into_tuple(call, pn_Call_max); + turn_into_tuple(call, pn_Call_max+1); set_Tuple_pred(call, pn_Call_M, mem); set_Tuple_pred(call, pn_Call_X_regular, new_r_Jmp(blk)); set_Tuple_pred(call, pn_Call_X_except, new_r_Bad(irg, mode_X)); @@ -492,7 +481,6 @@ static void transform_alloc_calls(ir_graph *irg, walk_env_t *env) } /* convert all non-escaped heap allocs into frame variables */ - ftp = get_irg_frame_type(irg); for (call = env->found_allocs; call; call = next) { next = (ir_node*)get_irn_link(call); } @@ -510,7 +498,7 @@ void escape_enalysis_irg(ir_graph *irg, check_alloc_entity_func callback) return; } - if (get_irg_outs_state(irg) != outs_consistent) + if (is_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_OUTS)) compute_irg_outs(irg); env.found_allocs = NULL;