Merge remote-tracking branch 'origin/master' into master-next

This commit is contained in:
swift_jenkins
2020-04-24 21:20:17 -07:00
5 changed files with 23 additions and 21 deletions

View File

@@ -406,12 +406,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();
@@ -419,7 +415,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;