Add -testable-import-module frontend flag

This is just like -import-module, but it does an @testable import. Simple, right?

Fixes rdar://66544654.
This commit is contained in:
Brent Royal-Gordon
2020-09-13 17:05:44 -07:00
parent bf074b093e
commit f71923778b
7 changed files with 27 additions and 13 deletions

View File

@@ -347,9 +347,9 @@ ImportDepth::ImportDepth(ASTContext &context,
// Imports from -import-name such as Playground auxiliary sources are treated
// specially by applying import depth 0.
llvm::StringSet<> auxImports;
for (StringRef moduleName :
for (const auto &pair :
invocation.getFrontendOptions().getImplicitImportModuleNames())
auxImports.insert(moduleName);
auxImports.insert(pair.first);
// Private imports from this module.
// FIXME: only the private imports from the current source file.