summaryrefslogtreecommitdiffstats
path: root/llvm/examples/Kaleidoscope/Chapter7/toy.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/examples/Kaleidoscope/Chapter7/toy.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/examples/Kaleidoscope/Chapter7/toy.cpp')
-rw-r--r--llvm/examples/Kaleidoscope/Chapter7/toy.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter7/toy.cpp b/llvm/examples/Kaleidoscope/Chapter7/toy.cpp
index e63578f57e6..4070d3f38e7 100644
--- a/llvm/examples/Kaleidoscope/Chapter7/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter7/toy.cpp
@@ -752,6 +752,7 @@ Value *IfExprAST::Codegen() {
Builder.SetInsertPoint(MergeBB);
PHINode *PN = Builder.CreatePHI(Type::getDoubleTy(getGlobalContext()),
"iftmp");
+ PN->reserveOperandSpace(2);
PN->addIncoming(ThenV, ThenBB);
PN->addIncoming(ElseV, ElseBB);
OpenPOWER on IntegriCloud