mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Frontend] Use the private module interface when available
This commit is contained in:
@@ -1000,7 +1000,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();
|
||||
@@ -1014,6 +1015,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(
|
||||
|
||||
Reference in New Issue
Block a user