mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge remote-tracking branch 'origin/main' into rebranch
This commit is contained in:
@@ -1084,7 +1084,7 @@ std::error_code ModuleInterfaceLoader::findModuleFilesInDirectory(
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer,
|
||||
bool IsFramework) {
|
||||
bool skipBuildingInterface, bool IsFramework) {
|
||||
|
||||
// If running in OnlySerialized mode, ModuleInterfaceLoader
|
||||
// should not have been constructed at all.
|
||||
@@ -1112,6 +1112,16 @@ std::error_code ModuleInterfaceLoader::findModuleFilesInDirectory(
|
||||
InPath = PrivateInPath;
|
||||
}
|
||||
|
||||
// If we've been told to skip building interfaces, we are done here and do
|
||||
// not need to have the module actually built. For example, if we are
|
||||
// currently answering a `canImport` query, it is enough to have found
|
||||
// the interface.
|
||||
if (skipBuildingInterface) {
|
||||
if (ModuleInterfacePath)
|
||||
*ModuleInterfacePath = InPath;
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
// Create an instance of the Impl to do the heavy lifting.
|
||||
auto ModuleName = ModuleID.Item.str();
|
||||
ModuleInterfaceLoaderImpl Impl(
|
||||
@@ -1712,7 +1722,7 @@ bool ExplicitSwiftModuleLoader::findModule(ImportPath::Element ModuleID,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer,
|
||||
bool &IsFramework, bool &IsSystemModule) {
|
||||
bool skipBuildingInterface, bool &IsFramework, bool &IsSystemModule) {
|
||||
StringRef moduleName = ModuleID.Item.str();
|
||||
auto it = Impl.ExplicitModuleMap.find(moduleName);
|
||||
// If no explicit module path is given matches the name, return with an
|
||||
@@ -1784,7 +1794,7 @@ std::error_code ExplicitSwiftModuleLoader::findModuleFilesInDirectory(
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer,
|
||||
std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer,
|
||||
bool IsFramework) {
|
||||
bool skipBuildingInterface, bool IsFramework) {
|
||||
llvm_unreachable("Not supported in the Explicit Swift Module Loader.");
|
||||
return std::make_error_code(std::errc::not_supported);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user