From: Matthias Braun Date: Wed, 31 May 2006 12:10:13 +0000 (+0000) Subject: - use foreach_out_edge_safe in remove_copies X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=ff4b945299a64fba36a700e117fd01db9300a5bc;p=libfirm - use foreach_out_edge_safe in remove_copies --- diff --git a/ir/be/bespillbelady.c b/ir/be/bespillbelady.c index b0fb76d7c..bb08c2c77 100644 --- a/ir/be/bespillbelady.c +++ b/ir/be/bespillbelady.c @@ -589,20 +589,15 @@ static void remove_copies(belady_env_t *bel) { edges_activate(current_ir_graph); foreach_pset(bel->copies, irn) { ir_node *src; - const ir_edge_t *edge; + const ir_edge_t *edge, *ne; assert(be_is_Copy(irn)); src = be_get_Copy_op(irn); - foreach_out_edge(irn, edge) { + foreach_out_edge_safe(irn, edge, ne) { ir_node *user = get_edge_src_irn(edge); int user_pos = get_edge_src_pos(edge); -#if 0 - // is this normal? - if(user == NULL) - break; -#endif set_irn_n(user, user_pos, src); } } diff --git a/ir/be/beverify.c b/ir/be/beverify.c index b75c54519..e1264181a 100644 --- a/ir/be/beverify.c +++ b/ir/be/beverify.c @@ -109,8 +109,8 @@ static void verify_schedule_walker(ir_node *bl, void *data) int delay_branches = 0; /* - Make sure that all phi nodes are scheduled at the beginning of the block, and that there - is 1 or no control flow changing node scheduled as last operation + * Make sure that all phi nodes are scheduled at the beginning of the block, and that there + * is 1 or no control flow changing node scheduled and exactly delay_branches operations after it. */ sched_foreach(bl, irn) { if (is_Phi(irn)) {