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 @@ -704,6 +704,7 @@ class IRGenSILFunction :
704
704
Alignment align (layout->getAlignment ());
705
705
706
706
auto alloca = createAlloca (aggregateType, align, Name + " .debug" );
707
+ ArtificialLocation AutoRestore (getDebugScope (), IGM.DebugInfo , Builder);
707
708
size_t i = 0 ;
708
709
for (auto val : vals) {
709
710
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