From: Christian Würdig Date: Fri, 19 Jan 2007 16:04:49 +0000 (+0000) Subject: added new abi callback (fix stack phis) X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=757dc2b988a8bde0484b994fc129911596a405d1;p=libfirm added new abi callback (fix stack phis) --- diff --git a/ir/be/beabi.c b/ir/be/beabi.c index 86184d061..f41a7aee7 100644 --- a/ir/be/beabi.c +++ b/ir/be/beabi.c @@ -1926,15 +1926,20 @@ void be_abi_fix_stack_nodes(be_abi_irg_t *env, be_lv_t *lv) { pset *stack_nodes = pset_new_ptr(16); struct fix_stack_walker_info info; + int collect_phis; info.nodes = stack_nodes; info.aenv = env->birg->main_env->arch_env; be_assure_dom_front(env->birg); + irg_walk_graph(env->birg->irg, collect_stack_nodes_walker, NULL, &info); pset_insert_ptr(stack_nodes, env->init_sp); - be_ssa_constr_set_phis(env->birg->dom_front, lv, stack_nodes, env->stack_phis); + collect_phis = 1; + if (env->call->cb->collect_stack_phis) + collect_phis = env->call->cb->collect_stack_phis(env->cb); + be_ssa_constr_set_phis(env->birg->dom_front, lv, stack_nodes, collect_phis ? env->stack_phis : NULL); del_pset(stack_nodes); } diff --git a/ir/be/beabi.h b/ir/be/beabi.h index 8aa69d681..5baed2d8c 100644 --- a/ir/be/beabi.h +++ b/ir/be/beabi.h @@ -82,6 +82,8 @@ struct _be_abi_callbacks_t { * Also, the @p mem variable must be updated, if memory producing nodes are inserted. */ void (*epilogue)(void *self, ir_node *bl, ir_node **mem, pmap *reg_map); + + int (*collect_stack_phis)(void *self); }; /**