summaryrefslogtreecommitdiffstats
path: root/llvm/examples
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
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')
-rw-r--r--llvm/examples/Kaleidoscope/Chapter5/toy.cpp2
-rw-r--r--llvm/examples/Kaleidoscope/Chapter6/toy.cpp2
-rw-r--r--llvm/examples/Kaleidoscope/Chapter7/toy.cpp1
3 files changed, 5 insertions, 0 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter5/toy.cpp b/llvm/examples/Kaleidoscope/Chapter5/toy.cpp
index 26b3db66202..e3f7565aa98 100644
--- a/llvm/examples/Kaleidoscope/Chapter5/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter5/toy.cpp
@@ -552,6 +552,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);
@@ -593,6 +594,7 @@ Value *ForExprAST::Codegen() {
// Start the PHI node with an entry for Start.
PHINode *Variable = Builder.CreatePHI(Type::getDoubleTy(getGlobalContext()), VarName.c_str());
+ Variable->reserveOperandSpace(2);
Variable->addIncoming(StartVal, PreheaderBB);
// Within the loop, the variable is defined equal to the PHI node. If it
diff --git a/llvm/examples/Kaleidoscope/Chapter6/toy.cpp b/llvm/examples/Kaleidoscope/Chapter6/toy.cpp
index 838125ae77d..5316b80be54 100644
--- a/llvm/examples/Kaleidoscope/Chapter6/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter6/toy.cpp
@@ -656,6 +656,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);
@@ -697,6 +698,7 @@ Value *ForExprAST::Codegen() {
// Start the PHI node with an entry for Start.
PHINode *Variable = Builder.CreatePHI(Type::getDoubleTy(getGlobalContext()), VarName.c_str());
+ Variable->reserveOperandSpace(2);
Variable->addIncoming(StartVal, PreheaderBB);
// Within the loop, the variable is defined equal to the PHI node. If it
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