Skip to content

Commit 0315fcd

Browse files
committed
[FSPL] Use autogen'd loc.
1 parent 8edd5eb commit 0315fcd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/SIL/Utils/FieldSensitivePrunedLiveness.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,10 @@ void TypeTreeLeafTypeRange::constructFilteredProjections(
415415
callback) {
416416
auto *fn = insertPt->getFunction();
417417
SILType type = value->getType();
418+
auto loc =
419+
(insertPt->getLoc().getKind() != SILLocation::ArtificialUnreachableKind)
420+
? insertPt->getLoc()
421+
: RegularLocation::getAutoGeneratedLocation();
418422

419423
PRUNED_LIVENESS_LOG(llvm::dbgs() << "ConstructFilteredProjection. Bv: "
420424
<< filterBitVector << '\n');
@@ -442,8 +446,7 @@ void TypeTreeLeafTypeRange::constructFilteredProjections(
442446
continue;
443447
}
444448

445-
auto newValue =
446-
builder.createStructElementAddr(insertPt->getLoc(), value, varDecl);
449+
auto newValue = builder.createStructElementAddr(loc, value, varDecl);
447450
callback(newValue, TypeTreeLeafTypeRange(start, next), NeedsDestroy);
448451
start = next;
449452
}
@@ -542,8 +545,7 @@ void TypeTreeLeafTypeRange::constructFilteredProjections(
542545
continue;
543546
}
544547

545-
auto newValue =
546-
builder.createTupleElementAddr(insertPt->getLoc(), value, index);
548+
auto newValue = builder.createTupleElementAddr(loc, value, index);
547549
callback(newValue, TypeTreeLeafTypeRange(start, next), NeedsDestroy);
548550
start = next;
549551
}

0 commit comments

Comments
 (0)