Skip to content

Commit 121e280

Browse files
committed
Force escaping all thin functions. Ensure types are always unique.
1 parent 581b13f commit 121e280

17 files changed

+69
-79
lines changed

include/swift/AST/Types.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3088,14 +3088,6 @@ class AnyFunctionType : public TypeBase {
30883088
static_assert(
30893089
ASTExtInfoBuilder::NumMaskBits == NumAFTExtInfoBits,
30903090
"ExtInfo and AnyFunctionTypeBitfields must agree on bit size");
3091-
3092-
// Canonicalize all thin functions to be escaping (to keep compatibility
3093-
// with generic parameters).
3094-
Representation rep = Info.getValue().getRepresentation();
3095-
if (rep == FunctionTypeRepresentation::CFunctionPointer) {
3096-
auto extInfoBuilder = Info->intoBuilder().withNoEscape(false);
3097-
Bits.AnyFunctionType.ExtInfoBits = extInfoBuilder.bits;
3098-
}
30993091
} else {
31003092
Bits.AnyFunctionType.HasExtInfo = false;
31013093
Bits.AnyFunctionType.HasClangTypeInfo = false;

lib/AST/ASTContext.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,6 +3682,16 @@ FunctionType *FunctionType::get(ArrayRef<AnyFunctionType::Param> params,
36823682
auto properties = getFunctionRecursiveProperties(params, result, globalActor);
36833683
auto arena = getArena(properties);
36843684

3685+
if (info.hasValue()) {
3686+
// Canonicalize all thin functions to be escaping (to keep compatibility
3687+
// with generic parameters). Note that one can pass SIL-level representation
3688+
// here, so we need additional check for maximum non-SIL value.
3689+
Representation rep = info.getValue().getRepresentation();
3690+
if (rep <= FunctionTypeRepresentation::Last &&
3691+
isThinRepresentation(rep))
3692+
info = info->withNoEscape(false);
3693+
}
3694+
36853695
llvm::FoldingSetNodeID id;
36863696
FunctionType::Profile(id, params, result, info);
36873697

@@ -3962,13 +3972,6 @@ SILFunctionType::SILFunctionType(
39623972
if (!ext.getClangTypeInfo().empty())
39633973
*getTrailingObjects<ClangTypeInfo>() = ext.getClangTypeInfo();
39643974

3965-
// Canonicalize all thin functions to be escaping (to keep compatibility
3966-
// with generic parameters)
3967-
if (ext.getRepresentation() == SILFunctionTypeRepresentation::CFunctionPointer) {
3968-
auto extInfoBuilder = ext.intoBuilder().withNoEscape(false);
3969-
Bits.SILFunctionType.ExtInfoBits = extInfoBuilder.bits;
3970-
}
3971-
39723975
#ifndef NDEBUG
39733976
if (ext.getRepresentation() == Representation::WitnessMethod)
39743977
assert(!WitnessMethodConformance.isInvalid() &&
@@ -4106,6 +4109,10 @@ CanSILFunctionType SILFunctionType::get(
41064109
ext = ext.intoBuilder().withClangFunctionType(nullptr).build();
41074110
}
41084111

4112+
// Canonicalize all thin functions to be escaping (to keep compatibility
4113+
// with generic parameters)
4114+
if (isThinRepresentation(ext.getRepresentation()))
4115+
ext = ext.intoBuilder().withNoEscape(false);
41094116

41104117
llvm::FoldingSetNodeID id;
41114118
SILFunctionType::Profile(id, genericSig, ext, coroutineKind, callee, params,

test/AutoDiff/SILOptimizer/activity_analysis.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -552,14 +552,13 @@ func testTryApply(_ x: Float) -> Float {
552552
// CHECK: bb0:
553553
// CHECK: [ACTIVE] %0 = argument of bb0 : $Float
554554
// CHECK: [NONE] // function_ref closure #1 in testTryApply(_:)
555-
// CHECK: [NONE] %3 = convert_function %2 : $@convention(thin) () -> () to $@convention(thin) @noescape () -> ()
556-
// CHECK: [NONE] %4 = thin_to_thick_function %3 : $@convention(thin) @noescape () -> () to $@noescape @callee_guaranteed () -> ()
557-
// CHECK: [NONE] %5 = convert_function %4 : $@noescape @callee_guaranteed () -> () to $@noescape @callee_guaranteed () -> @error Error
555+
// CHECK: [NONE] %3 = thin_to_thick_function %2 : $@convention(thin) () -> () to $@noescape @callee_guaranteed () -> ()
556+
// CHECK: [NONE] %4 = convert_function %3 : $@noescape @callee_guaranteed () -> () to $@noescape @callee_guaranteed () -> @error Error
558557
// CHECK: [NONE] // function_ref rethrowing(_:)
559558
// CHECK: bb1:
560-
// CHECK: [NONE] %8 = argument of bb1 : $()
559+
// CHECK: [NONE] %7 = argument of bb1 : $()
561560
// CHECK: bb2:
562-
// CHECK: [NONE] %10 = argument of bb2 : $Error
561+
// CHECK: [NONE] %9 = argument of bb2 : $Error
563562

564563
//===----------------------------------------------------------------------===//
565564
// Coroutine differentiation (`begin_apply`)

test/IRGen/objc_retainAutoreleasedReturnValue.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public func test(_ dict: NSDictionary) {
3131
// CHECK: notail call i8* @llvm.objc.retainAutoreleasedReturnValue
3232
// CHECK: ret void
3333

34-
// OPT-LABEL: define {{.*}}swiftcc void @"$s34objc_retainAutoreleasedReturnValue4testyySo12NSDictionaryCFyADXEfU_"(%TSo12NSDictionaryC* %0)
34+
// OPT-LABEL: define {{.*}}swiftcc void @"$s34objc_retainAutoreleasedReturnValue10useClosureyySo12NSDictionaryC_yADXEtF09$s34objc_bcd16Value4testyySo12H10CFyADXEfU_Tf1nc_n"(%TSo12NSDictionaryC* %0)
3535
// OPT: entry:
3636
// OPT: call {{.*}}@objc_msgSend
3737
// OPT: notail call i8* @llvm.objc.retainAutoreleasedReturnValue

test/SIL/clang-function-type-windows.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ import ctypes
66

77
public func f(g: @convention(c, cType: "void (*)(size_t)") (Int) -> ()) { g(0) }
88

9-
// CHECK: sil @$s4main1f1gyySiXzC9_ZTSPFvyE_tF : $@convention(thin) (@convention(c, cType: "void (*)(unsigned long long)") @noescape (Int) -> ()) -> () {
10-
// CHECK: bb0(%0 : $@convention(c, cType: "void (*)(unsigned long long)") @noescape (Int) -> ()):
11-
// CHECK: debug_value %0 : $@convention(c, cType: "void (*)(unsigned long long)") @noescape (Int) -> (), let, name "g", argno 1 // id: %1
9+
// CHECK: sil @$s4main1f1gyySiXzC9_ZTSPFvyE_tF : $@convention(thin) (@convention(c, cType: "void (*)(unsigned long long)") (Int) -> ()) -> () {
10+
// CHECK: bb0(%0 : $@convention(c, cType: "void (*)(unsigned long long)") (Int) -> ()):
11+
// CHECK: debug_value %0 : $@convention(c, cType: "void (*)(unsigned long long)") (Int) -> (), let, name "g", argno 1 // id: %1

test/SILGen/async_builtins.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ public func usesWithUnsafeContinuation() async {
4343
let _: Int = await Builtin.withUnsafeContinuation { c in }
4444

4545
// CHECK: [[FN:%.*]] = function_ref @$s4test26usesWithUnsafeContinuationyyYaFyBcXEfU_ : $@convention(thin) (Builtin.RawUnsafeContinuation) -> ()
46-
// CHECK: [[TMP:%.*]] = convert_function [[FN]] : $@convention(thin) (Builtin.RawUnsafeContinuation) -> () to $@convention(thin) @noescape (Builtin.RawUnsafeContinuation) -> ()
47-
// CHECK: [[CLOSURE:%.*]] = thin_to_thick_function [[TMP]]
46+
// CHECK: [[CLOSURE:%.*]] = thin_to_thick_function [[FN]]
4847
// CHECK: [[BOX:%.*]] = alloc_stack $Int
4948
// CHECK: [[CC:%.*]] = get_async_continuation_addr Int, [[BOX]] : $*Int
5049
// CHECK: apply [[CLOSURE]]([[CC]]) : $@noescape @callee_guaranteed (Builtin.RawUnsafeContinuation) -> ()
@@ -58,8 +57,7 @@ public func usesWithUnsafeContinuation() async {
5857
let _: String = await Builtin.withUnsafeContinuation { c in }
5958

6059
// CHECK: [[FN:%.*]] = function_ref @$s4test26usesWithUnsafeContinuationyyYaFyBcXEfU0_ : $@convention(thin) (Builtin.RawUnsafeContinuation) -> ()
61-
// CHECK: [[TMP:%.*]] = convert_function [[FN]] : $@convention(thin) (Builtin.RawUnsafeContinuation) -> () to $@convention(thin) @noescape (Builtin.RawUnsafeContinuation) -> ()
62-
// CHECK: [[CLOSURE:%.*]] = thin_to_thick_function [[TMP]]
60+
// CHECK: [[CLOSURE:%.*]] = thin_to_thick_function [[FN]]
6361
// CHECK: [[BOX:%.*]] = alloc_stack $String
6462
// CHECK: [[CC:%.*]] = get_async_continuation_addr String, [[BOX]] : $*String
6563
// CHECK: apply [[CLOSURE]]([[CC]]) : $@noescape @callee_guaranteed (Builtin.RawUnsafeContinuation) -> ()
@@ -74,8 +72,7 @@ public func usesWithUnsafeContinuation() async {
7472
let _: Any = await Builtin.withUnsafeContinuation { c in }
7573

7674
// CHECK: [[FN:%.*]] = function_ref @$s4test26usesWithUnsafeContinuationyyYaFyBcXEfU1_ : $@convention(thin) (Builtin.RawUnsafeContinuation) -> ()
77-
// CHECK: [[TMP:%.*]] = convert_function [[FN]] : $@convention(thin) (Builtin.RawUnsafeContinuation) -> () to $@convention(thin) @noescape (Builtin.RawUnsafeContinuation) -> ()
78-
// CHECK: [[CLOSURE:%.*]] = thin_to_thick_function [[TMP]]
75+
// CHECK: [[CLOSURE:%.*]] = thin_to_thick_function [[FN]]
7976
// CHECK: [[BOX:%.*]] = alloc_stack $Any
8077
// CHECK: [[CC:%.*]] = get_async_continuation_addr Any, [[BOX]] : $*Any
8178
// CHECK: apply [[CLOSURE]]([[CC]]) : $@noescape @callee_guaranteed (Builtin.RawUnsafeContinuation) -> ()
@@ -94,8 +91,7 @@ public func usesWithUnsafeThrowingContinuation() async throws {
9491
let _: Int = try await Builtin.withUnsafeThrowingContinuation { c in }
9592

9693
// CHECK: [[FN:%.*]] = function_ref @$s4test34usesWithUnsafeThrowingContinuationyyYaKFyBcXEfU_ : $@convention(thin) (Builtin.RawUnsafeContinuation) -> ()
97-
// CHECK: [[TMP:%.*]] = convert_function [[FN]] : $@convention(thin) (Builtin.RawUnsafeContinuation) -> () to $@convention(thin) @noescape (Builtin.RawUnsafeContinuation) -> ()
98-
// CHECK: [[CLOSURE:%.*]] = thin_to_thick_function [[TMP]]
94+
// CHECK: [[CLOSURE:%.*]] = thin_to_thick_function [[FN]]
9995
// CHECK: [[BOX:%.*]] = alloc_stack $Int
10096
// CHECK: [[CC:%.*]] = get_async_continuation_addr [throws] Int, [[BOX]] : $*Int
10197
// CHECK: apply [[CLOSURE]]([[CC]]) : $@noescape @callee_guaranteed (Builtin.RawUnsafeContinuation) -> ()

test/SILGen/auto_closures.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ func test_auto_closure_with_capture(_ x: Bool) -> Bool {
2525
// CHECK-LABEL: sil hidden [ossa] @$s13auto_closures05test_A24_closure_without_capture{{[_0-9a-zA-Z]*}}F
2626
func test_auto_closure_without_capture() -> Bool {
2727
// CHECK: [[CLOSURE:%.*]] = function_ref @$s13auto_closures05test_A24_closure_without_capture
28-
// CHECK: [[CVT:%.*]] = convert_function [[CLOSURE]]
29-
// CHECK: [[THICK:%.*]] = thin_to_thick_function [[CVT]] : $@convention(thin) @noescape () -> Bool to $@noescape @callee_guaranteed () -> Bool
28+
// CHECK: [[THICK:%.*]] = thin_to_thick_function [[CLOSURE]] : $@convention(thin) () -> Bool to $@noescape @callee_guaranteed () -> Bool
3029
// CHECK: [[RET:%.*]] = apply {{%.*}}([[THICK]])
3130
// CHECK: return [[RET]]
3231
return call_auto_closure(false_)

test/SILGen/closures_callee_guaranteed.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ public func apply(_ f : () -> Int) -> Int {
2222

2323
// CHECK-LABEL: sil [ossa] @{{.*}}test{{.*}} : $@convention(thin) () -> ()
2424
// CHECK: [[C1:%.*]] = function_ref @{{.*}}test{{.*}} : $@convention(thin) () -> Int
25-
// CHECK: [[C2:%.*]] = convert_function [[C1]] : $@convention(thin) () -> Int to $@convention(thin) @noescape () -> Int
26-
// CHECK: [[C3:%.*]] = thin_to_thick_function [[C2]] : $@convention(thin) @noescape () -> Int to $@noescape @callee_guaranteed () -> Int
25+
// CHECK: [[C3:%.*]] = thin_to_thick_function [[C1]] : $@convention(thin) () -> Int to $@noescape @callee_guaranteed () -> Int
2726
// CHECK: [[A:%.*]] = function_ref @{{.*}}apply{{.*}} : $@convention(thin) (@noescape @callee_guaranteed () -> Int) -> Int
2827
// CHECK: apply [[A]]([[C3]]) : $@convention(thin) (@noescape @callee_guaranteed () -> Int) -> Int
2928
public func test() {

test/SILGen/objc_blocks_bridging.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ func bridgeNonnullBlockResult() {
175175
// CHECK-LABEL: sil hidden [ossa] @$s20objc_blocks_bridging19bridgeNoescapeBlock2fn5optFnyyyXE_yycSgtF
176176
func bridgeNoescapeBlock(fn: () -> (), optFn: (() -> ())?) {
177177
// CHECK: [[CLOSURE_FN:%.*]] = function_ref @$s20objc_blocks_bridging19bridgeNoescapeBlock2fn5optFnyyyXE_yycSgtFyyXEfU_
178-
// CHECK: [[CONV_FN:%.*]] = convert_function [[CLOSURE_FN]]
179-
// CHECK: [[THICK_FN:%.*]] = thin_to_thick_function [[CONV_FN]]
178+
// CHECK: [[THICK_FN:%.*]] = thin_to_thick_function [[CLOSURE_FN]]
180179
// without actually escaping sentinel
181180
// CHECK: [[WAE_THUNK:%.*]] = function_ref @$sIg_Ieg_TR
182181
// CHECK: [[WAE_PA:%.*]] = partial_apply [callee_guaranteed] [[WAE_THUNK]]([[THICK_FN]])
@@ -224,8 +223,7 @@ func bridgeNoescapeBlock(fn: () -> (), optFn: (() -> ())?) {
224223
noescapeBlock(nil)
225224

226225
// CHECK: [[CLOSURE_FN:%.*]] = function_ref @$s20objc_blocks_bridging19bridgeNoescapeBlock2fn5optFnyyyXE_yycSgtF
227-
// CHECK: [[CONV_FN:%.*]] = convert_function [[CLOSURE_FN]]
228-
// CHECK: [[THICK_FN:%.*]] = thin_to_thick_function [[CONV_FN]]
226+
// CHECK: [[THICK_FN:%.*]] = thin_to_thick_function [[CLOSURE_FN]]
229227
// CHECK: [[WAE_THUNK:%.*]] = function_ref @$sIg_Ieg_TR
230228
// CHECK: [[WAE_PA:%.*]] = partial_apply [callee_guaranteed] [[WAE_THUNK]]([[THICK_FN]])
231229
// CHECK: [[WAE_MD:%.*]] = mark_dependence [[WAE_PA]] : $@callee_guaranteed () -> () on [[THICK_FN]]

test/SILGen/parameterized_existentials.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ func use(_ k: (S) -> Void) {}
5454
// CHECK-LABEL: sil hidden [ossa] @$s13parameterized11upcastInputyyF : $@convention(thin) () -> () {
5555
func upcastInput() {
5656
// CHECK: [[P_FN:%.*]] = function_ref @$s13parameterized11upcastInputyyFyAA1P_pXEfU_ : $@convention(thin) (@in_guaranteed P) -> ()
57-
// CHECK: [[NOESCAPE_P_FN:%.*]] = convert_function [[P_FN]] : $@convention(thin) (@in_guaranteed P) -> () to $@convention(thin) @noescape (@in_guaranteed P) -> ()
58-
// CHECK: [[THICK_P_FN:%.*]] = thin_to_thick_function [[NOESCAPE_P_FN]] : $@convention(thin) @noescape (@in_guaranteed P) -> () to $@noescape @callee_guaranteed (@in_guaranteed P) -> ()
57+
// CHECK: [[THICK_P_FN:%.*]] = thin_to_thick_function [[P_FN]] : $@convention(thin) (@in_guaranteed P) -> () to $@noescape @callee_guaranteed (@in_guaranteed P) -> ()
5958
// CHECK: [[S_TO_P_THUNK_FN:%.*]] = function_ref @$s13parameterized1P_pIgn_AA1SVIegy_TR : $@convention(thin) (S, @noescape @callee_guaranteed (@in_guaranteed P) -> ()) -> ()
6059
// CHECK: [[PARTIAL_INT_THUNK_FN:%.*]] = partial_apply [callee_guaranteed] [[S_TO_P_THUNK_FN]]([[THICK_P_FN]]) : $@convention(thin) (S, @noescape @callee_guaranteed (@in_guaranteed P) -> ()) -> ()
6160
// CHECK: [[NOESCAPE_P_THUNK_FN:%.*]] = convert_escape_to_noescape [not_guaranteed] [[PARTIAL_INT_THUNK_FN]] : $@callee_guaranteed (S) -> () to $@noescape @callee_guaranteed (S) -> ()
@@ -70,8 +69,7 @@ func reuse(_ k: () -> any P<Int, String, Float>) {}
7069
// CHECK-LABEL: sil hidden [ossa] @$s13parameterized12upcastResultyyF : $@convention(thin) () -> () {
7170
func upcastResult() {
7271
// CHECK: [[RES_FN:%.*]] = function_ref @$s13parameterized12upcastResultyyFAA1SVyXEfU_ : $@convention(thin) () -> S
73-
// CHECK: [[NOESCAPE_RES_FN:%.*]] = convert_function [[RES_FN]] : $@convention(thin) () -> S to $@convention(thin) @noescape () -> S
74-
// CHECK: [[THICK_RES_FN:%.*]] = thin_to_thick_function [[NOESCAPE_RES_FN]] : $@convention(thin) @noescape () -> S to $@noescape @callee_guaranteed () -> S
72+
// CHECK: [[THICK_RES_FN:%.*]] = thin_to_thick_function [[RES_FN]] : $@convention(thin) () -> S to $@noescape @callee_guaranteed () -> S
7573
// CHECK: [[S_TO_P_RES_THUNK_FN:%.*]] = function_ref @$s13parameterized1SVIgd_AA1P_pySiSSSfXPIegr_TR : $@convention(thin) (@noescape @callee_guaranteed () -> S) -> @out P<Int, String, Float>
7674
// CHECK: [[PARTIAL_RES_THUNK_FN:%.*]] = partial_apply [callee_guaranteed] [[S_TO_P_RES_THUNK_FN]]([[THICK_RES_FN]]) : $@convention(thin) (@noescape @callee_guaranteed () -> S) -> @out P<Int, String, Float>
7775
// CHECK: [[NOESCAPE_RES_THUNK_FN:%.*]] = convert_escape_to_noescape [not_guaranteed] [[PARTIAL_RES_THUNK_FN]] : $@callee_guaranteed () -> @out P<Int, String, Float> to $@noescape @callee_guaranteed () -> @out P<Int, String, Float>
@@ -81,8 +79,7 @@ func upcastResult() {
8179
reuse({ () -> S in S() })
8280

8381
// CHECK: [[RES_Q_FN:%.*]] = function_ref @$s13parameterized12upcastResultyyFAA1Q_pySiSSSfXPyXEfU0_ : $@convention(thin) () -> @out Q<Int, String, Float>
84-
// CHECK: [[NOESCAPE_RES_Q_FN:%.*]] = convert_function [[RES_Q_FN]] : $@convention(thin) () -> @out Q<Int, String, Float> to $@convention(thin) @noescape () -> @out Q<Int, String, Float>
85-
// CHECK: [[THICK_NOESCAPE_RES_Q_FN:%.*]] = thin_to_thick_function [[NOESCAPE_RES_Q_FN]] : $@convention(thin) @noescape () -> @out Q<Int, String, Float> to $@noescape @callee_guaranteed () -> @out Q<Int, String, Float>
82+
// CHECK: [[THICK_NOESCAPE_RES_Q_FN:%.*]] = thin_to_thick_function [[RES_Q_FN]] : $@convention(thin) () -> @out Q<Int, String, Float> to $@noescape @callee_guaranteed () -> @out Q<Int, String, Float>
8683
// CHECK: [[P_TO_Q_RES_THUNK_FN:%.*]] = function_ref @$s13parameterized1Q_pySiSSSfXPIgr_AA1P_pySiSSSfXPIegr_TR : $@convention(thin) (@noescape @callee_guaranteed () -> @out Q<Int, String, Float>) -> @out P<Int, String, Float>
8784
// CHECK: [[PARTIAL_P_TO_Q_RES_THUNK_FN:%.*]] = partial_apply [callee_guaranteed] [[P_TO_Q_RES_THUNK_FN]]([[THICK_NOESCAPE_RES_Q_FN]]) : $@convention(thin) (@noescape @callee_guaranteed () -> @out Q<Int, String, Float>) -> @out P<Int, String, Float>
8885
// CHECK: [[NOESCAPE_PARTIAL_P_TO_Q_RES_THUNK_FN:%.*]] = convert_escape_to_noescape [not_guaranteed] [[PARTIAL_P_TO_Q_RES_THUNK_FN]] : $@callee_guaranteed () -> @out P<Int, String, Float> to $@noescape @callee_guaranteed () -> @out P<Int, String, Float>

test/SILGen/rethrows.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ func test0() throws {
2727

2828
// CHECK-LABEL: sil hidden @$s8rethrows5test1yyKF : $@convention(thin) () -> @error Error {
2929
// CHECK: [[CLOSURE:%.*]] = function_ref @$s8rethrows5test1yyKFSiyKXEfU_ : $@convention(thin) () -> (Int, @error Error)
30-
// CHECK: [[CVT:%.*]] = convert_function [[CLOSURE]]
31-
// CHECK: [[T0:%.*]] = thin_to_thick_function [[CVT]]
30+
// CHECK: [[T0:%.*]] = thin_to_thick_function [[CLOSURE]]
3231
// CHECK: [[RETHROWER:%.*]] = function_ref @$s8rethrows9rethroweryS2iyKXEKF : $@convention(thin) (@noescape @callee_guaranteed () -> (Int, @error Error)) -> (Int, @error Error)
3332
// CHECK: try_apply [[RETHROWER]]([[T0]]) : $@convention(thin) (@noescape @callee_guaranteed () -> (Int, @error Error)) -> (Int, @error Error), normal [[NORMAL:bb1]], error [[ERROR:bb2]]
3433
// CHECK: [[NORMAL]]({{%.*}} : $Int):
@@ -72,8 +71,7 @@ func test2() {
7271

7372
// CHECK-LABEL: sil hidden @$s8rethrows5test3yyF : $@convention(thin) () -> () {
7473
// CHECK: [[CLOSURE:%.*]] = function_ref @$s8rethrows5test3yyFSiyXEfU_ : $@convention(thin) () -> Int
75-
// CHECK: [[CVT:%.*]] = convert_function [[CLOSURE]] : $@convention(thin) () -> Int to $@convention(thin) @noescape () -> Int
76-
// CHECK: [[T0:%.*]] = thin_to_thick_function [[CVT]]
74+
// CHECK: [[T0:%.*]] = thin_to_thick_function [[CLOSURE]]
7775
// CHECK: [[T1:%.*]] = convert_function [[T0]] : $@noescape @callee_guaranteed () -> Int to $@noescape @callee_guaranteed () -> (Int, @error Error)
7876
// CHECK: [[RETHROWER:%.*]] = function_ref @$s8rethrows9rethroweryS2iyKXEKF : $@convention(thin) (@noescape @callee_guaranteed () -> (Int, @error Error)) -> (Int, @error Error)
7977
// CHECK: try_apply [[RETHROWER]]([[T1]]) : $@convention(thin) (@noescape @callee_guaranteed () -> (Int, @error Error)) -> (Int, @error Error), normal [[NORMAL:bb1]], error [[ERROR:bb2]]

0 commit comments

Comments
 (0)