mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILGen: Remaining fixes for @callee_guaranteed closures and enable it
- Fix block to func reabstraction thunks block argument handling - Forward cast ownership - Fix applyPartiallyAppliedSuperMethod ownership for @callee_guaranteed closures - Avoid a copy in buildBlockToFuncThunkBody - Update tests for callee_guaranteed closures SR-5441 rdar://33255593
This commit is contained in:
@@ -116,8 +116,8 @@ func test_unowned_let_capture(_ aC : C) {
|
||||
takeClosure { bC.f() }
|
||||
}
|
||||
|
||||
// CHECK-LABEL: sil private @_T07unowned05test_A12_let_captureyAA1CCFSiycfU_ : $@convention(thin) (@owned @sil_unowned C) -> Int {
|
||||
// CHECK: bb0([[ARG:%.*]] : @owned $@sil_unowned C):
|
||||
// CHECK-LABEL: sil private @_T07unowned05test_A12_let_captureyAA1CCFSiycfU_ : $@convention(thin) (@guaranteed @sil_unowned C) -> Int {
|
||||
// CHECK: bb0([[ARG:%.*]] : @guaranteed $@sil_unowned C):
|
||||
// CHECK-NEXT: debug_value %0 : $@sil_unowned C, let, name "bC", argno 1
|
||||
// CHECK-NEXT: [[UNOWNED_ARG:%.*]] = copy_unowned_value [[ARG]] : $@sil_unowned C
|
||||
// CHECK-NEXT: [[BORROWED_UNOWNED_ARG:%.*]] = begin_borrow [[UNOWNED_ARG]]
|
||||
@@ -125,7 +125,6 @@ func test_unowned_let_capture(_ aC : C) {
|
||||
// CHECK-NEXT: [[RESULT:%.*]] = apply [[FUN]]([[BORROWED_UNOWNED_ARG]]) : $@convention(method) (@guaranteed C) -> Int
|
||||
// CHECK-NEXT: end_borrow [[BORROWED_UNOWNED_ARG]]
|
||||
// CHECK-NEXT: destroy_value [[UNOWNED_ARG]]
|
||||
// CHECK-NEXT: destroy_value [[ARG]] : $@sil_unowned C
|
||||
// CHECK-NEXT: return [[RESULT]] : $Int
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user