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) {
135
135
val = cvt->getOperand ();
136
136
result = val;
137
137
continue ;
138
+ } else if (auto md = dyn_cast<MarkDependenceInst>(val)) {
139
+ val = md->getValue ();
140
+ result = val;
138
141
} else {
139
142
break ;
140
143
}
Original file line number Diff line number Diff line change @@ -30,22 +30,27 @@ enum E {
30
30
case B((Int32) -> Int32)
31
31
}
32
32
33
+ class C {
34
+ init()
35
+ }
33
36
34
37
// CHECK-LABEL: sil @testDirectClosure
35
38
// CHECK: [[C:%[0-9]+]] = thin_to_thick_function
36
- // CHECK: apply [[C]](
39
+ // CHECK: [[MD:%[0-9]+]] = mark_dependence [[C]]
40
+ // CHECK: apply [[MD]](
37
41
// CHECK: return
38
42
39
43
// CHECK-LOG-LABEL: Inline into caller: testDirectClosure
40
44
// CHECK-LOG-NEXT: decision {{.*}}, b=70,
41
45
42
- sil @testDirectClosure : $@convention(thin) () -> Int32 {
43
- bb0:
46
+ sil @testDirectClosure : $@convention(thin) (@guaranteed C ) -> Int32 {
47
+ bb0(%c : $C) :
44
48
%0 = function_ref @takeDirectClosure : $@convention(thin) (@owned @callee_guaranteed (Int32) -> Int32) -> Int32
45
49
%1 = function_ref @closure : $@convention(thin) (Int32) -> Int32
46
50
%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
49
54
}
50
55
51
56
sil @takeDirectClosure : $@convention(thin) (@owned @callee_guaranteed (Int32) -> Int32) -> Int32 {
You can’t perform that action at this time.
0 commit comments