From b0b0aa384941279f6954f254b055e6810bb7be83 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 7 Jun 2001 16:59:37 +0000 Subject: [PATCH] Add extra method to PHI node class git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/InstrTypes.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/VMCore/InstrTypes.cpp b/lib/VMCore/InstrTypes.cpp index 29b293f1aa2..decb4ad3864 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; +}