We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9bde90c commit 5e16173Copy full SHA for 5e16173
lib/IRGen/IRGenSIL.cpp
@@ -1693,9 +1693,14 @@ void IRGenSILFunction::visitSILBasicBlock(SILBasicBlock *BB) {
1693
// Set the builder's debug location.
1694
if (DS && !KeepCurrentLocation)
1695
IGM.DebugInfo->setCurrentLoc(Builder, DS, ILoc);
1696
- else
+ else {
1697
+ // Reuse the last scope for an easier-to-read line table.
1698
+ auto Prev = --I.getIterator();
1699
+ if (Prev != BB->end())
1700
+ DS = Prev->getDebugScope();
1701
// Use an artificial (line 0) location.
1702
IGM.DebugInfo->setCurrentLoc(Builder, DS);
1703
+ }
1704
1705
if (isa<TermInst>(&I))
1706
emitDebugVariableRangeExtension(BB);
0 commit comments