mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge branch 'main' into tbkka-assertions2
This commit is contained in:
@@ -2386,7 +2386,7 @@ std::error_code ExplicitSwiftModuleLoader::findModuleFilesInDirectory(
|
||||
}
|
||||
|
||||
bool ExplicitSwiftModuleLoader::canImportModule(
|
||||
ImportPath::Module path, ModuleVersionInfo *versionInfo,
|
||||
ImportPath::Module path, SourceLoc loc, ModuleVersionInfo *versionInfo,
|
||||
bool isTestableDependencyLookup) {
|
||||
// FIXME: Swift submodules?
|
||||
if (path.hasSubmodule())
|
||||
@@ -2412,7 +2412,7 @@ bool ExplicitSwiftModuleLoader::canImportModule(
|
||||
auto &fs = *Ctx.SourceMgr.getFileSystem();
|
||||
auto moduleBuf = fs.getBufferForFile(it->second.modulePath);
|
||||
if (!moduleBuf) {
|
||||
Ctx.Diags.diagnose(SourceLoc(), diag::error_opening_explicit_module_file,
|
||||
Ctx.Diags.diagnose(loc, diag::error_opening_explicit_module_file,
|
||||
it->second.modulePath);
|
||||
return false;
|
||||
}
|
||||
@@ -2423,8 +2423,7 @@ bool ExplicitSwiftModuleLoader::canImportModule(
|
||||
if (auto forwardingModule = ForwardingModule::load(**moduleBuf)) {
|
||||
moduleBuf = fs.getBufferForFile(forwardingModule->underlyingModulePath);
|
||||
if (!moduleBuf) {
|
||||
Ctx.Diags.diagnose(SourceLoc(),
|
||||
diag::error_opening_explicit_module_file,
|
||||
Ctx.Diags.diagnose(loc, diag::error_opening_explicit_module_file,
|
||||
forwardingModule->underlyingModulePath);
|
||||
return false;
|
||||
}
|
||||
@@ -2737,7 +2736,7 @@ std::error_code ExplicitCASModuleLoader::findModuleFilesInDirectory(
|
||||
}
|
||||
|
||||
bool ExplicitCASModuleLoader::canImportModule(
|
||||
ImportPath::Module path, ModuleVersionInfo *versionInfo,
|
||||
ImportPath::Module path, SourceLoc loc, ModuleVersionInfo *versionInfo,
|
||||
bool isTestableDependencyLookup) {
|
||||
// FIXME: Swift submodules?
|
||||
if (path.hasSubmodule())
|
||||
@@ -2766,12 +2765,11 @@ bool ExplicitCASModuleLoader::canImportModule(
|
||||
: it->second.modulePath;
|
||||
auto moduleBuf = Impl.loadFileBuffer(moduleCASID, it->second.modulePath);
|
||||
if (!moduleBuf) {
|
||||
Ctx.Diags.diagnose(SourceLoc(), diag::error_cas,
|
||||
toString(moduleBuf.takeError()));
|
||||
Ctx.Diags.diagnose(loc, diag::error_cas, toString(moduleBuf.takeError()));
|
||||
return false;
|
||||
}
|
||||
if (!*moduleBuf) {
|
||||
Ctx.Diags.diagnose(SourceLoc(), diag::error_opening_explicit_module_file,
|
||||
Ctx.Diags.diagnose(loc, diag::error_opening_explicit_module_file,
|
||||
it->second.modulePath);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user