X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Firscc.c;h=260b4a928b307fe0485738e8662900141f7bbcdc;hb=a0ef602ed410bf9c6767972484ef44a27ba4d8c8;hp=4494289c7ea2388d56fcb63ffa726ac92dea74e0;hpb=5b0dd290528883c15583d01fc034a3fce00fe9fe;p=libfirm diff --git a/ir/ana/irscc.c b/ir/ana/irscc.c index 4494289c7..260b4a928 100644 --- a/ir/ana/irscc.c +++ b/ir/ana/irscc.c @@ -209,18 +209,13 @@ static INLINE void init_stack(void) { tos = 0; } -#if 0 /** * Frees the stack. */ -static INLINE void free_stack(void) { - if (stack != NULL) { - DEL_ARR_F(stack); - stack = NULL; - } - tos = 0; +static void finish_stack(void) { + DEL_ARR_F(stack); + stack = NULL; } -#endif /** * push a node onto the stack @@ -350,6 +345,11 @@ static INLINE void init_scc(ir_graph *irg, struct obstack *obst) { */ } +static INLINE void finish_scc(void) +{ + finish_stack(); +} + #ifdef INTERPROCEDURAL_VIEW static INLINE void init_ip_scc(struct obstack *obst) { init_scc_common(); @@ -931,6 +931,8 @@ int construct_backedges(ir_graph *irg) { inc_irg_visited(irg); scc(get_irg_end(irg)); + + finish_scc(); obstack_free(&temp, NULL); assert(head_rem == current_loop); @@ -1248,8 +1250,8 @@ int is_loop_variant(ir_loop *l, ir_loop *b) { * * Returns non-zero, if the node n is not changed in the loop block * belongs to or in inner loops of this blocks loop. */ -int is_loop_invariant(ir_node *n, ir_node *block) { +int is_loop_invariant(const ir_node *n, const ir_node *block) { ir_loop *l = get_irn_loop(block); - ir_node *b = is_Block(n) ? n : get_nodes_block(n); + const ir_node *b = is_Block(n) ? n : get_nodes_block(n); return !is_loop_variant(l, get_irn_loop(b)); }