mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Serialization: Support '@_usableFromInline import'
Progress on <rdar://problem/39338239>; we still need to infer this attribute though.
This commit is contained in:
@@ -1073,9 +1073,11 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
|
||||
// FIXME: Having to deal with private imports as a superset of public imports
|
||||
// is inefficient.
|
||||
SmallVector<ModuleDecl::ImportedModule, 8> publicImports;
|
||||
SmallVector<ModuleDecl::ImportedModule, 8> linkImports;
|
||||
SmallVector<ModuleDecl::ImportedModule, 8> allImports;
|
||||
for (auto file : M->getFiles()) {
|
||||
file->getImportedModules(publicImports, ModuleDecl::ImportFilter::Public);
|
||||
file->getImportedModules(linkImports, ModuleDecl::ImportFilter::ForLinking);
|
||||
file->getImportedModules(allImports, ModuleDecl::ImportFilter::All);
|
||||
}
|
||||
|
||||
@@ -1083,6 +1085,10 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
|
||||
publicImportSet;
|
||||
publicImportSet.insert(publicImports.begin(), publicImports.end());
|
||||
|
||||
llvm::SmallSet<ModuleDecl::ImportedModule, 8, ModuleDecl::OrderImportedModules>
|
||||
linkImportSet;
|
||||
linkImportSet.insert(linkImports.begin(), linkImports.end());
|
||||
|
||||
removeDuplicateImports(allImports);
|
||||
auto clangImporter =
|
||||
static_cast<ClangImporter *>(M->getASTContext().getClangModuleLoader());
|
||||
@@ -1111,7 +1117,10 @@ void Serializer::writeInputBlock(const SerializationOptions &options) {
|
||||
|
||||
ImportPathBlob importPath;
|
||||
flattenImportPath(import, importPath);
|
||||
ImportedModule.emit(ScratchRecord, publicImportSet.count(import),
|
||||
ImportedModule.emit(ScratchRecord,
|
||||
publicImportSet.count(import),
|
||||
(linkImportSet.count(import) &&
|
||||
!publicImportSet.count(import)),
|
||||
!import.first.empty(), importPath);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user