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 :
723723 Alignment align (layout->getAlignment ());
724724
725725 auto alloca = createAlloca (aggregateType, align, Name + " .debug" );
726+ ArtificialLocation AutoRestore (getDebugScope (), IGM.DebugInfo , Builder);
726727 size_t i = 0 ;
727728 for (auto val : vals) {
728729 auto addr = Builder.CreateStructGEP (alloca, i,
Original file line number Diff line number Diff line change 11// 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
23func use< T> ( _ t: T ) { }
34
45public func f( _ i : Int ? )
@@ -14,3 +15,14 @@ public func f(_ i : Int?)
1415 guard let val = i else { return }
1516 use ( val)
1617}
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