summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-03-30 11:19:20 +0000
committerJay Foad <jay.foad@gmail.com>2011-03-30 11:19:20 +0000
commite0938d8a87a6c8b12f68fbe784a270dd2d552331 (patch)
tree98d4fbcf8ebe8ec03e205e22d98469b177234a95 /llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
parent27e20c3c586da61e5fe9218aa9fe5733e34c18c2 (diff)
downloadbcm5719-llvm-e0938d8a87a6c8b12f68fbe784a270dd2d552331.tar.gz
bcm5719-llvm-e0938d8a87a6c8b12f68fbe784a270dd2d552331.zip
(Almost) always call reserveOperandSpace() on newly created PHINodes.
llvm-svn: 128535
Diffstat (limited to 'llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
index ccb8287d796..24d20d0e84d 100644
--- a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
+++ b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
@@ -117,6 +117,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
} else {
// If the function doesn't return void... add a PHI node to the block...
PN = PHINode::Create(F.getReturnType(), "UnifiedRetVal");
+ PN->reserveOperandSpace(ReturningBlocks.size());
NewRetBlock->getInstList().push_back(PN);
ReturnInst::Create(F.getContext(), PN, NewRetBlock);
}
OpenPOWER on IntegriCloud