@@ -239,18 +239,18 @@ static void redirectTerminator(SILBasicBlock *Latch, unsigned CurLoopIter,
239239 auto *CondBr = cast<CondBranchInst>(
240240 Latch->getSinglePredecessorBlock ()->getTerminator ());
241241 if (CondBr->getTrueBB () != Latch)
242- SILBuilder (CondBr).createBranch (CondBr-> getLoc (), CondBr-> getTrueBB (),
243- CondBr->getTrueArgs ());
242+ SILBuilderWithScope (CondBr).createBranch (
243+ CondBr-> getLoc (), CondBr-> getTrueBB (), CondBr->getTrueArgs ());
244244 else
245- SILBuilder (CondBr).createBranch (CondBr-> getLoc (), CondBr-> getFalseBB (),
246- CondBr->getFalseArgs ());
245+ SILBuilderWithScope (CondBr).createBranch (
246+ CondBr-> getLoc (), CondBr-> getFalseBB (), CondBr->getFalseArgs ());
247247 CondBr->eraseFromParent ();
248248 return ;
249249 }
250250
251251 // Otherwise, branch to the next iteration's header.
252- SILBuilder (Br).createBranch (Br->getLoc (), NextIterationsHeader,
253- Br->getArgs ());
252+ SILBuilderWithScope (Br).createBranch (Br->getLoc (), NextIterationsHeader,
253+ Br->getArgs ());
254254 Br->eraseFromParent ();
255255 return ;
256256 }
@@ -261,25 +261,25 @@ static void redirectTerminator(SILBasicBlock *Latch, unsigned CurLoopIter,
261261 // one.
262262 if (CurLoopIter == LastLoopIter) {
263263 if (CondBr->getTrueBB () == CurrentHeader) {
264- SILBuilder (CondBr).createBranch (CondBr-> getLoc (), CondBr-> getFalseBB (),
265- CondBr->getFalseArgs ());
264+ SILBuilderWithScope (CondBr).createBranch (
265+ CondBr-> getLoc (), CondBr-> getFalseBB (), CondBr->getFalseArgs ());
266266 } else {
267267 assert (CondBr->getFalseBB () == CurrentHeader);
268- SILBuilder (CondBr).createBranch (CondBr-> getLoc (), CondBr-> getTrueBB (),
269- CondBr->getTrueArgs ());
268+ SILBuilderWithScope (CondBr).createBranch (
269+ CondBr-> getLoc (), CondBr-> getTrueBB (), CondBr->getTrueArgs ());
270270 }
271271 CondBr->eraseFromParent ();
272272 return ;
273273 }
274274
275275 // Otherwise, branch to the next iteration's header.
276276 if (CondBr->getTrueBB () == CurrentHeader) {
277- SILBuilder (CondBr).createCondBranch (
277+ SILBuilderWithScope (CondBr).createCondBranch (
278278 CondBr->getLoc (), CondBr->getCondition (), NextIterationsHeader,
279279 CondBr->getTrueArgs (), CondBr->getFalseBB (), CondBr->getFalseArgs ());
280280 } else {
281281 assert (CondBr->getFalseBB () == CurrentHeader);
282- SILBuilder (CondBr).createCondBranch (
282+ SILBuilderWithScope (CondBr).createCondBranch (
283283 CondBr->getLoc (), CondBr->getCondition (), CondBr->getTrueBB (),
284284 CondBr->getTrueArgs (), NextIterationsHeader, CondBr->getFalseArgs ());
285285 }
0 commit comments