mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL function can be serialized with different kinds: [serialized] or
[serialized_for_package] if Package CMO is enabled. The latter kind allows a function to be serialized even if it contains loadable types, if Package CMO is enabled. Renamed IsSerialized_t as SerializedKind_t. The tri-state serialization kind requires validating inlinability depending on the serialization kinds of callee vs caller; e.g. if the callee is [serialized_for_package], the caller must be _not_ [serialized]. Renamed `hasValidLinkageForFragileInline` as `canBeInlinedIntoCaller` that takes in its caller's SerializedKind as an argument. Another argument `assumeFragileCaller` is also added to ensure that the calle sites of this function know the caller is serialized unless it's called for SIL inlining optimization passes. The [serialized_for_package] attribute is allowed for SIL function, global var, v-table, and witness-table. Resolves rdar://128406520
This commit is contained in:
@@ -230,7 +230,7 @@ static SILFunction *specializeVTableMethod(SILFunction *origMethod,
|
||||
module.linkFunction(SpecializedF, SILModule::LinkingMode::LinkAll);
|
||||
|
||||
SpecializedF->setLinkage(SILLinkage::Public);
|
||||
SpecializedF->setSerialized(IsNotSerialized);
|
||||
SpecializedF->setSerializedKind(IsNotSerialized);
|
||||
|
||||
return SpecializedF;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user