aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LoopSimplify.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-29 00:39:08 +0000
committerChris Lattner <sabre@nondot.org>2005-01-29 00:39:08 +0000
commit5551706b0f8e970720deea0bf6aa34116030d6be (patch)
tree42a2878aa19c159facf544bf1e1bfbcdc212e8f0 /lib/Transforms/Utils/LoopSimplify.cpp
parent667fdaef9f83b4cd957dda65c1d65113c7863ee3 (diff)
Adjust to changes in instruction interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r--lib/Transforms/Utils/LoopSimplify.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp
index c7b92bbdda..b5517cb886 100644
--- a/lib/Transforms/Utils/LoopSimplify.cpp
+++ b/lib/Transforms/Utils/LoopSimplify.cpp
@@ -575,7 +575,7 @@ void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) {
PHINode *PN = cast<PHINode>(I);
PHINode *NewPN = new PHINode(PN->getType(), PN->getName()+".be",
BETerminator);
- NewPN->op_reserve(2*BackedgeBlocks.size());
+ NewPN->reserveOperandSpace(BackedgeBlocks.size());
// Loop over the PHI node, moving all entries except the one for the
// preheader over to the new PHI node.
@@ -604,7 +604,9 @@ void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) {
PN->setIncomingValue(0, PN->getIncomingValue(PreheaderIdx));
PN->setIncomingBlock(0, PN->getIncomingBlock(PreheaderIdx));
}
- PN->op_erase(PN->op_begin()+2, PN->op_end());
+ // Nuke all entries except the zero'th.
+ for (unsigned i = 0, e = PN->getNumIncomingValues()-1; i != e; ++i)
+ PN->removeIncomingValue(e-i, false);
// Finally, add the newly constructed PHI node as the entry for the BEBlock.
PN->addIncoming(NewPN, BEBlock);