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

This commit is contained in:
swift_jenkins
2020-02-19 16:19:27 -08:00
51 changed files with 979 additions and 91 deletions

View File

@@ -999,7 +999,8 @@ std::error_code ModuleInterfaceLoader::findModuleFilesInDirectory(
llvm::SmallString<256>
ModPath{ BaseName.getName(file_types::TY_SwiftModuleFile) },
InPath{ BaseName.getName(file_types::TY_SwiftModuleInterfaceFile) };
InPath{ BaseName.getName(file_types::TY_SwiftModuleInterfaceFile) },
PrivateInPath{BaseName.getName(file_types::TY_PrivateSwiftModuleInterfaceFile)};
// First check to see if the .swiftinterface exists at all. Bail if not.
auto &fs = *Ctx.SourceMgr.getFileSystem();
@@ -1013,6 +1014,11 @@ std::error_code ModuleInterfaceLoader::findModuleFilesInDirectory(
return std::make_error_code(std::errc::no_such_file_or_directory);
}
// If present, use the private interface instead of the public one.
if (fs.exists(PrivateInPath)) {
InPath = PrivateInPath;
}
// Create an instance of the Impl to do the heavy lifting.
auto ModuleName = ModuleID.Item.str();
ModuleInterfaceLoaderImpl Impl(