File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -1845,6 +1845,9 @@ llvm::Value *IRGenFunction::getDynamicSelfMetadata() {
1845
1845
cast<llvm::Instruction>(SelfValue)))
1846
1846
: CurFn->getEntryBlock ().begin ();
1847
1847
Builder.SetInsertPoint (&CurFn->getEntryBlock (), insertPt);
1848
+ // Do not inherit the debug location of this insertion point, it could be
1849
+ // anything (e.g. the location of a dbg.declare).
1850
+ Builder.SetCurrentDebugLocation (llvm::DebugLoc ());
1848
1851
1849
1852
switch (SelfKind) {
1850
1853
case SwiftMetatype:
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -disable-availability-checking %s -emit-irgen -g -o - | %FileCheck %s
2
+ // REQUIRES: concurrency
3
+
4
+ func some_func( _: ( ) -> Void ) async { }
5
+
6
+ class Model {
7
+ static func SelfFunction( ) { }
8
+
9
+ func foo( ) async -> ( ) {
10
+ let somevar = 10
11
+
12
+ return await some_func {
13
+ Self . SelfFunction ( )
14
+ }
15
+ }
16
+ }
17
+
18
+ // Check that the load of DynamicSelf in foo does not have any debug information, as
19
+ // this is hoisted to the start of the function.
20
+ // CHECK: define {{.*}} @"$s19DynamicSelfLocation5ModelC3fooyyYaF"({{.*}}, ptr swiftself %[[Self:.*]])
21
+ // CHECK-NEXT: entry:
22
+ // CHECK-NEXT: %2 = load ptr, ptr %[[Self]]
23
+ // CHECK-NOT: !dbg
24
+ // CHECK-NEXT: call void @llvm.dbg.declare
You can’t perform that action at this time.
0 commit comments