@@ -349,10 +349,12 @@ bb0(%0 : @noImplicitCopy @_eagerMove $Int):
349
349
return %14 : $Int
350
350
}
351
351
352
- struct _UnsafeContinuation<T, R> {}
352
+ protocol P {}
353
+ extension Int: P {}
354
+ struct _UnsafeContinuation<T: P, R> {}
353
355
354
- sil @testCapturedUndefClosure : $@convention(thin) @substituted <τ_0_0> (_UnsafeContinuation<τ_0_0, any Error>, Int) -> () for <Int>
355
- sil @testCapturedUndefTakeClosure : $@convention(thin) <τ_0_0> (@guaranteed @noescape @callee_guaranteed @substituted <τ_0_0> (_UnsafeContinuation<τ_0_0, any Error>) -> () for <τ_0_0>) -> (@out τ_0_0, @error any Error)
356
+ sil @testCapturedUndefClosure : $@convention(thin) @substituted <τ_0_0: P > (_UnsafeContinuation<τ_0_0, any Error>, Int) -> () for <Int>
357
+ sil @testCapturedUndefTakeClosure : $@convention(thin) <τ_0_0: P > (@guaranteed @noescape @callee_guaranteed @substituted <τ_0_0: P > (_UnsafeContinuation<τ_0_0, any Error>) -> () for <τ_0_0>) -> (@out τ_0_0, @error any Error)
356
358
357
359
// insertDestroyOfCapturedArguments should not crash on 'undef'
358
360
//
@@ -362,22 +364,22 @@ sil @testCapturedUndefTakeClosure : $@convention(thin) <τ_0_0> (@guaranteed @no
362
364
sil hidden [ossa] @testCapturedUndef : $@convention(thin) (Int) -> (Int, @error any Error) {
363
365
bb0(%0 : $Int):
364
366
%5 = alloc_stack $Int
365
- %6 = function_ref @testCapturedUndefClosure : $@convention(thin) @substituted <τ_0_0> (_UnsafeContinuation<τ_0_0, any Error>, Int) -> () for <Int>
366
- %7 = partial_apply [callee_guaranteed] %6(undef) : $@convention(thin) @substituted <τ_0_0> (_UnsafeContinuation<τ_0_0, any Error>, Int) -> () for <Int>
367
- %8 = convert_escape_to_noescape [not_guaranteed] %7 : $@callee_guaranteed @substituted <τ_0_0> (_UnsafeContinuation<τ_0_0, any Error>) -> () for <Int> to $@noescape @callee_guaranteed @substituted <τ_0_0> (_UnsafeContinuation<τ_0_0, any Error>) -> () for <Int>
368
- destroy_value %7 : $@callee_guaranteed @substituted <τ_0_0> (_UnsafeContinuation<τ_0_0, any Error>) -> () for <Int>
367
+ %6 = function_ref @testCapturedUndefClosure : $@convention(thin) @substituted <τ_0_0: P > (_UnsafeContinuation<τ_0_0, any Error>, Int) -> () for <Int>
368
+ %7 = partial_apply [callee_guaranteed] %6(undef) : $@convention(thin) @substituted <τ_0_0: P > (_UnsafeContinuation<τ_0_0, any Error>, Int) -> () for <Int>
369
+ %8 = convert_escape_to_noescape [not_guaranteed] %7 : $@callee_guaranteed @substituted <τ_0_0: P > (_UnsafeContinuation<τ_0_0, any Error>) -> () for <Int> to $@noescape @callee_guaranteed @substituted <τ_0_0: P > (_UnsafeContinuation<τ_0_0, any Error>) -> () for <Int>
370
+ destroy_value %7 : $@callee_guaranteed @substituted <τ_0_0: P > (_UnsafeContinuation<τ_0_0, any Error>) -> () for <Int>
369
371
370
- %10 = function_ref @testCapturedUndefTakeClosure : $@convention(thin) <τ_0_0> (@guaranteed @noescape @callee_guaranteed @substituted <τ_0_0> (_UnsafeContinuation<τ_0_0, any Error>) -> () for <τ_0_0>) -> (@out τ_0_0, @error any Error)
371
- try_apply %10<Int>(%5, %8) : $@convention(thin) <τ_0_0> (@guaranteed @noescape @callee_guaranteed @substituted <τ_0_0> (_UnsafeContinuation<τ_0_0, any Error>) -> () for <τ_0_0>) -> (@out τ_0_0, @error any Error), normal bb1, error bb2
372
+ %10 = function_ref @testCapturedUndefTakeClosure : $@convention(thin) <τ_0_0: P > (@guaranteed @noescape @callee_guaranteed @substituted <τ_0_0: P > (_UnsafeContinuation<τ_0_0, any Error>) -> () for <τ_0_0>) -> (@out τ_0_0, @error any Error)
373
+ try_apply %10<Int>(%5, %8) : $@convention(thin) <τ_0_0: P > (@guaranteed @noescape @callee_guaranteed @substituted <τ_0_0: P > (_UnsafeContinuation<τ_0_0, any Error>) -> () for <τ_0_0>) -> (@out τ_0_0, @error any Error), normal bb1, error bb2
372
374
373
375
bb1(%12 : $()):
374
- destroy_value %8 : $@noescape @callee_guaranteed @substituted <τ_0_0> (_UnsafeContinuation<τ_0_0, any Error>) -> () for <Int>
376
+ destroy_value %8 : $@noescape @callee_guaranteed @substituted <τ_0_0: P > (_UnsafeContinuation<τ_0_0, any Error>) -> () for <Int>
375
377
%15 = load [trivial] %5 : $*Int
376
378
dealloc_stack %5 : $*Int
377
379
return %15 : $Int
378
380
379
381
bb2(%19 : @owned $any Error):
380
- destroy_value %8 : $@noescape @callee_guaranteed @substituted <τ_0_0> (_UnsafeContinuation<τ_0_0, any Error>) -> () for <Int>
382
+ destroy_value %8 : $@noescape @callee_guaranteed @substituted <τ_0_0: P > (_UnsafeContinuation<τ_0_0, any Error>) -> () for <Int>
381
383
dealloc_stack %5 : $*Int
382
384
throw %19 : $any Error
383
385
}
0 commit comments