@@ -239,18 +239,18 @@ static void redirectTerminator(SILBasicBlock *Latch, unsigned CurLoopIter,
239
239
auto *CondBr = cast<CondBranchInst>(
240
240
Latch->getSinglePredecessorBlock ()->getTerminator ());
241
241
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 ());
244
244
else
245
- SILBuilder (CondBr).createBranch (CondBr-> getLoc (), CondBr-> getFalseBB (),
246
- CondBr->getFalseArgs ());
245
+ SILBuilderWithScope (CondBr).createBranch (
246
+ CondBr-> getLoc (), CondBr-> getFalseBB (), CondBr->getFalseArgs ());
247
247
CondBr->eraseFromParent ();
248
248
return ;
249
249
}
250
250
251
251
// 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 ());
254
254
Br->eraseFromParent ();
255
255
return ;
256
256
}
@@ -261,25 +261,25 @@ static void redirectTerminator(SILBasicBlock *Latch, unsigned CurLoopIter,
261
261
// one.
262
262
if (CurLoopIter == LastLoopIter) {
263
263
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 ());
266
266
} else {
267
267
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 ());
270
270
}
271
271
CondBr->eraseFromParent ();
272
272
return ;
273
273
}
274
274
275
275
// Otherwise, branch to the next iteration's header.
276
276
if (CondBr->getTrueBB () == CurrentHeader) {
277
- SILBuilder (CondBr).createCondBranch (
277
+ SILBuilderWithScope (CondBr).createCondBranch (
278
278
CondBr->getLoc (), CondBr->getCondition (), NextIterationsHeader,
279
279
CondBr->getTrueArgs (), CondBr->getFalseBB (), CondBr->getFalseArgs ());
280
280
} else {
281
281
assert (CondBr->getFalseBB () == CurrentHeader);
282
- SILBuilder (CondBr).createCondBranch (
282
+ SILBuilderWithScope (CondBr).createCondBranch (
283
283
CondBr->getLoc (), CondBr->getCondition (), CondBr->getTrueBB (),
284
284
CondBr->getTrueArgs (), NextIterationsHeader, CondBr->getFalseArgs ());
285
285
}
0 commit comments