mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Support package SIL linkage.
Decls with a package access level are currently set to public SIL linkages. This limits the ability to have more fine-grained control and optimize around resilience and serialization. This PR introduces a separate SIL linkage and FormalLinkage for package decls, pipes them down to IRGen, and updates linkage checks at call sites to include package linkage. Resolves rdar://121409846
This commit is contained in:
@@ -309,8 +309,9 @@ SILFunction *SILFunctionBuilder::getOrCreateFunction(
|
||||
assert(mod.getStage() == SILStage::Raw || fn->getLinkage() == linkage ||
|
||||
(forDefinition == ForDefinition_t::NotForDefinition &&
|
||||
(fnLinkage == linkageForDef ||
|
||||
(linkageForDef == SILLinkage::PublicNonABI &&
|
||||
fnLinkage == SILLinkage::Shared))));
|
||||
(linkageForDef == SILLinkage::PublicNonABI ||
|
||||
linkageForDef == SILLinkage::PackageNonABI) &&
|
||||
fnLinkage == SILLinkage::Shared)));
|
||||
if (forDefinition) {
|
||||
// In all the cases where getConstantLinkage returns something
|
||||
// different for ForDefinition, it returns an available-externally
|
||||
|
||||
Reference in New Issue
Block a user