aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/InstrTypes.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/VMCore/InstrTypes.cpp b/lib/VMCore/InstrTypes.cpp
index 29b293f1aa..decb4ad386 100644
--- a/lib/VMCore/InstrTypes.cpp
+++ b/lib/VMCore/InstrTypes.cpp
@@ -64,3 +64,10 @@ void PHINode::addIncoming(Value *D) {
IncomingValues.push_back(Use(D, this));
}
+// removeIncomingValue - Remove an incoming value. This is useful if a
+// predecessor basic block is deleted.
+Value *PHINode::removeIncomingValue(unsigned idx) {
+ Value *Removed = IncomingValues[idx];
+ IncomingValues.erase(IncomingValues.begin()+idx);
+ return Removed;
+}