File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,9 @@ SILValue swift::stripFunctionConversions(SILValue val) {
135135 val = cvt->getOperand ();
136136 result = val;
137137 continue ;
138+ } else if (auto md = dyn_cast<MarkDependenceInst>(val)) {
139+ val = md->getValue ();
140+ result = val;
138141 } else {
139142 break ;
140143 }
Original file line number Diff line number Diff line change @@ -30,22 +30,27 @@ enum E {
3030 case B((Int32) -> Int32)
3131}
3232
33+ class C {
34+ init()
35+ }
3336
3437// CHECK-LABEL: sil @testDirectClosure
3538// CHECK: [[C:%[0-9]+]] = thin_to_thick_function
36- // CHECK: apply [[C]](
39+ // CHECK: [[MD:%[0-9]+]] = mark_dependence [[C]]
40+ // CHECK: apply [[MD]](
3741// CHECK: return
3842
3943// CHECK-LOG-LABEL: Inline into caller: testDirectClosure
4044// CHECK-LOG-NEXT: decision {{.*}}, b=70,
4145
42- sil @testDirectClosure : $@convention(thin) () -> Int32 {
43- bb0:
46+ sil @testDirectClosure : $@convention(thin) (@guaranteed C ) -> Int32 {
47+ bb0(%c : $C) :
4448 %0 = function_ref @takeDirectClosure : $@convention(thin) (@owned @callee_guaranteed (Int32) -> Int32) -> Int32
4549 %1 = function_ref @closure : $@convention(thin) (Int32) -> Int32
4650 %2 = thin_to_thick_function %1 : $@convention(thin) (Int32) -> Int32 to $@callee_guaranteed (Int32) -> Int32
47- %3 = apply %0(%2) : $@convention(thin) (@owned @callee_guaranteed (Int32) -> Int32) -> Int32
48- return %3 : $Int32
51+ %3 = mark_dependence %2 on %c
52+ %4 = apply %0(%3) : $@convention(thin) (@owned @callee_guaranteed (Int32) -> Int32) -> Int32
53+ return %4 : $Int32
4954}
5055
5156sil @takeDirectClosure : $@convention(thin) (@owned @callee_guaranteed (Int32) -> Int32) -> Int32 {
You can’t perform that action at this time.
0 commit comments