Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions lib/SIL/Utils/FieldSensitivePrunedLiveness.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,23 @@ void TypeTreeLeafTypeRange::constructFilteredProjections(
callback) {
auto *fn = insertPt->getFunction();
SILType type = value->getType();
auto loc =
(insertPt->getLoc().getKind() != SILLocation::ArtificialUnreachableKind)
? insertPt->getLoc()
: RegularLocation::getAutoGeneratedLocation();

// Create a debug location appropriate for synthesizing projection
// instructions that satisfy `SILInstruction::verifyDebugInfo`, while
// trying to preserve debug info when it's valid to do so.
auto projectionLocFrom = [](SILInstruction *orig) -> SILLocation {
auto loc = orig->getLoc();
switch (loc.getKind()) {
case SILLocation::ReturnKind:
case SILLocation::ImplicitReturnKind:
case SILLocation::ArtificialUnreachableKind:
return RegularLocation::getDebugOnlyLocation(loc, orig->getModule());

default:
return loc;
}
};
SILLocation loc = projectionLocFrom(insertPt);

PRUNED_LIVENESS_LOG(llvm::dbgs() << "ConstructFilteredProjection. Bv: "
<< filterBitVector << '\n');
Expand Down