mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization|NFC] Intro diagnoseAndConsumeError
Intro the service `diagnoseAndConsumeError` as the ultimate site to drop deserialization issues we can recover from. It will be used to raise diagnostics on the issues before dropping them silently.
This commit is contained in:
@@ -328,7 +328,7 @@ void ModuleFile::lookupValue(DeclName name,
|
||||
if (!declOrError) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(declOrError.takeError());
|
||||
llvm::consumeError(declOrError.takeError());
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
continue;
|
||||
}
|
||||
auto VD = cast<ValueDecl>(declOrError.get());
|
||||
@@ -347,7 +347,7 @@ void ModuleFile::lookupValue(DeclName name,
|
||||
if (!declOrError) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(declOrError.takeError());
|
||||
llvm::consumeError(declOrError.takeError());
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
continue;
|
||||
}
|
||||
auto VD = cast<ValueDecl>(declOrError.get());
|
||||
@@ -589,7 +589,7 @@ void ModuleFile::lookupVisibleDecls(ImportPath::Access accessPath,
|
||||
if (!declOrError) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(declOrError.takeError());
|
||||
llvm::consumeError(declOrError.takeError());
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
return;
|
||||
}
|
||||
consumer.foundDecl(cast<ValueDecl>(declOrError.get()),
|
||||
@@ -638,7 +638,7 @@ void ModuleFile::loadExtensions(NominalTypeDecl *nominal) {
|
||||
if (!declOrError) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(declOrError.takeError());
|
||||
llvm::consumeError(declOrError.takeError());
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -651,7 +651,7 @@ void ModuleFile::loadExtensions(NominalTypeDecl *nominal) {
|
||||
if (!declOrError) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(declOrError.takeError());
|
||||
llvm::consumeError(declOrError.takeError());
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -708,7 +708,7 @@ void ModuleFile::loadDerivativeFunctionConfigurations(
|
||||
if (!derivativeGenSigOrError) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(derivativeGenSigOrError.takeError());
|
||||
llvm::consumeError(derivativeGenSigOrError.takeError());
|
||||
diagnoseAndConsumeError(derivativeGenSigOrError.takeError());
|
||||
}
|
||||
auto derivativeGenSig = derivativeGenSigOrError.get();
|
||||
// NOTE(TF-1038): Result indices are currently unsupported in derivative
|
||||
@@ -882,7 +882,7 @@ void ModuleFile::lookupClassMembers(ImportPath::Access accessPath,
|
||||
if (!decl) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(decl.takeError());
|
||||
llvm::consumeError(decl.takeError());
|
||||
diagnoseAndConsumeError(decl.takeError());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -905,7 +905,7 @@ void ModuleFile::lookupClassMembers(ImportPath::Access accessPath,
|
||||
if (!decl) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(decl.takeError());
|
||||
llvm::consumeError(decl.takeError());
|
||||
diagnoseAndConsumeError(decl.takeError());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user