1 ; RUN: opt < %s -passes='module(coro-early),cgscc(coro-split,coro-split)' -S | FileCheck %s
2 ; RUN: opt --try-experimental-debuginfo-iterators < %s -passes='module(coro-early),cgscc(coro-split,coro-split)' -S | FileCheck %s
4 ; Checks whether the dbg.declare for `__coro_frame` are created.
6 ; CHECK-LABEL: define void @f(
8 ; CHECK: %[[begin:.*]] = call noalias nonnull ptr @llvm.coro.begin(
9 ; CHECK: #dbg_declare(ptr %[[begin]], ![[CORO_FRAME:[0-9]+]], !DIExpression(),
11 ; CHECK: define internal fastcc void @f.resume(
12 ; CHECK: entry.resume:
13 ; CHECK: %[[FramePtr_RESUME:.*]] = alloca ptr
14 ; CHECK: #dbg_declare(ptr %[[FramePtr_RESUME]], ![[CORO_FRAME_IN_RESUME:[0-9]+]], !DIExpression(DW_OP_deref)
16 ; CHECK-DAG: ![[FILE:[0-9]+]] = !DIFile(filename: "coro-debug.cpp"
17 ; CHECK-DAG: ![[RAMP:[0-9]+]] = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov",
18 ; CHECK-DAG: ![[CORO_FRAME]] = !DILocalVariable(name: "__coro_frame", scope: ![[RAMP]], file: ![[FILE]], line: [[CORO_FRAME_LINE:[0-9]+]], type: ![[FRAME_TYPE:[0-9]+]], flags: DIFlagArtificial)
19 ; CHECK-DAG: ![[FRAME_TYPE]] = !DICompositeType(tag: DW_TAG_structure_type, name: "f.coro_frame_ty", {{.*}}elements: ![[ELEMENTS:[0-9]+]]
20 ; CHECK-DAG: ![[ELEMENTS]] = !{![[RESUME_FN:[0-9]+]], ![[DESTROY_FN:[0-9]+]], ![[PROMISE:[0-9]+]], ![[VECTOR_TYPE:[0-9]+]], ![[INT64_0:[0-9]+]], ![[DOUBLE_1:[0-9]+]], ![[INT64_PTR:[0-9]+]], ![[INT32_2:[0-9]+]], ![[INT32_3:[0-9]+]], ![[UNALIGNED_UNKNOWN:[0-9]+]], ![[STRUCT:[0-9]+]], ![[CORO_INDEX:[0-9]+]], ![[SMALL_UNKNOWN:[0-9]+]]
21 ; CHECK-DAG: ![[RESUME_FN]] = !DIDerivedType(tag: DW_TAG_member, name: "__resume_fn"{{.*}}, baseType: ![[RESUME_FN_TYPE:[0-9]+]]{{.*}}, flags: DIFlagArtificial
22 ; CHECK-DAG: ![[RESUME_FN_TYPE]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
23 ; CHECK-DAG: ![[DESTROY_FN]] = !DIDerivedType(tag: DW_TAG_member, name: "__destroy_fn"{{.*}}, baseType: ![[RESUME_FN_TYPE]]{{.*}}, flags: DIFlagArtificial
24 ; CHECK-DAG: ![[PROMISE]] = !DIDerivedType(tag: DW_TAG_member, name: "__promise",{{.*}}baseType: ![[PROMISE_BASE:[0-9]+]]
25 ; CHECK-DAG: ![[PROMISE_BASE]] = !DIDerivedType(tag: DW_TAG_typedef, name: "promise_type"
26 ; CHECK-DAG: ![[VECTOR_TYPE]] = !DIDerivedType(tag: DW_TAG_member, name: "_0",{{.*}}baseType: ![[VECTOR_TYPE_BASE:[0-9]+]], size: 128
27 ; CHECK-DAG: ![[VECTOR_TYPE_BASE]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[UNKNOWN_TYPE_BASE:[0-9]+]], size: 128, align: 16, elements: ![[VECTOR_TYPE_BASE_ELEMENTS:[0-9]+]])
28 ; CHECK-DAG: ![[UNKNOWN_TYPE_BASE]] = !DIBasicType(name: "UnknownType", size: 8, encoding: DW_ATE_unsigned_char, flags: DIFlagArtificial)
29 ; CHECK-DAG: ![[VECTOR_TYPE_BASE_ELEMENTS]] = !{![[VECTOR_TYPE_BASE_SUBRANGE:[0-9]+]]}
30 ; CHECK-DAG: ![[VECTOR_TYPE_BASE_SUBRANGE]] = !DISubrange(count: 16, lowerBound: 0)
31 ; CHECK-DAG: ![[INT64_0]] = !DIDerivedType(tag: DW_TAG_member, name: "__int_64_1", scope: ![[FRAME_TYPE]], file: ![[FILE]], line: [[CORO_FRAME_LINE]], baseType: ![[I64_BASE:[0-9]+]],{{.*}}, flags: DIFlagArtificial
32 ; CHECK-DAG: ![[I64_BASE]] = !DIBasicType(name: "__int_64", size: 64, encoding: DW_ATE_signed, flags: DIFlagArtificial)
33 ; CHECK-DAG: ![[DOUBLE_1]] = !DIDerivedType(tag: DW_TAG_member, name: "__double__2", scope: ![[FRAME_TYPE]], file: ![[FILE]], line: [[CORO_FRAME_LINE]], baseType: ![[DOUBLE_BASE:[0-9]+]]{{.*}}, flags: DIFlagArtificial
34 ; CHECK-DAG: ![[DOUBLE_BASE]] = !DIBasicType(name: "__double_", size: 64, encoding: DW_ATE_float, flags: DIFlagArtificial)
35 ; CHECK-DAG: ![[INT32_2]] = !DIDerivedType(tag: DW_TAG_member, name: "__int_32_4", scope: ![[FRAME_TYPE]], file: ![[FILE]], line: [[CORO_FRAME_LINE]], baseType: ![[I32_BASE:[0-9]+]]{{.*}}, flags: DIFlagArtificial
36 ; CHECK-DAG: ![[I32_BASE]] = !DIBasicType(name: "__int_32", size: 32, encoding: DW_ATE_signed, flags: DIFlagArtificial)
37 ; CHECK-DAG: ![[INT32_3]] = !DIDerivedType(tag: DW_TAG_member, name: "__int_32_5", scope: ![[FRAME_TYPE]], file: ![[FILE]], line: [[CORO_FRAME_LINE]], baseType: ![[I32_BASE]]
38 ; CHECK-DAG: ![[UNALIGNED_UNKNOWN]] = !DIDerivedType(tag: DW_TAG_member, name: "_6",{{.*}}baseType: ![[UNALIGNED_UNKNOWN_BASE:[0-9]+]], size: 9
39 ; CHECK-DAG: ![[UNALIGNED_UNKNOWN_BASE]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[UNKNOWN_TYPE_BASE]], size: 16,{{.*}} elements: ![[UNALIGNED_UNKNOWN_ELEMENTS:[0-9]+]])
40 ; CHECK-DAG: ![[UNALIGNED_UNKNOWN_ELEMENTS]] = !{![[UNALIGNED_UNKNOWN_SUBRANGE:[0-9]+]]}
41 ; CHECk-DAG: ![[UNALIGNED_UNKNOWN_SUBRANGE]] = !DISubrange(count: 2, lowerBound: 0)
42 ; CHECK-DAG: ![[STRUCT]] = !DIDerivedType(tag: DW_TAG_member, name: "struct_big_structure_7", scope: ![[FRAME_TYPE]], file: ![[FILE]], line: [[CORO_FRAME_LINE]], baseType: ![[STRUCT_BASE:[0-9]+]]
43 ; CHECK-DAG: ![[STRUCT_BASE]] = !DICompositeType(tag: DW_TAG_structure_type, name: "struct_big_structure"{{.*}}, align: 64, flags: DIFlagArtificial, elements: ![[STRUCT_ELEMENTS:[0-9]+]]
44 ; CHECK-DAG: ![[STRUCT_ELEMENTS]] = !{![[MEM_TYPE:[0-9]+]]}
45 ; CHECK-DAG: ![[MEM_TYPE]] = !DIDerivedType(tag: DW_TAG_member,{{.*}} baseType: ![[MEM_TYPE_BASE:[0-9]+]], size: 4000
46 ; CHECK-DAG: ![[MEM_TYPE_BASE]] = !DICompositeType(tag: DW_TAG_array_type, baseType: ![[UNKNOWN_TYPE_BASE]], size: 4000,
47 ; CHECK-DAG: ![[CORO_INDEX]] = !DIDerivedType(tag: DW_TAG_member, name: "__coro_index"
48 ; CHECK-DAG: ![[SMALL_UNKNOWN]] = !DIDerivedType(tag: DW_TAG_member, name: "UnknownType_8",{{.*}} baseType: ![[UNKNOWN_TYPE_BASE]], size: 5
49 ; CHECK-DAG: ![[PROMISE_VAR:[0-9]+]] = !DILocalVariable(name: "__promise", scope: ![[RAMP_SCOPE:[0-9]+]], file: ![[FILE]]
50 ; CHECK-DAG: ![[RAMP_SCOPE]] = distinct !DILexicalBlock(scope: ![[RAMP]], file: ![[FILE]], line: 23
51 ; CHECK-DAG: ![[BAR_FUNC:[0-9]+]] = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv",
52 ; CHECK-DAG: ![[BAR_SCOPE:[0-9]+]] = distinct !DILexicalBlock(scope: ![[BAR_FUNC]], file: !1
53 ; CHECK-DAG: ![[FRAME_TYPE_IN_BAR:[0-9]+]] = !DICompositeType(tag: DW_TAG_structure_type, name: "bar.coro_frame_ty", file: ![[FILE]], line: [[BAR_LINE:[0-9]+]]{{.*}}elements: ![[ELEMENTS_IN_BAR:[0-9]+]]
54 ; CHECK-DAG: ![[ELEMENTS_IN_BAR]] = !{![[RESUME_FN_IN_BAR:[0-9]+]], ![[DESTROY_FN_IN_BAR:[0-9]+]], ![[PROMISE_IN_BAR:[0-9]+]], ![[VECTOR_TYPE_IN_BAR:[0-9]+]], ![[INT64_IN_BAR:[0-9]+]], ![[DOUBLE_IN_BAR:[0-9]+]], ![[INT64_PTR_IN_BAR:[0-9]+]], ![[INT32_IN_BAR:[0-9]+]], ![[STRUCT_IN_BAR:[0-9]+]], ![[CORO_INDEX_IN_BAR:[0-9]+]]
55 ; CHECK-DAG: ![[PROMISE_IN_BAR]] = !DIDerivedType(tag: DW_TAG_member, name: "__promise",{{.*}}baseType: ![[PROMISE_BASE]]
56 ; CHECK-DAG: ![[VECTOR_TYPE_IN_BAR]] = !DIDerivedType(tag: DW_TAG_member, name: "_0", scope: ![[FRAME_TYPE_IN_BAR]], file: ![[FILE]], line: [[BAR_LINE]], baseType: ![[VECTOR_TYPE_BASE]]
57 ; CHECK-DAG: ![[INT64_IN_BAR]] = !DIDerivedType(tag: DW_TAG_member, name: "__int_64_1", scope: ![[FRAME_TYPE_IN_BAR]], file: ![[FILE]], line: [[BAR_LINE]], baseType: ![[I64_BASE]]
58 ; CHECK-DAG: ![[DOUBLE_IN_BAR]] = !DIDerivedType(tag: DW_TAG_member, name: "__double__2", scope: ![[FRAME_TYPE_IN_BAR]], file: ![[FILE]], line: [[BAR_LINE]], baseType: ![[DOUBLE_BASE]]
59 ; CHECK-DAG: ![[INT32_IN_BAR]] = !DIDerivedType(tag: DW_TAG_member, name: "__int_32_4", scope: ![[FRAME_TYPE_IN_BAR]], file: ![[FILE]], line: [[BAR_LINE]], baseType: ![[I32_BASE]]
60 ; CHECK-DAG: ![[STRUCT_IN_BAR]] = !DIDerivedType(tag: DW_TAG_member, name: "struct_big_structure_5", scope: ![[FRAME_TYPE_IN_BAR]], file: ![[FILE]], line: [[BAR_LINE]], baseType: ![[STRUCT_BASE_IN_BAR:[0-9]+]]
61 ; CHECK-DAG: ![[STRUCT_BASE_IN_BAR]] = !DICompositeType(tag: DW_TAG_structure_type, name: "struct_big_structure", scope: ![[FRAME_TYPE_IN_BAR]], file: ![[FILE]], line: [[BAR_LINE]],{{.*}}, align: 64
62 ; CHECK-DAG: ![[CORO_FRAME_IN_RESUME]] = !DILocalVariable(name: "__coro_frame",{{.*}}type: ![[FRAME_TYPE]]
65 %promise_type = type { i32, i32, double }
66 %struct.big_structure = type { [500 x i8] }
67 declare void @produce(ptr)
68 declare void @consume(ptr)
69 declare void @produce_vector(ptr)
70 declare void @consume_vector(ptr)
71 declare void @produce_vectori5(ptr)
72 declare void @consume_vectori5(ptr)
73 declare void @produce_vectori9(ptr)
74 declare void @consume_vectori9(ptr)
75 declare void @pi32(ptr)
76 declare void @pi64(ptr)
77 declare void @pdouble(ptr)
78 declare void @pi64p(ptr)
80 define void @f(i32 %a, i32 %b, i64 %c, double %d, ptr %e) presplitcoroutine !dbg !8 {
82 %__promise = alloca %promise_type, align 8
83 %a.alloc = alloca i32, align 4
84 %b.alloc = alloca i32, align 4
85 %c.alloc = alloca i64, align 4
86 %d.alloc = alloca double, align 4
87 %e.alloc = alloca ptr, align 4
88 store i32 %a, ptr %a.alloc
89 store i32 %b, ptr %b.alloc
90 store i64 %c, ptr %c.alloc
91 store double %d, ptr %d.alloc
92 store ptr %e, ptr %e.alloc
93 %struct.data = alloca %struct.big_structure, align 1
94 call void @produce(ptr %struct.data)
95 ; We treat vector type as unresolved type now for test coverage.
96 %unresolved_data = alloca <4 x i32>
97 call void @produce_vector(ptr %unresolved_data)
98 %unresolved_data2 = alloca <5 x i1>
99 call void @produce_vectori5(ptr %unresolved_data2)
100 %unresolved_data3 = alloca <9 x i1>
101 call void @produce_vectori9(ptr %unresolved_data3)
102 %id = call token @llvm.coro.id(i32 16, ptr %__promise, ptr null, ptr null)
103 %alloc = call i1 @llvm.coro.alloc(token %id)
104 br i1 %alloc, label %coro.alloc, label %coro.init
106 coro.alloc: ; preds = %entry
107 %size = call i64 @llvm.coro.size.i64()
108 %memory = call ptr @new(i64 %size)
111 coro.init: ; preds = %coro.alloc, %entry
112 %phi.entry.alloc = phi ptr [ null, %entry ], [ %memory, %coro.alloc ]
113 %begin = call ptr @llvm.coro.begin(token %id, ptr %phi.entry.alloc)
114 call void @llvm.dbg.declare(metadata ptr %__promise, metadata !6, metadata !DIExpression()), !dbg !18
115 %ready = call i1 @await_ready()
116 br i1 %ready, label %init.ready, label %init.suspend
118 init.suspend: ; preds = %coro.init
119 %save = call token @llvm.coro.save(ptr null)
120 call void @await_suspend()
121 %suspend = call i8 @llvm.coro.suspend(token %save, i1 false)
122 switch i8 %suspend, label %coro.ret [
123 i8 0, label %init.ready
124 i8 1, label %init.cleanup
127 init.cleanup: ; preds = %init.suspend
130 init.ready: ; preds = %init.suspend, %coro.init
131 call void @await_resume()
132 %ready.again = call zeroext i1 @await_ready()
133 br i1 %ready.again, label %await.ready, label %await.suspend
135 await.suspend: ; preds = %init.ready
136 %save.again = call token @llvm.coro.save(ptr null)
137 %from.address = call ptr @from_address(ptr %begin)
138 call void @await_suspend()
139 %suspend.again = call i8 @llvm.coro.suspend(token %save.again, i1 false)
140 switch i8 %suspend.again, label %coro.ret [
141 i8 0, label %await.ready
142 i8 1, label %await.cleanup
145 await.cleanup: ; preds = %await.suspend
148 await.ready: ; preds = %await.suspend, %init.ready
149 call void @await_resume()
150 store i32 1, ptr %__promise, align 8
151 %j.i = getelementptr inbounds %promise_type, ptr %__promise, i64 0, i32 1
152 store i32 2, ptr %j.i, align 4
153 %k.i = getelementptr inbounds %promise_type, ptr %__promise, i64 0, i32 2
154 store double 3.000000e+00, ptr %k.i, align 8
155 call void @consume(ptr %struct.data)
156 call void @consume_vector(ptr %unresolved_data)
157 call void @consume_vectori5(ptr %unresolved_data2)
158 call void @consume_vectori9(ptr %unresolved_data3)
159 call void @pi32(ptr %a.alloc)
160 call void @pi32(ptr %b.alloc)
161 call void @pi64(ptr %c.alloc)
162 call void @pdouble(ptr %d.alloc)
163 call void @pi64p(ptr %e.alloc)
164 call void @return_void()
167 coro.final: ; preds = %await.ready
168 call void @final_suspend()
169 %coro.final.await_ready = call i1 @await_ready()
170 br i1 %coro.final.await_ready, label %final.ready, label %final.suspend
172 final.suspend: ; preds = %coro.final
173 %final.suspend.coro.save = call token @llvm.coro.save(ptr null)
174 %final.suspend.from_address = call ptr @from_address(ptr %begin)
175 call void @await_suspend()
176 %final.suspend.coro.suspend = call i8 @llvm.coro.suspend(token %final.suspend.coro.save, i1 true)
177 switch i8 %final.suspend.coro.suspend, label %coro.ret [
178 i8 0, label %final.ready
179 i8 1, label %final.cleanup
182 final.cleanup: ; preds = %final.suspend
185 final.ready: ; preds = %final.suspend, %coro.final
186 call void @await_resume()
189 cleanup: ; preds = %final.ready, %final.cleanup, %await.cleanup, %init.cleanup
190 %cleanup.dest.slot.0 = phi i32 [ 0, %final.ready ], [ 2, %final.cleanup ], [ 2, %await.cleanup ], [ 2, %init.cleanup ]
191 %free.memory = call ptr @llvm.coro.free(token %id, ptr %begin)
192 %free = icmp ne ptr %free.memory, null
193 br i1 %free, label %coro.free, label %after.coro.free
195 coro.free: ; preds = %cleanup
196 call void @delete(ptr %free.memory)
197 br label %after.coro.free
199 after.coro.free: ; preds = %coro.free, %cleanup
200 switch i32 %cleanup.dest.slot.0, label %unreachable [
201 i32 0, label %cleanup.cont
202 i32 2, label %coro.ret
205 cleanup.cont: ; preds = %after.coro.free
208 coro.ret: ; preds = %cleanup.cont, %after.coro.free, %final.suspend, %await.suspend, %init.suspend
209 %end = call i1 @llvm.coro.end(ptr null, i1 false, token none)
212 unreachable: ; preds = %after.coro.free
217 ; bar is used to check that we wouldn't create duplicate DIType
218 define void @bar(i32 %a, i64 %c, double %d, ptr %e) presplitcoroutine !dbg !19 {
220 %__promise = alloca %promise_type, align 8
221 %a.alloc = alloca i32, align 4
222 %c.alloc = alloca i64, align 4
223 %d.alloc = alloca double, align 4
224 %e.alloc = alloca ptr, align 4
225 store i32 %a, ptr %a.alloc
226 store i64 %c, ptr %c.alloc
227 store double %d, ptr %d.alloc
228 store ptr %e, ptr %e.alloc
229 %struct.data = alloca %struct.big_structure, align 1
230 call void @produce(ptr %struct.data)
231 ; We treat vector type as unresolved type now for test coverage.
232 %unresolved_data = alloca <4 x i32>
233 call void @produce_vector(ptr %unresolved_data)
234 %id = call token @llvm.coro.id(i32 16, ptr %__promise, ptr null, ptr null)
235 %alloc = call i1 @llvm.coro.alloc(token %id)
236 br i1 %alloc, label %coro.alloc, label %coro.init
238 coro.alloc: ; preds = %entry
239 %size = call i64 @llvm.coro.size.i64()
240 %memory = call ptr @new(i64 %size)
243 coro.init: ; preds = %coro.alloc, %entry
244 %phi.entry.alloc = phi ptr [ null, %entry ], [ %memory, %coro.alloc ]
245 %begin = call ptr @llvm.coro.begin(token %id, ptr %phi.entry.alloc)
246 call void @llvm.dbg.declare(metadata ptr %__promise, metadata !21, metadata !DIExpression()), !dbg !22
247 %ready = call i1 @await_ready()
248 br i1 %ready, label %init.ready, label %init.suspend
250 init.suspend: ; preds = %coro.init
251 %save = call token @llvm.coro.save(ptr null)
252 call void @await_suspend()
253 %suspend = call i8 @llvm.coro.suspend(token %save, i1 false)
254 switch i8 %suspend, label %coro.ret [
255 i8 0, label %init.ready
256 i8 1, label %init.cleanup
259 init.cleanup: ; preds = %init.suspend
262 init.ready: ; preds = %init.suspend, %coro.init
263 call void @await_resume()
264 %ready.again = call zeroext i1 @await_ready()
265 br i1 %ready.again, label %await.ready, label %await.suspend
267 await.suspend: ; preds = %init.ready
268 %save.again = call token @llvm.coro.save(ptr null)
269 %from.address = call ptr @from_address(ptr %begin)
270 call void @await_suspend()
271 %suspend.again = call i8 @llvm.coro.suspend(token %save.again, i1 false)
272 switch i8 %suspend.again, label %coro.ret [
273 i8 0, label %await.ready
274 i8 1, label %await.cleanup
277 await.cleanup: ; preds = %await.suspend
280 await.ready: ; preds = %await.suspend, %init.ready
281 call void @await_resume()
282 store i32 1, ptr %__promise, align 8
283 %j.i = getelementptr inbounds %promise_type, ptr %__promise, i64 0, i32 1
284 store i32 2, ptr %j.i, align 4
285 %k.i = getelementptr inbounds %promise_type, ptr %__promise, i64 0, i32 2
286 store double 3.000000e+00, ptr %k.i, align 8
287 call void @consume(ptr %struct.data)
288 call void @consume_vector(ptr %unresolved_data)
289 call void @pi32(ptr %a.alloc)
290 call void @pi64(ptr %c.alloc)
291 call void @pdouble(ptr %d.alloc)
292 call void @pi64p(ptr %e.alloc)
293 call void @return_void()
296 coro.final: ; preds = %await.ready
297 call void @final_suspend()
298 %coro.final.await_ready = call i1 @await_ready()
299 br i1 %coro.final.await_ready, label %final.ready, label %final.suspend
301 final.suspend: ; preds = %coro.final
302 %final.suspend.coro.save = call token @llvm.coro.save(ptr null)
303 %final.suspend.from_address = call ptr @from_address(ptr %begin)
304 call void @await_suspend()
305 %final.suspend.coro.suspend = call i8 @llvm.coro.suspend(token %final.suspend.coro.save, i1 true)
306 switch i8 %final.suspend.coro.suspend, label %coro.ret [
307 i8 0, label %final.ready
308 i8 1, label %final.cleanup
311 final.cleanup: ; preds = %final.suspend
314 final.ready: ; preds = %final.suspend, %coro.final
315 call void @await_resume()
318 cleanup: ; preds = %final.ready, %final.cleanup, %await.cleanup, %init.cleanup
319 %cleanup.dest.slot.0 = phi i32 [ 0, %final.ready ], [ 2, %final.cleanup ], [ 2, %await.cleanup ], [ 2, %init.cleanup ]
320 %free.memory = call ptr @llvm.coro.free(token %id, ptr %begin)
321 %free = icmp ne ptr %free.memory, null
322 br i1 %free, label %coro.free, label %after.coro.free
324 coro.free: ; preds = %cleanup
325 call void @delete(ptr %free.memory)
326 br label %after.coro.free
328 after.coro.free: ; preds = %coro.free, %cleanup
329 switch i32 %cleanup.dest.slot.0, label %unreachable [
330 i32 0, label %cleanup.cont
331 i32 2, label %coro.ret
334 cleanup.cont: ; preds = %after.coro.free
337 coro.ret: ; preds = %cleanup.cont, %after.coro.free, %final.suspend, %await.suspend, %init.suspend
338 %end = call i1 @llvm.coro.end(ptr null, i1 false, token none)
341 unreachable: ; preds = %after.coro.free
346 declare void @llvm.dbg.declare(metadata, metadata, metadata)
347 declare token @llvm.coro.id(i32, ptr readnone, ptr nocapture readonly, ptr)
348 declare i1 @llvm.coro.alloc(token)
349 declare i64 @llvm.coro.size.i64()
350 declare token @llvm.coro.save(ptr)
351 declare ptr @llvm.coro.begin(token, ptr writeonly)
352 declare i8 @llvm.coro.suspend(token, i1)
353 declare ptr @llvm.coro.free(token, ptr nocapture readonly)
354 declare i1 @llvm.coro.end(ptr, i1, token)
356 declare ptr @new(i64)
357 declare void @delete(ptr)
358 declare i1 @await_ready()
359 declare void @await_suspend()
360 declare void @await_resume()
361 declare void @print(i32)
362 declare ptr @from_address(ptr)
363 declare void @return_void()
364 declare void @final_suspend()
367 !llvm.linker.options = !{}
368 !llvm.module.flags = !{!3, !4}
371 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 11.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, splitDebugInlining: false, nameTableKind: None)
372 !1 = !DIFile(filename: "coro-debug.cpp", directory: ".")
374 !3 = !{i32 7, !"Dwarf Version", i32 4}
375 !4 = !{i32 2, !"Debug Info Version", i32 3}
376 !5 = !{!"clang version 11.0.0"}
377 !6 = !DILocalVariable(name: "__promise", scope: !7, file: !1, line: 24, type: !10)
378 !7 = distinct !DILexicalBlock(scope: !8, file: !1, line: 23, column: 12)
379 !8 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !8, file: !1, line: 23, type: !9, scopeLine: 23, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
380 !9 = !DISubroutineType(types: !2)
381 !10 = !DIDerivedType(tag: DW_TAG_typedef, name: "promise_type", scope: !8, file: !1, line: 15, baseType: !11)
382 !11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "promise_type", scope: !8, file: !1, line: 10, size: 128, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !12, identifier: "_ZTSN4coro12promise_typeE")
383 !12 = !{!13, !14, !15}
384 !13 = !DIDerivedType(tag: DW_TAG_member, name: "i", scope: !8, file: !1, line: 10, baseType: !16, size: 32)
385 !14 = !DIDerivedType(tag: DW_TAG_member, name: "j", scope: !8, file: !1, line: 10, baseType: !16, size: 32, offset: 32)
386 !15 = !DIDerivedType(tag: DW_TAG_member, name: "k", scope: !8, file: !1, line: 10, baseType: !17, size: 64, offset: 64)
387 !16 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
388 !17 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float)
389 !18 = !DILocation(line: 8, scope: !7)
390 !19 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !19, file: !1, line: 54, type: !9, scopeLine: 54, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
391 !20 = distinct !DILexicalBlock(scope: !19, file: !1, line: 23, column: 12)
392 !21 = !DILocalVariable(name: "__promise", scope: !20, file: !1, line: 55, type: !10)
393 !22 = !DILocation(line: 10, scope: !20)