File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -723,6 +723,7 @@ class IRGenSILFunction :
723
723
Alignment align (layout->getAlignment ());
724
724
725
725
auto alloca = createAlloca (aggregateType, align, Name + " .debug" );
726
+ ArtificialLocation AutoRestore (getDebugScope (), IGM.DebugInfo , Builder);
726
727
size_t i = 0 ;
727
728
for (auto val : vals) {
728
729
auto addr = Builder.CreateStructGEP (alloca, i,
Original file line number Diff line number Diff line change 1
1
// RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s
2
+ // RUN: %target-swift-frontend %s -emit-ir -g -o - | FileCheck %s --check-prefix=CHECK2
2
3
func use< T> ( _ t: T ) { }
3
4
4
5
public func f( _ i : Int ? )
@@ -14,3 +15,14 @@ public func f(_ i : Int?)
14
15
guard let val = i else { return }
15
16
use ( val)
16
17
}
18
+
19
+ public func g( _ s : String ? )
20
+ {
21
+ // CHECK2: define {{.*}}@_TF4main1gFGSqSS_T_
22
+ // The shadow copy store should not have a location.
23
+ // CHECK2: getelementptr inbounds {{.*}} %s.debug, {{.*}}, !dbg ![[DBG0:.*]]
24
+ // CHECK2: ![[G:.*]] = distinct !DISubprogram(name: "g",
25
+ // CHECK2: ![[DBG0]] = !DILocation(line: 0, scope: ![[G]])
26
+ guard let val = s else { return }
27
+ use ( val)
28
+ }
You can’t perform that action at this time.
0 commit comments