[Frontend] Intro global control to force loading from swiftinterface

Intro ASTContext::setIgnoreAdjacentModules to change module loading to
accept load only resilient modules from their swiftinterfaces, ignoring
the adjacent module and any silencing swiftinterfaces errors.
This commit is contained in:
Alexis Laferrière
2022-10-14 17:25:40 -07:00
parent 41ec454129
commit 83cd432785
7 changed files with 38 additions and 10 deletions

View File

@@ -444,7 +444,8 @@ std::error_code ImplicitSerializedModuleLoader::findModuleFilesInDirectory(
(!ModuleBuffer && !ModuleDocBuffer)) &&
"Module and Module Doc buffer must both be initialized or NULL");
if (LoadMode == ModuleLoadingMode::OnlyInterface)
if (LoadMode == ModuleLoadingMode::OnlyInterface ||
Ctx.IgnoreAdjacentModules)
return std::make_error_code(std::errc::not_supported);
auto ModuleErr = openModuleFile(ModuleID, BaseName, ModuleBuffer);