mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user