mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
Use IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131609 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ed1d0ac57d
commit
1f5812bd99
@ -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