@@ -46,6 +46,13 @@ define swiftcc void @my_async_function.my_other_async_function_fp.apply(i8* %fnP
46
46
declare void @some_user (i64 )
47
47
declare void @some_may_write (i64* )
48
48
49
+ define i8* @__swift_async_resume_project_context (i8* %ctxt ) {
50
+ entry:
51
+ %resume_ctxt_addr = bitcast i8* %ctxt to i8**
52
+ %resume_ctxt = load i8* , i8** %resume_ctxt_addr , align 8
53
+ ret i8* %resume_ctxt
54
+ }
55
+
49
56
define i8* @resume_context_projection (i8* %ctxt ) {
50
57
entry:
51
58
%resume_ctxt_addr = bitcast i8* %ctxt to i8**
86
93
; store caller context into callee context
87
94
%callee_context.caller_context.addr = getelementptr inbounds %async.ctxt , %async.ctxt* %callee_context.0 , i32 0 , i32 0
88
95
store i8* %async.ctxt , i8** %callee_context.caller_context.addr
89
- %resume_proj_fun = bitcast i8* (i8* )* @resume_context_projection to i8*
96
+ %resume_proj_fun = bitcast i8* (i8* )* @__swift_async_resume_project_context to i8*
90
97
%callee = bitcast void (i8* , %async.task* , %async.actor* )* @asyncSuspend to i8*
91
98
%res = call {i8* , i8* , i8* } (i32 , i8* , i8* , ...) @llvm.coro.suspend.async (i32 0 ,
92
99
i8* %resume.func_ptr ,
@@ -141,14 +148,14 @@ define void @my_async_function_pa(i8* %ctxt, %async.task* %task, %async.actor* %
141
148
; CHECK: store i8* [[CALLEE_CTXT]], i8** [[CAST2]]
142
149
; CHECK: [[TYPED_RETURN_TO_CALLER_ADDR:%.*]] = getelementptr inbounds i8, i8* [[CALLEE_CTXT]], i64 8
143
150
; CHECK: [[RETURN_TO_CALLER_ADDR:%.*]] = bitcast i8* [[TYPED_RETURN_TO_CALLER_ADDR]] to i8**
144
- ; CHECK: store i8* bitcast (void (i8*, i8*, i8*)* @my_async_function.resume.0 to i8*), i8** [[RETURN_TO_CALLER_ADDR]]
151
+ ; CHECK: store i8* bitcast (void (i8*, i8*, i8*)* @my_async_functionTQ0_ to i8*), i8** [[RETURN_TO_CALLER_ADDR]]
145
152
; CHECK: [[CALLER_CONTEXT_ADDR:%.*]] = bitcast i8* [[CALLEE_CTXT]] to i8**
146
153
; CHECK: store i8* %async.ctxt, i8** [[CALLER_CONTEXT_ADDR]]
147
154
; CHECK: tail call swiftcc void @asyncSuspend(i8* [[CALLEE_CTXT]], %async.task* %task, %async.actor* %actor)
148
155
; CHECK: ret void
149
156
; CHECK: }
150
157
151
- ; CHECK-LABEL: define internal swiftcc void @my_async_function.resume.0 (i8* nocapture readonly swiftasync %0, i8* %1, i8* nocapture readnone %2)
158
+ ; CHECK-LABEL: define internal swiftcc void @my_async_functionTQ0_ (i8* nocapture readonly swiftasync %0, i8* %1, i8* nocapture readnone %2)
152
159
; CHECK-SAME: !dbg ![[SP2:[0-9]+]] {
153
160
; CHECK: entryresume.0:
154
161
; CHECK: [[CALLER_CONTEXT_ADDR:%.*]] = bitcast i8* %0 to i8**
@@ -278,7 +285,7 @@ define swiftcc void @top_level_caller(i8* %ctxt, i8* %task, i8* %actor) {
278
285
}
279
286
280
287
; CHECK-LABEL: define swiftcc void @top_level_caller(i8* %ctxt, i8* %task, i8* %actor)
281
- ; CHECK: store i8* bitcast (void (i8*, i8*, i8*)* @my_async_function.resume.0
288
+ ; CHECK: store i8* bitcast (void (i8*, i8*, i8*)* @my_async_functionTQ0_
282
289
; CHECK: store i8* %ctxt
283
290
; CHECK: tail call swiftcc void @asyncSuspend
284
291
; CHECK: ret void
@@ -548,7 +555,7 @@ declare void @llvm.coro.async.size.replace(i8*, i8*)
548
555
scope: !2 , file: !3 , line: 1 , type: !4 ,
549
556
scopeLine: 1 , spFlags: DISPFlagDefinition, unit: !2 )
550
557
; CHECK: ![[SP2]] = distinct !DISubprogram(name: "my_async_function",
551
- ; CHECK-SAME: linkageName: "my_async_function.resume.0 ",
558
+ ; CHECK-SAME: linkageName: "my_async_functionTQ0_ ",
552
559
; CHECK-SAME: scopeLine: 2
553
560
!2 = distinct !DICompileUnit (language: DW_LANG_Swift, file: !3 , emissionKind: FullDebug)
554
561
!3 = !DIFile (filename: "/tmp/1.swift" , directory: "/" )
0 commit comments