mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Intro package-only module wide information and serialize it
This commit is contained in:
@@ -1214,7 +1214,8 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
|
||||
M->getImportedModules(allImports,
|
||||
{ModuleDecl::ImportFilterKind::Exported,
|
||||
ModuleDecl::ImportFilterKind::Default,
|
||||
ModuleDecl::ImportFilterKind::ImplementationOnly});
|
||||
ModuleDecl::ImportFilterKind::ImplementationOnly,
|
||||
ModuleDecl::ImportFilterKind::PackageOnly});
|
||||
ImportedModule::removeDuplicates(allImports);
|
||||
|
||||
// Collect the public and private imports as a subset so that we can
|
||||
@@ -1223,6 +1224,8 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
|
||||
getImportsAsSet(M, ModuleDecl::ImportFilterKind::Exported);
|
||||
ImportSet privateImportSet =
|
||||
getImportsAsSet(M, ModuleDecl::ImportFilterKind::Default);
|
||||
ImportSet packageOnlyImportSet =
|
||||
getImportsAsSet(M, ModuleDecl::ImportFilterKind::PackageOnly);
|
||||
|
||||
auto clangImporter =
|
||||
static_cast<ClangImporter *>(M->getASTContext().getClangModuleLoader());
|
||||
@@ -1270,6 +1273,8 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
|
||||
stableImportControl = ImportControl::Exported;
|
||||
else if (privateImportSet.count(import))
|
||||
stableImportControl = ImportControl::Normal;
|
||||
else if (packageOnlyImportSet.count(import))
|
||||
stableImportControl = ImportControl::PackageOnly;
|
||||
else
|
||||
stableImportControl = ImportControl::ImplementationOnly;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user