This commit is contained in:
Arnold Schwaighofer
2018-11-08 17:50:25 -08:00
parent e4099d0e88
commit 9feb75806a
5 changed files with 65 additions and 75 deletions

View File

@@ -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()));
}
}