Serialization: Intro enableExtendedDeserializationRecovery

Introduce a new deserialization mode `enableExtendedDeserializationRecovery`
for use when we can afford inconsistent information from a swiftmodule
file. It's enabled automatically in debugger mode, when user errors are
allowed and during index-while-building.
This commit is contained in:
Alexis Laferrière
2025-03-06 17:02:42 -08:00
parent cc145482de
commit e814b3f66c
4 changed files with 18 additions and 8 deletions

View File

@@ -135,8 +135,15 @@ ModuleFile::ModuleFile(std::shared_ptr<const ModuleFileSharedCore> core)
}
bool ModuleFile::allowCompilerErrors() const {
return getContext().LangOpts.AllowModuleWithCompilerErrors ||
getContext().ForceAllowModuleWithCompilerErrors;
return getContext().LangOpts.AllowModuleWithCompilerErrors;
}
bool ModuleFile::enableExtendedDeserializationRecovery() const {
ASTContext &ctx = getContext();
return ctx.LangOpts.EnableDeserializationRecovery &&
(allowCompilerErrors() ||
ctx.LangOpts.DebuggerSupport ||
ctx.ForceExtendedDeserializationRecovery);
}
Status