Revert "[ScanDependency] Allow importing binary testable module when no interface"

This reverts commit 90a1586c3c.
This commit is contained in:
Steven Wu
2024-04-17 12:43:06 -07:00
parent bc4eeb861c
commit 53ad5de6db
4 changed files with 9 additions and 17 deletions

View File

@@ -431,8 +431,7 @@ SerializedModuleLoaderBase::getImportsOfModule(
llvm::ErrorOr<ModuleDependencyInfo>
SerializedModuleLoaderBase::scanModuleFile(Twine modulePath, bool isFramework,
bool isTestableImport,
bool hasInterface) {
bool isTestableImport) {
const std::string moduleDocPath;
const std::string sourceInfoPath;
@@ -456,10 +455,7 @@ SerializedModuleLoaderBase::scanModuleFile(Twine modulePath, bool isFramework,
return std::make_error_code(std::errc::no_such_file_or_directory);
}
// 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 (loadedModuleFile->isTestable() && !isTestableImport) {
if (Ctx.LangOpts.EnableModuleLoadingRemarks)
Ctx.Diags.diagnose(SourceLoc(), diag::skip_module_testable,
modulePath.str());