X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fescape_ana.c;h=cba1a581ea665c1a14c9d4d06a0f7d8782ef5cf2;hb=04d455ab69c9d1549305ccbd6f97eb802db91ff4;hp=901ac42a40bdf3f871cf1290f70638907edfd7fe;hpb=b7dd849f8dd4bf73629adffec3fbe19bed0e458b;p=libfirm diff --git a/ir/opt/escape_ana.c b/ir/opt/escape_ana.c index 901ac42a4..cba1a581e 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 @@ -202,7 +192,7 @@ static int can_escape(ir_node *n) size_t j; ent = get_Call_callee(succ, --k); - if (ent == unknown_entity) { + if (is_unknown_entity(ent)) { /* we don't know what will be called, a possible escape */ return 1; } @@ -424,7 +414,7 @@ static void transform_allocs(ir_graph *irg, walk_env_t *env) } } - if (tp && tp != firm_unknown_type) { + if (tp && !is_unknown_type(tp)) { /* we could determine the type, so we could place it on the frame */ dbg = get_irn_dbg_info(alloc); blk = get_nodes_block(alloc); @@ -460,8 +450,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); + confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_NONE); } } @@ -494,6 +483,8 @@ static void transform_alloc_calls(ir_graph *irg, walk_env_t *env) for (call = env->found_allocs; call; call = next) { next = (ir_node*)get_irn_link(call); } + + confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_NONE); } @@ -508,7 +499,7 @@ void escape_enalysis_irg(ir_graph *irg, check_alloc_entity_func callback) return; } - if (get_irg_outs_state(irg) != outs_consistent) + if (irg_has_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUTS)) compute_irg_outs(irg); env.found_allocs = NULL; @@ -561,7 +552,7 @@ void escape_analysis(int run_scalar_replace, check_alloc_entity_func callback) for (i = 0, n = get_irp_n_irgs(); i < n; ++i) { ir_graph *irg = get_irp_irg(i); - assure_irg_outs(irg); + assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUTS); if (callback) { /* search for Calls */