mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-14 15:38:57 +00:00
Use IRBuilder.
llvm-svn: 131609
This commit is contained in:
parent
175cee362f
commit
c5390e2f7f
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user