From: Christian Würdig Date: Wed, 14 Feb 2007 10:17:02 +0000 (+0000) Subject: use be_kill_node when removing nodes X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=8481025b9e2f2c632655f12b9ec062e858c77b8d;p=libfirm use be_kill_node when removing nodes --- diff --git a/ir/be/belower.c b/ir/be/belower.c index c57d713b6..c2c04ee8f 100644 --- a/ir/be/belower.c +++ b/ir/be/belower.c @@ -85,15 +85,6 @@ typedef struct _perm_cycle_t { perm_type_t type; /**< type (CHAIN or CYCLE) */ } perm_cycle_t; -static void kill_node(ir_node *irn, int kill_block) { - int i, arity = get_irn_arity(irn); - ir_graph *irg = get_irn_irg(irn); - - for (i = -1; i < arity; ++i) { - set_irn_n(irn, i, new_r_Bad(irg)); - } -} - /* Compare the two operands */ static int cmp_op_copy_assoc(const void *a, const void *b) { const op_copy_assoc_t *op1 = a; @@ -511,8 +502,8 @@ static void lower_perm_node(ir_node *irn, void *walk_env) { /* remove the perm from schedule */ if (! keep_perm) { - kill_node(irn, 0); sched_remove(irn); + be_kill_node(irn); } } @@ -748,7 +739,7 @@ static void melt_copykeeps(constraint_env_t *cenv) { /* now, we can kill the melted keep, except the */ /* ref one, we still need some information */ if (melt_arr[j] != ref) - kill_node(melt_arr[j], 0); + be_kill_node(melt_arr[j]); } #ifdef KEEP_ALIVE_COPYKEEP_HACK @@ -778,7 +769,7 @@ static void melt_copykeeps(constraint_env_t *cenv) { DBG((cenv->dbg, LEVEL_1, "created %+F, scheduled before %+F\n", new_ck, sched_pt)); /* finally: kill the reference copykeep */ - kill_node(ref, 0); + be_kill_node(ref); } } @@ -848,8 +839,8 @@ void assure_constraints(be_irg_t *birg) { sched_add_before(cp, keep); /* Set all ins (including the block) of the CopyKeep BAD to keep the verifier happy. */ - kill_node(cp, 1); sched_remove(cp); + be_kill_node(cp); } } diff --git a/ir/be/besched.c b/ir/be/besched.c index 0026d35bd..c9aee86b2 100644 --- a/ir/be/besched.c +++ b/ir/be/besched.c @@ -258,8 +258,7 @@ static void remove_dead_nodes_walker(ir_node *block, void *data) if (is_Bad(node)) continue; - for (i = get_irn_arity(node) - 1; i >= 0; --i) - set_irn_n(node, i, new_r_Bad(env->irg)); + be_kill_node(node); } }