mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Currently decls defined with package access level have a different
access level for optimization: `public`. It requires an extra check for the actual access level that was declared when determining serialization since the behavior should be different. This PR sets its effective access level to `package` as originally defined, updates call sites to make appropriate acces level comparisons, and removes `package` specific checks.
This commit is contained in:
@@ -328,7 +328,7 @@ bool CrossModuleOptimization::canSerializeInstruction(SILInstruction *inst,
|
||||
// properties, because that would require to make the field decl public -
|
||||
// which keeps more metadata alive.
|
||||
return !conservative ||
|
||||
REAI->getField()->getEffectiveAccess() >= AccessLevel::Public;
|
||||
REAI->getField()->getEffectiveAccess() >= AccessLevel::Package;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -365,7 +365,7 @@ bool CrossModuleOptimization::canSerializeType(SILType type) {
|
||||
CanType subType = rawSubType->getCanonicalType();
|
||||
if (NominalTypeDecl *subNT = subType->getNominalOrBoundGenericNominal()) {
|
||||
|
||||
if (conservative && subNT->getEffectiveAccess() < AccessLevel::Public) {
|
||||
if (conservative && subNT->getEffectiveAccess() < AccessLevel::Package) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -596,7 +596,7 @@ void CrossModuleOptimization::makeFunctionUsableFromInline(SILFunction *function
|
||||
|
||||
/// Make a nominal type, including it's context, usable from inline.
|
||||
void CrossModuleOptimization::makeDeclUsableFromInline(ValueDecl *decl) {
|
||||
if (decl->getEffectiveAccess() >= AccessLevel::Public)
|
||||
if (decl->getEffectiveAccess() >= AccessLevel::Package)
|
||||
return;
|
||||
|
||||
// We must not modify decls which are defined in other modules.
|
||||
|
||||
Reference in New Issue
Block a user