Revert "[ModuleLoader] Emit a better diagnostic for swiftinterfaces with wrong arch."

This reverts commit 412ee0a922.
This commit is contained in:
Brent Royal-Gordon
2020-04-24 12:41:35 -07:00
parent 9b252821d6
commit e7bd60494a
4 changed files with 16 additions and 20 deletions

View File

@@ -405,12 +405,8 @@ bool SerializedModuleLoader::maybeDiagnoseTargetMismatch(
return false;
StringRef filePath = directoryIterator->path();
StringRef extension = llvm::sys::path::extension(filePath);
auto fileType = file_types::lookupTypeForExtension(extension);
// We also check for interfaces here, because the SerializedModuleLoader
// is invoked after the ModuleInterfaceLoader; if the ModuleInterfaceLoader
// handled interfaces separately, we could get duplicate diagnostics.
if (fileType == file_types::TY_SwiftModuleFile
|| fileType == file_types::TY_SwiftModuleInterfaceFile) {
if (file_types::lookupTypeForExtension(extension) ==
file_types::TY_SwiftModuleFile) {
if (!foundArchs.empty())
foundArchs += ", ";
foundArchs += llvm::sys::path::stem(filePath).str();
@@ -418,7 +414,7 @@ bool SerializedModuleLoader::maybeDiagnoseTargetMismatch(
}
if (foundArchs.empty()) {
// It is strange that there were no swiftmodules or swiftinterfaces here;
// Maybe this swiftmodule directory only contains swiftinterfaces, or
// maybe something else is going on. Regardless, we shouldn't emit a
// possibly incorrect diagnostic.
return false;