File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -1789,8 +1789,11 @@ void IRGenSILFunction::visitSILBasicBlock(SILBasicBlock *BB) {
1789
1789
auto Prev = --I.getIterator ();
1790
1790
if (Prev != BB->end ())
1791
1791
DS = Prev->getDebugScope ();
1792
- // Use an artificial (line 0) location.
1793
- IGM.DebugInfo ->setCurrentLoc (Builder, DS, None);
1792
+
1793
+ // Use an artificial (line 0) location, to indicate we'd like to
1794
+ // reuse the last debug loc.
1795
+ IGM.DebugInfo ->setCurrentLoc (
1796
+ Builder, DS, RegularLocation::getAutoGeneratedLocation ());
1794
1797
}
1795
1798
1796
1799
if (isa<TermInst>(&I))
Original file line number Diff line number Diff line change @@ -178,3 +178,18 @@ public func cleanup_simple_complex(_ a: NSString) -> Int64 {
178
178
}
179
179
180
180
// ---------------------------------------------------------------------
181
+
182
+ // RUN: %FileCheck %s --check-prefix=CHECK_INIT < %t.ll
183
+ // CHECK_INIT: define {{.*}}$S4main6Class1CACSgycfc
184
+ public class Class1 {
185
+ public required init ? ( ) {
186
+ print ( " hello " )
187
+ // CHECK_INIT: call {{.*}}@"$Ss5print_9separator10terminatoryypd_S2StF"{{.*}}, !dbg [[printLoc:![0-9]+]]
188
+ // CHECK_INIT-NEXT: call void @swift_bridgeObjectRelease{{.*}}, !dbg [[retnLoc:![0-9]+]]
189
+ // CHECK_INIT: br label {{.*}}, !dbg [[retnLoc]]
190
+
191
+ // CHECK_INIT: [[printLoc]] = !DILocation(line: [[@LINE-5]]
192
+ // CHECK_INIT: [[retnLoc]] = !DILocation(line: [[@LINE+1]]
193
+ return nil
194
+ }
195
+ }
You can’t perform that action at this time.
0 commit comments