mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Refactor
This commit is contained in:
@@ -497,23 +497,24 @@ ModuleDecl *CompilerInstance::getMainModule() {
|
||||
|
||||
static void addAdditionalInitialImportsTo(
|
||||
SourceFile *SF, const CompilerInstance::ImplicitImports &implicitImports) {
|
||||
using ImportPair = std::pair<ModuleDecl::ImportedModule,
|
||||
std::pair<SourceFile::ImportOptions, StringRef>>;
|
||||
SmallVector<ImportPair, 4> additionalImports;
|
||||
SmallVector<SourceFile::ImportedModuleDesc, 4> additionalImports;
|
||||
|
||||
if (implicitImports.objCModuleUnderlyingMixedFramework)
|
||||
additionalImports.push_back(
|
||||
{{/*accessPath=*/{},
|
||||
implicitImports.objCModuleUnderlyingMixedFramework},
|
||||
{SourceFile::ImportFlags::Exported, StringRef()}});
|
||||
additionalImports.push_back(SourceFile::ImportedModuleDesc(
|
||||
ModuleDecl::ImportedModule(
|
||||
/*accessPath=*/{},
|
||||
implicitImports.objCModuleUnderlyingMixedFramework),
|
||||
SourceFile::ImportFlags::Exported));
|
||||
if (implicitImports.headerModule)
|
||||
additionalImports.push_back(
|
||||
{{/*accessPath=*/{}, implicitImports.headerModule},
|
||||
{SourceFile::ImportFlags::Exported, StringRef()}});
|
||||
additionalImports.push_back(SourceFile::ImportedModuleDesc(
|
||||
ModuleDecl::ImportedModule(/*accessPath=*/{},
|
||||
implicitImports.headerModule),
|
||||
SourceFile::ImportFlags::Exported));
|
||||
if (!implicitImports.modules.empty()) {
|
||||
for (auto &importModule : implicitImports.modules) {
|
||||
additionalImports.push_back(
|
||||
{{/*accessPath=*/{}, importModule}, {{}, StringRef()}});
|
||||
additionalImports.push_back(SourceFile::ImportedModuleDesc(
|
||||
ModuleDecl::ImportedModule(/*accessPath=*/{}, importModule),
|
||||
SourceFile::ImportOptions()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user