mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[sil] Replace some nstances of SILBuilder(...) with SILBuilderWithScope(...).
The main thing to notice about these changes is that I always picked the debug scope associated with the location we were using. They should always be in sync.
This commit is contained in:
@@ -239,18 +239,18 @@ static void redirectTerminator(SILBasicBlock *Latch, unsigned CurLoopIter,
|
||||
auto *CondBr = cast<CondBranchInst>(
|
||||
Latch->getSinglePredecessorBlock()->getTerminator());
|
||||
if (CondBr->getTrueBB() != Latch)
|
||||
SILBuilder(CondBr).createBranch(CondBr->getLoc(), CondBr->getTrueBB(),
|
||||
CondBr->getTrueArgs());
|
||||
SILBuilderWithScope(CondBr).createBranch(
|
||||
CondBr->getLoc(), CondBr->getTrueBB(), CondBr->getTrueArgs());
|
||||
else
|
||||
SILBuilder(CondBr).createBranch(CondBr->getLoc(), CondBr->getFalseBB(),
|
||||
CondBr->getFalseArgs());
|
||||
SILBuilderWithScope(CondBr).createBranch(
|
||||
CondBr->getLoc(), CondBr->getFalseBB(), CondBr->getFalseArgs());
|
||||
CondBr->eraseFromParent();
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise, branch to the next iteration's header.
|
||||
SILBuilder(Br).createBranch(Br->getLoc(), NextIterationsHeader,
|
||||
Br->getArgs());
|
||||
SILBuilderWithScope(Br).createBranch(Br->getLoc(), NextIterationsHeader,
|
||||
Br->getArgs());
|
||||
Br->eraseFromParent();
|
||||
return;
|
||||
}
|
||||
@@ -261,12 +261,12 @@ static void redirectTerminator(SILBasicBlock *Latch, unsigned CurLoopIter,
|
||||
// one.
|
||||
if (CurLoopIter == LastLoopIter) {
|
||||
if (CondBr->getTrueBB() == CurrentHeader) {
|
||||
SILBuilder(CondBr).createBranch(CondBr->getLoc(), CondBr->getFalseBB(),
|
||||
CondBr->getFalseArgs());
|
||||
SILBuilderWithScope(CondBr).createBranch(
|
||||
CondBr->getLoc(), CondBr->getFalseBB(), CondBr->getFalseArgs());
|
||||
} else {
|
||||
assert(CondBr->getFalseBB() == CurrentHeader);
|
||||
SILBuilder(CondBr).createBranch(CondBr->getLoc(), CondBr->getTrueBB(),
|
||||
CondBr->getTrueArgs());
|
||||
SILBuilderWithScope(CondBr).createBranch(
|
||||
CondBr->getLoc(), CondBr->getTrueBB(), CondBr->getTrueArgs());
|
||||
}
|
||||
CondBr->eraseFromParent();
|
||||
return;
|
||||
@@ -274,12 +274,12 @@ static void redirectTerminator(SILBasicBlock *Latch, unsigned CurLoopIter,
|
||||
|
||||
// Otherwise, branch to the next iteration's header.
|
||||
if (CondBr->getTrueBB() == CurrentHeader) {
|
||||
SILBuilder(CondBr).createCondBranch(
|
||||
SILBuilderWithScope(CondBr).createCondBranch(
|
||||
CondBr->getLoc(), CondBr->getCondition(), NextIterationsHeader,
|
||||
CondBr->getTrueArgs(), CondBr->getFalseBB(), CondBr->getFalseArgs());
|
||||
} else {
|
||||
assert(CondBr->getFalseBB() == CurrentHeader);
|
||||
SILBuilder(CondBr).createCondBranch(
|
||||
SILBuilderWithScope(CondBr).createCondBranch(
|
||||
CondBr->getLoc(), CondBr->getCondition(), CondBr->getTrueBB(),
|
||||
CondBr->getTrueArgs(), NextIterationsHeader, CondBr->getFalseArgs());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user