summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-05-19 00:13:33 +0000
committerDevang Patel <dpatel@apple.com>2011-05-19 00:13:33 +0000
commit3015a54813ee121eda7525fb4ab6bcc056ba63b1 (patch)
treeb7f89e44a7a96a84d89b32608028e0665b6b7427 /llvm/lib
parent5dfe17d24296ba413ef8874aab1fc69be09cfe95 (diff)
downloadbcm5719-llvm-3015a54813ee121eda7525fb4ab6bcc056ba63b1.tar.gz
bcm5719-llvm-3015a54813ee121eda7525fb4ab6bcc056ba63b1.zip
Use IRBuilder.
llvm-svn: 131609
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index a8df513b251..9dc98fae942 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -2404,8 +2404,8 @@ static bool TurnSwitchRangeIntoICmp(SwitchInst *SI, IRBuilder<> &Builder) {
Value *Sub = SI->getCondition();
if (!Offset->isNullValue())
- Sub = BinaryOperator::CreateAdd(Sub, Offset, Sub->getName()+".off", SI);
- Value *Cmp = new ICmpInst(SI, ICmpInst::ICMP_ULT, Sub, NumCases, "switch");
+ Sub = Builder.CreateAdd(Sub, Offset, Sub->getName()+".off");
+ Value *Cmp = Builder.CreateICmpULT(Sub, NumCases, "switch");
Builder.CreateCondBr(Cmp, SI->getSuccessor(1), SI->getDefaultDest());
// Prune obsolete incoming values off the successor's PHI nodes.
OpenPOWER on IntegriCloud