Skip to content

Commit af11149

Browse files
committed
SIL: Implement the [serialized] vs [serializable] distinction
This generalizes a hack where re-abstraction thunks become fragile on contact with fragile functions. The old policy was: - [fragile] functions always serialized - [reabstraction_thunk] transitively referenced from fragile always serialized The new policy is: - [serialized] functions always serialized - [serializable] functions transitively referenced from serialized functions are always serialized - Most kinds of thunks can now be [serializable], allowing them to be shared between serialized and non-serialized code without any issues, as long as the body of the thunk is sufficiently "simple" (doesn't reference private symbols or performs direct access to resilient types)
1 parent 695a8d2 commit af11149

16 files changed

+98
-99
lines changed

include/swift/SIL/SILFunction.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ class SILFunction
382382
/// Returns true if this function can be inlined into a fragile function
383383
/// body.
384384
bool hasValidLinkageForFragileInline() const {
385-
return isSerialized() || isThunk() == IsReabstractionThunk;
385+
return (isSerialized() == IsSerialized ||
386+
isSerialized() == IsSerializable);
386387
}
387388

388389
/// Returns true if this function can be referenced from a fragile function

lib/SIL/Linker.cpp

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -182,41 +182,42 @@ bool SILLinkerVisitor::visitApplyInst(ApplyInst *AI) {
182182
if (!Callee)
183183
return false;
184184

185-
// If the linking mode is not link all, AI is not transparent, and the
186-
// callee is not shared, we don't want to perform any linking.
187-
if (!isLinkAll() && !Callee->isTransparent() &&
188-
!hasSharedVisibility(Callee->getLinkage()))
189-
return false;
185+
if (isLinkAll() ||
186+
hasSharedVisibility(Callee->getLinkage())) {
187+
addFunctionToWorklist(Callee);
188+
return true;
189+
}
190190

191-
// Otherwise we want to try and link in the callee... Add it to the callee
192-
// list and return true.
193-
addFunctionToWorklist(Callee);
194-
return true;
191+
return false;
195192
}
196193

197194
bool SILLinkerVisitor::visitPartialApplyInst(PartialApplyInst *PAI) {
198195
SILFunction *Callee = PAI->getReferencedFunction();
199196
if (!Callee)
200197
return false;
201-
if (!isLinkAll() && !Callee->isTransparent() &&
202-
!hasSharedVisibility(Callee->getLinkage()))
203-
return false;
204198

205-
addFunctionToWorklist(Callee);
206-
return true;
199+
if (isLinkAll() ||
200+
hasSharedVisibility(Callee->getLinkage())) {
201+
addFunctionToWorklist(Callee);
202+
return true;
203+
}
204+
205+
return false;
207206
}
208207

209208
bool SILLinkerVisitor::visitFunctionRefInst(FunctionRefInst *FRI) {
210209
// Needed to handle closures which are no longer applied, but are left
211210
// behind as dead code. This shouldn't happen, but if it does don't get into
212211
// an inconsistent state.
213212
SILFunction *Callee = FRI->getReferencedFunction();
214-
if (!isLinkAll() && !Callee->isTransparent() &&
215-
!hasSharedVisibility(Callee->getLinkage()))
216-
return false;
217213

218-
addFunctionToWorklist(FRI->getReferencedFunction());
219-
return true;
214+
if (isLinkAll() ||
215+
hasSharedVisibility(Callee->getLinkage())) {
216+
addFunctionToWorklist(FRI->getReferencedFunction());
217+
return true;
218+
}
219+
220+
return false;
220221
}
221222

222223
bool SILLinkerVisitor::visitProtocolConformance(

lib/SILGen/SILGenThunk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,6 @@ getOrCreateReabstractionThunk(GenericEnvironment *genericEnv,
283283

284284
auto loc = RegularLocation::getAutoGeneratedLocation();
285285
return M.getOrCreateSharedFunction(loc, name, thunkType, IsBare,
286-
IsTransparent, Serialized,
286+
IsTransparent, IsSerializable,
287287
IsReabstractionThunk);
288288
}

lib/Serialization/SerializeSIL.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,10 @@ void SILSerializer::addReferencedSILFunction(const SILFunction *F,
270270
return;
271271
}
272272

273-
// If we referenced a non-fragile shared function from a fragile
274-
// function, serialize it too. In practice, it will either be a
275-
// thunk, or an optimizer specialization. In both cases, we don't
276-
// have enough information at the time we emit the function to
277-
// know if it should be marked fragile or not.
278273
if (F->getLinkage() == SILLinkage::Shared && !DeclOnly) {
279-
assert(F->isThunk() == IsReabstractionThunk || F->hasForeignBody());
274+
assert(F->isSerialized() == IsSerializable ||
275+
F->hasForeignBody());
276+
280277
FuncsToEmit[F] = false;
281278
Worklist.push_back(F);
282279
return;
@@ -1996,7 +1993,7 @@ bool SILSerializer::shouldEmitFunctionBody(const SILFunction *F,
19961993
return true;
19971994

19981995
// If F is serialized, we should always emit its body.
1999-
if (F->isSerialized())
1996+
if (F->isSerialized() == IsSerialized)
20001997
return true;
20011998

20021999
return false;

test/SILGen/errors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ func create<T>(_ fn: () throws -> T) throws -> T {
293293
func testThunk(_ fn: () throws -> Int) throws -> Int {
294294
return try create(fn)
295295
}
296-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0Sis5Error_pIxdzo_SisAA_pIxrzo_TR : $@convention(thin) (@owned @callee_owned () -> (Int, @error Error)) -> (@out Int, @error Error)
296+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0Sis5Error_pIxdzo_SisAA_pIxrzo_TR : $@convention(thin) (@owned @callee_owned () -> (Int, @error Error)) -> (@out Int, @error Error)
297297
// CHECK: bb0(%0 : $*Int, %1 : $@callee_owned () -> (Int, @error Error)):
298298
// CHECK: try_apply %1()
299299
// CHECK: bb1([[T0:%.*]] : $Int):

test/SILGen/function_conversion.swift

Lines changed: 28 additions & 28 deletions
Large diffs are not rendered by default.

test/SILGen/function_conversion_objc.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func convMetatypeToObject(_ f: @escaping (NSObject) -> NSObject.Type) {
1313
let _: (NSObject) -> AnyObject = f
1414
}
1515

16-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0So8NSObjectCABXMTIxxd_ABs9AnyObject_pIxxo_TR : $@convention(thin) (@owned NSObject, @owned @callee_owned (@owned NSObject) -> @thick NSObject.Type) -> @owned AnyObject {
16+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0So8NSObjectCABXMTIxxd_ABs9AnyObject_pIxxo_TR : $@convention(thin) (@owned NSObject, @owned @callee_owned (@owned NSObject) -> @thick NSObject.Type) -> @owned AnyObject {
1717
// CHECK: apply %1(%0)
1818
// CHECK: thick_to_objc_metatype {{.*}} : $@thick NSObject.Type to $@objc_metatype NSObject.Type
1919
// CHECK: objc_metatype_to_object {{.*}} : $@objc_metatype NSObject.Type to $AnyObject
@@ -28,7 +28,7 @@ func convExistentialMetatypeToObject(_ f: @escaping (NSBurrito) -> NSBurrito.Typ
2828
let _: (NSBurrito) -> AnyObject = f
2929
}
3030

31-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T024function_conversion_objc9NSBurrito_pAaB_pXmTIxxd_AaB_ps9AnyObject_pIxxo_TR : $@convention(thin) (@owned NSBurrito, @owned @callee_owned (@owned NSBurrito) -> @thick NSBurrito.Type) -> @owned AnyObject
31+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T024function_conversion_objc9NSBurrito_pAaB_pXmTIxxd_AaB_ps9AnyObject_pIxxo_TR : $@convention(thin) (@owned NSBurrito, @owned @callee_owned (@owned NSBurrito) -> @thick NSBurrito.Type) -> @owned AnyObject
3232
// CHECK: apply %1(%0)
3333
// CHECK: thick_to_objc_metatype {{.*}} : $@thick NSBurrito.Type to $@objc_metatype NSBurrito.Type
3434
// CHECK: objc_existential_metatype_to_object {{.*}} : $@objc_metatype NSBurrito.Type to $AnyObject
@@ -41,7 +41,7 @@ func convProtocolMetatypeToObject(_ f: @escaping () -> NSBurrito.Protocol) {
4141
let _: () -> Protocol = f
4242
}
4343

44-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T024function_conversion_objc9NSBurrito_pXMtIxd_So8ProtocolCIxo_TR : $@convention(thin) (@owned @callee_owned () -> @thin NSBurrito.Protocol) -> @owned Protocol
44+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T024function_conversion_objc9NSBurrito_pXMtIxd_So8ProtocolCIxo_TR : $@convention(thin) (@owned @callee_owned () -> @thin NSBurrito.Protocol) -> @owned Protocol
4545
// CHECK: apply %0() : $@callee_owned () -> @thin NSBurrito.Protocol
4646
// CHECK: objc_protocol #NSBurrito : $Protocol
4747
// CHECK: copy_value
@@ -85,9 +85,9 @@ func blockToFuncExistential(_ x: @escaping @convention(block) () -> Int) -> () -
8585
return x
8686
}
8787

88-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0SiIyBd_SiIxd_TR : $@convention(thin) (@owned @convention(block) () -> Int) -> Int
88+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0SiIyBd_SiIxd_TR : $@convention(thin) (@owned @convention(block) () -> Int) -> Int
8989

90-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0SiIxd_ypIxr_TR : $@convention(thin) (@owned @callee_owned () -> Int) -> @out Any
90+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0SiIxd_ypIxr_TR : $@convention(thin) (@owned @callee_owned () -> Int) -> @out Any
9191

9292
// C function pointer conversions
9393

test/SILGen/generic_objc_block_bridge.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ class Tubb<GenericParamName>: Butt {
1414
}
1515
}
1616

17-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0S2iIyByd_S2iIxyd_TR : $@convention(thin) (Int, @owned @convention(block) (Int) -> Int) -> Int {
17+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0S2iIyByd_S2iIxyd_TR : $@convention(thin) (Int, @owned @convention(block) (Int) -> Int) -> Int {

test/SILGen/nested_generics.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func eatDinnerConcrete(d: inout Lunch<Pizzas<ChiliFlakes>.NewYork>.Dinner<HotDog
154154
}
155155

156156
// CHECK-LABEL: // reabstraction thunk helper from @callee_owned (@owned nested_generics.Pizzas<nested_generics.ChiliFlakes>.NewYork) -> (@out nested_generics.HotDogs.American) to @callee_owned (@owned nested_generics.Pizzas<nested_generics.ChiliFlakes>.NewYork) -> (@unowned nested_generics.HotDogs.American)
157-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T015nested_generics6PizzasV7NewYorkCyAA11ChiliFlakesV_GAA7HotDogsC8AmericanVIxxr_AhLIxxd_TR : $@convention(thin) (@owned Pizzas<ChiliFlakes>.NewYork, @owned @callee_owned (@owned Pizzas<ChiliFlakes>.NewYork) -> @out HotDogs.American) -> HotDogs.American
157+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T015nested_generics6PizzasV7NewYorkCyAA11ChiliFlakesV_GAA7HotDogsC8AmericanVIxxr_AhLIxxd_TR : $@convention(thin) (@owned Pizzas<ChiliFlakes>.NewYork, @owned @callee_owned (@owned Pizzas<ChiliFlakes>.NewYork) -> @out HotDogs.American) -> HotDogs.American
158158

159159
// CHECK-LABEL: // nested_generics.eatDinnerConcrete (d : inout nested_generics.Lunch<nested_generics.Pizzas<nested_generics.Pepper>.NewYork>.Dinner<nested_generics.HotDogs.American>, t : nested_generics.Deli<nested_generics.Pepper>.Pepperoni, u : nested_generics.Deli<nested_generics.Pepper>.Mustard) -> ()
160160
// CHECK-LABEL: sil hidden @_T015nested_generics17eatDinnerConcreteyAA5LunchV0D0VyAA6PizzasV7NewYorkCyAA6PepperV_G_AA7HotDogsC8AmericanVGz1d_AA4DeliC9PepperoniCyAL_G1tAU7MustardOyAL_G1utF : $@convention(thin) (@inout Lunch<Pizzas<Pepper>.NewYork>.Dinner<HotDogs.American>, @owned Deli<Pepper>.Pepperoni, Deli<Pepper>.Mustard) -> ()
@@ -176,7 +176,7 @@ func eatDinnerConcrete(d: inout Lunch<Pizzas<Pepper>.NewYork>.Dinner<HotDogs.Ame
176176
}
177177

178178
// CHECK-LABEL: // reabstraction thunk helper from @callee_owned (@owned nested_generics.Pizzas<nested_generics.Pepper>.NewYork) -> (@out nested_generics.HotDogs.American) to @callee_owned (@owned nested_generics.Pizzas<nested_generics.Pepper>.NewYork) -> (@unowned nested_generics.HotDogs.American)
179-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T015nested_generics6PizzasV7NewYorkCyAA6PepperV_GAA7HotDogsC8AmericanVIxxr_AhLIxxd_TR : $@convention(thin) (@owned Pizzas<Pepper>.NewYork, @owned @callee_owned (@owned Pizzas<Pepper>.NewYork) -> @out HotDogs.American) -> HotDogs.American
179+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T015nested_generics6PizzasV7NewYorkCyAA6PepperV_GAA7HotDogsC8AmericanVIxxr_AhLIxxd_TR : $@convention(thin) (@owned Pizzas<Pepper>.NewYork, @owned @callee_owned (@owned Pizzas<Pepper>.NewYork) -> @out HotDogs.American) -> HotDogs.American
180180

181181
// CHECK-LABEL: // nested_generics.(calls () -> ()).(closure #1)
182182
// CHECK-LABEL: sil shared @_T015nested_generics5callsyyFAA7HotDogsC8AmericanVAA6PizzasV7NewYorkCyAA6PepperV_GcfU_ : $@convention(thin) (@owned Pizzas<Pepper>.NewYork) -> HotDogs.American
@@ -223,7 +223,7 @@ class SubclassOfInner<T, U> : OuterRing<T>.InnerRing<U> {
223223
}
224224

225225
// CHECK-LABEL: // reabstraction thunk helper from @callee_owned (@owned nested_generics.Pizzas<nested_generics.Pepper>.NewYork) -> (@unowned nested_generics.HotDogs.American) to @callee_owned (@owned nested_generics.Pizzas<nested_generics.Pepper>.NewYork) -> (@out nested_generics.HotDogs.American)
226-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T015nested_generics6PizzasV7NewYorkCyAA6PepperV_GAA7HotDogsC8AmericanVIxxd_AhLIxxr_TR : $@convention(thin) (@owned Pizzas<Pepper>.NewYork, @owned @callee_owned (@owned Pizzas<Pepper>.NewYork) -> HotDogs.American) -> @out HotDogs.American
226+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T015nested_generics6PizzasV7NewYorkCyAA6PepperV_GAA7HotDogsC8AmericanVIxxd_AhLIxxr_TR : $@convention(thin) (@owned Pizzas<Pepper>.NewYork, @owned @callee_owned (@owned Pizzas<Pepper>.NewYork) -> HotDogs.American) -> @out HotDogs.American
227227

228228
// CHECK-LABEL: sil hidden [transparent] [thunk] @_T015nested_generics9OuterRingC05InnerD0Cyx_qd__GAA30ProtocolWithGenericRequirementAAr__lAaGP6method1TQz_1UQzqd__tAK1t_AM1uqd__1vtlFTW : $@convention(witness_method) <τ_0_0><τ_1_0><τ_2_0> (@in τ_0_0, @in τ_1_0, @in τ_2_0, @in_guaranteed OuterRing<τ_0_0>.InnerRing<τ_1_0>) -> (@out τ_0_0, @out τ_1_0, @out τ_2_0) {
229229
// CHECK: bb0([[T:%[0-9]+]] : $*τ_0_0, [[U:%[0-9]+]] : $*τ_1_0, [[V:%[0-9]+]] : $*τ_2_0, [[TOut:%[0-9]+]] : $*τ_0_0, [[UOut:%[0-9]+]] : $*τ_1_0, [[VOut:%[0-9]+]] : $*τ_2_0, [[SELF:%[0-9]+]] : $*OuterRing<τ_0_0>.InnerRing<τ_1_0>):

test/SILGen/objc_blocks_bridging.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class Test: NSObject {
133133
func blockTakesBlock() -> ((Int) -> Int) -> Int {}
134134
}
135135

136-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0S2iIxyd_SiIxxd_S2iIyByd_SiIyByd_TR
136+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0S2iIxyd_SiIxxd_S2iIyByd_SiIyByd_TR
137137
// CHECK: [[BLOCK_COPY:%.*]] = copy_block [[ORIG_BLOCK:%.*]] :
138138
// CHECK: [[CLOSURE:%.*]] = partial_apply {{%.*}}([[BLOCK_COPY]])
139139
// CHECK: [[RESULT:%.*]] = apply {{%.*}}([[CLOSURE]])
@@ -142,14 +142,14 @@ class Test: NSObject {
142142
func clearDraggingItemImageComponentsProvider(_ x: NSDraggingItem) {
143143
x.imageComponentsProvider = {}
144144
}
145-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0SayypGIxo_So7NSArrayCSgIyBa_TR
145+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0SayypGIxo_So7NSArrayCSgIyBa_TR
146146
// CHECK: [[CONVERT:%.*]] = function_ref @_T0Sa10FoundationE19_bridgeToObjectiveCSo7NSArrayCyF
147147
// CHECK: [[CONVERTED:%.*]] = apply [[CONVERT]]
148148
// CHECK: [[OPTIONAL:%.*]] = enum $Optional<NSArray>, #Optional.some!enumelt.1, [[CONVERTED]]
149149
// CHECK: return [[OPTIONAL]]
150150

151151
// CHECK-LABEL: sil hidden @{{.*}}bridgeNonnullBlockResult{{.*}}
152-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0SSIxo_So8NSStringCSgIyBa_TR
152+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0SSIxo_So8NSStringCSgIyBa_TR
153153
// CHECK: [[CONVERT:%.*]] = function_ref @_T0SS10FoundationE19_bridgeToObjectiveCSo8NSStringCyF
154154
// CHECK: [[BRIDGED:%.*]] = apply [[CONVERT]]
155155
// CHECK: [[OPTIONAL_BRIDGED:%.*]] = enum $Optional<NSString>, #Optional.some!enumelt.1, [[BRIDGED]]
@@ -180,6 +180,6 @@ struct GenericStruct<T> {
180180
}
181181
}
182182

183-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0Ix_Ixx_IyB_IyBy_TR : $@convention(c) (@inout_aliasable @block_storage @callee_owned (@owned @callee_owned () -> ()) -> (), @convention(block) () -> ()) -> ()
184-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0IyB_Ix_TR : $@convention(thin) (@owned @convention(block) () -> ()) -> ()
183+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0Ix_Ixx_IyB_IyBy_TR : $@convention(c) (@inout_aliasable @block_storage @callee_owned (@owned @callee_owned () -> ()) -> (), @convention(block) () -> ()) -> ()
184+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0IyB_Ix_TR : $@convention(thin) (@owned @convention(block) () -> ()) -> ()
185185

test/SILGen/objc_bridging_any.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ class SwiftIdLover : NSObject, Anyable {
555555
// CHECK-NEXT: destroy_value [[SELF_COPY]]
556556
// CHECK-NEXT: return [[RESULT]]
557557

558-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0s9AnyObject_pIyBy_ypIxi_TR
558+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0s9AnyObject_pIyBy_ypIxi_TR
559559
// CHECK: bb0([[ANY:%.*]] : $*Any, [[BLOCK:%.*]] : $@convention(block) (AnyObject) -> ()):
560560
// CHECK-NEXT: [[OPENED_ANY:%.*]] = open_existential_addr immutable_access [[ANY]] : $*Any to $*[[OPENED_TYPE:@opened.*Any]],
561561
// CHECK: [[TMP:%.*]] = alloc_stack
@@ -594,7 +594,7 @@ class SwiftIdLover : NSObject, Anyable {
594594
// CHECK-NEXT: destroy_value [[RESULT]]
595595
// CHECK-NEXT: return [[BLOCK]]
596596

597-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0ypIxi_s9AnyObject_pIyBy_TR : $@convention(c) (@inout_aliasable @block_storage @callee_owned (@in Any) -> (), AnyObject) -> ()
597+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0ypIxi_s9AnyObject_pIyBy_TR : $@convention(c) (@inout_aliasable @block_storage @callee_owned (@in Any) -> (), AnyObject) -> ()
598598
// CHECK: bb0([[BLOCK_STORAGE:%.*]] : $*@block_storage @callee_owned (@in Any) -> (), [[ANY:%.*]] : $AnyObject):
599599
// CHECK-NEXT: [[BLOCK_STORAGE_ADDR:%.*]] = project_block_storage [[BLOCK_STORAGE]]
600600
// CHECK-NEXT: [[FUNCTION:%.*]] = load [copy] [[BLOCK_STORAGE_ADDR]]
@@ -630,7 +630,7 @@ class SwiftIdLover : NSObject, Anyable {
630630
// CHECK-NEXT: destroy_value [[ANY_COPY]]
631631
// CHECK-NEXT: return [[RESULT]]
632632

633-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0s9AnyObject_pIyBa_ypIxr_TR : $@convention(thin) (@owned @convention(block) () -> @autoreleased AnyObject) -> @out Any
633+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0s9AnyObject_pIyBa_ypIxr_TR : $@convention(thin) (@owned @convention(block) () -> @autoreleased AnyObject) -> @out Any
634634
// CHECK: bb0([[ANY_ADDR:%.*]] : $*Any, [[BLOCK:%.*]] : $@convention(block) () -> @autoreleased AnyObject):
635635
// CHECK-NEXT: [[BRIDGED:%.*]] = apply [[BLOCK]]()
636636
// CHECK-NEXT: [[OPTIONAL:%.*]] = unchecked_ref_cast [[BRIDGED]]
@@ -672,7 +672,7 @@ class SwiftIdLover : NSObject, Anyable {
672672
// CHECK-NEXT: destroy_value [[FUNCTION]]
673673
// CHECK-NEXT: return [[BLOCK]]
674674

675-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0ypIxr_s9AnyObject_pIyBa_TR : $@convention(c) (@inout_aliasable @block_storage @callee_owned () -> @out Any) -> @autoreleased AnyObject
675+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0ypIxr_s9AnyObject_pIyBa_TR : $@convention(c) (@inout_aliasable @block_storage @callee_owned () -> @out Any) -> @autoreleased AnyObject
676676
// CHECK: bb0(%0 : $*@block_storage @callee_owned () -> @out Any):
677677
// CHECK-NEXT: [[BLOCK_STORAGE_ADDR:%.*]] = project_block_storage %0
678678
// CHECK-NEXT: [[FUNCTION:%.*]] = load [copy] [[BLOCK_STORAGE_ADDR]]
@@ -694,7 +694,7 @@ class SwiftIdLover : NSObject, Anyable {
694694
func methodReturningBlockReturningAny() -> (() -> Any) {}
695695

696696
func methodReturningBlockReturningOptionalAny() -> (() -> Any?) {}
697-
// CHECK-LABEL: sil shared [transparent] [reabstraction_thunk] @_T0ypSgIxr_s9AnyObject_pSgIyBa_TR
697+
// CHECK-LABEL: sil shared [transparent] [serializable] [reabstraction_thunk] @_T0ypSgIxr_s9AnyObject_pSgIyBa_TR
698698
// CHECK: function_ref @_T0s27_bridgeAnythingToObjectiveC{{.*}}F
699699

700700
override init() { super.init() }

0 commit comments

Comments
 (0)