From 1af6dc83bcc7707a772adb1d76d9484294e388c3 Mon Sep 17 00:00:00 2001 From: kazu Date: Mon, 22 Nov 2004 22:01:11 +0000 Subject: * tree-flow.h: Remove the prototype for remove_phi_arg. Add a prototype for remove_phi_args. * tree-phinodes.c (remove_phi_arg): Remove. (remove_phi_args): New. * tree-ssa.c (ssa_remove_edge): Call remove_phi_args instead of remove_phi_arg. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91034 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-phinodes.c | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) (limited to 'gcc/tree-phinodes.c') diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c index a38a57273be..c4240e7cb69 100644 --- a/gcc/tree-phinodes.c +++ b/gcc/tree-phinodes.c @@ -349,29 +349,6 @@ add_phi_arg (tree *phi, tree def, edge e) PHI_NUM_ARGS (*phi)++; } -/* Remove a PHI argument from PHI. BLOCK is the predecessor block where - the PHI argument is coming from. */ - -void -remove_phi_arg (tree phi, basic_block block) -{ - int i, num_elem = PHI_NUM_ARGS (phi); - - for (i = 0; i < num_elem; i++) - { - basic_block src_bb; - - src_bb = PHI_ARG_EDGE (phi, i)->src; - - if (src_bb == block) - { - remove_phi_arg_num (phi, i); - return; - } - } -} - - /* Remove the Ith argument from PHI's argument list. This routine assumes ordering of alternatives in the vector is not important and implements removal by swapping the last alternative with the alternative we want to @@ -400,6 +377,21 @@ remove_phi_arg_num (tree phi, int i) PHI_NUM_ARGS (phi)--; } +/* Remove all PHI arguments associated with edge E. */ + +void +remove_phi_args (edge e) +{ + tree phi; + + for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi)) + { + int index = phi_arg_from_edge (phi, e); + if (index >= 0) + remove_phi_arg_num (phi, index); + } +} + /* Remove PHI node PHI from basic block BB. If PREV is non-NULL, it is used as the node immediately before PHI in the linked list. */ -- cgit v1.2.1