mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ScanDependency] Allow importing binary testable module when no interface
Follow-up adjustment for binary module selection in dependency scanning time. If a testable binary module doesn't have an interface file, it should be used even it might pull in more dependencies.
This commit is contained in:
@@ -431,7 +431,8 @@ SerializedModuleLoaderBase::getImportsOfModule(
|
||||
|
||||
llvm::ErrorOr<ModuleDependencyInfo>
|
||||
SerializedModuleLoaderBase::scanModuleFile(Twine modulePath, bool isFramework,
|
||||
bool isTestableImport) {
|
||||
bool isTestableImport,
|
||||
bool hasInterface) {
|
||||
const std::string moduleDocPath;
|
||||
const std::string sourceInfoPath;
|
||||
|
||||
@@ -455,7 +456,10 @@ SerializedModuleLoaderBase::scanModuleFile(Twine modulePath, bool isFramework,
|
||||
return std::make_error_code(std::errc::no_such_file_or_directory);
|
||||
}
|
||||
|
||||
if (loadedModuleFile->isTestable() && !isTestableImport) {
|
||||
// If the module file has interface file and not testable imported, don't
|
||||
// import the testable module because it contains more interfaces than
|
||||
// needed and can pull in more dependencies.
|
||||
if (loadedModuleFile->isTestable() && !isTestableImport && hasInterface) {
|
||||
if (Ctx.LangOpts.EnableModuleLoadingRemarks)
|
||||
Ctx.Diags.diagnose(SourceLoc(), diag::skip_module_testable,
|
||||
modulePath.str());
|
||||
|
||||
Reference in New Issue
Block a user