Merge pull request #66139 from xymus/r-module-recovery

This commit is contained in:
Alexis Laferrière
2023-05-26 16:00:43 -07:00
committed by GitHub
9 changed files with 156 additions and 59 deletions

View File

@@ -338,7 +338,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());
@@ -357,7 +357,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());
@@ -599,7 +599,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()),
@@ -648,7 +648,7 @@ void ModuleFile::loadExtensions(NominalTypeDecl *nominal) {
if (!declOrError) {
if (!getContext().LangOpts.EnableDeserializationRecovery)
fatal(declOrError.takeError());
llvm::consumeError(declOrError.takeError());
diagnoseAndConsumeError(declOrError.takeError());
}
}
} else {
@@ -661,7 +661,7 @@ void ModuleFile::loadExtensions(NominalTypeDecl *nominal) {
if (!declOrError) {
if (!getContext().LangOpts.EnableDeserializationRecovery)
fatal(declOrError.takeError());
llvm::consumeError(declOrError.takeError());
diagnoseAndConsumeError(declOrError.takeError());
}
}
}
@@ -718,7 +718,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
@@ -892,7 +892,7 @@ void ModuleFile::lookupClassMembers(ImportPath::Access accessPath,
if (!decl) {
if (!getContext().LangOpts.EnableDeserializationRecovery)
fatal(decl.takeError());
llvm::consumeError(decl.takeError());
diagnoseAndConsumeError(decl.takeError());
continue;
}
@@ -915,7 +915,7 @@ void ModuleFile::lookupClassMembers(ImportPath::Access accessPath,
if (!decl) {
if (!getContext().LangOpts.EnableDeserializationRecovery)
fatal(decl.takeError());
llvm::consumeError(decl.takeError());
diagnoseAndConsumeError(decl.takeError());
continue;
}