X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=ir%2Fana%2Firextbb2.c;h=602e393bc8203c789a21cee195c0b82fc4d40d37;hb=2af4a97900b435e35d7c20350604e3863aff2b4c;hp=5e1ef7040dd0d498c3490cd0ff7743223d956306;hpb=974215da1a935f250766874d0f7a7ddfa34bc4ef;p=libfirm diff --git a/ir/ana/irextbb2.c b/ir/ana/irextbb2.c index 5e1ef7040..602e393bc 100644 --- a/ir/ana/irextbb2.c +++ b/ir/ana/irextbb2.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -23,13 +23,11 @@ * @author Matthias Braun * @date 5.2005 * @version $Id$ - * @summary + * @brief * Alternative algorithm for computing extended basic blocks (using out edges * and execution frequencies) */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "irextbb_t.h" #include "irgwalk.h" @@ -52,7 +50,7 @@ typedef struct _env { */ static ir_extblk *allocate_extblk(ir_node *block, env_t *env) { - ir_extblk *extblk = obstack_alloc(env->obst, sizeof(*extblk)); + ir_extblk *extblk = OALLOC(env->obst, ir_extblk); extblk->kind = k_ir_extblk; extblk->visited = 1; @@ -109,11 +107,10 @@ static void create_extblk(ir_node *block, env_t *env) { ir_extblk *extblk; - if (irn_visited(block)) + if (irn_visited_else_mark(block)) return; extblk = allocate_extblk(block, env); - mark_irn_visited(block); pick_successor(block, extblk, env); } @@ -191,7 +188,7 @@ void compute_extbb_execfreqs(ir_graph *irg, ir_exec_freq *execfreqs) { obstack_free(irg->extbb_obst, NULL); } else { - irg->extbb_obst = xmalloc(sizeof(*irg->extbb_obst)); + irg->extbb_obst = XMALLOC(struct obstack); } obstack_init(irg->extbb_obst); @@ -207,9 +204,7 @@ void compute_extbb_execfreqs(ir_graph *irg, ir_exec_freq *execfreqs) { /* the end block needs a extbb assigned (even for endless loops) */ endblock = get_irg_end_block(irg); - if (! irn_visited(endblock)) { - create_extblk(endblock, &env); - } + create_extblk(endblock, &env); /* Ok, we have now the list of all extended blocks starting with env.head