mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Serialization: use diagnoseAndConsumeError in ModuleFile.cpp
This commit is contained in:
@@ -830,7 +830,7 @@ ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclBaseName N,
|
||||
} else {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(mem.takeError());
|
||||
consumeError(mem.takeError());
|
||||
diagnoseAndConsumeError(mem.takeError());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -860,7 +860,7 @@ void ModuleFile::lookupClassMember(ImportPath::Access accessPath,
|
||||
if (!declOrError) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(declOrError.takeError());
|
||||
consumeError(declOrError.takeError());
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -878,7 +878,7 @@ void ModuleFile::lookupClassMember(ImportPath::Access accessPath,
|
||||
if (!declOrError) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(declOrError.takeError());
|
||||
consumeError(declOrError.takeError());
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -902,7 +902,7 @@ void ModuleFile::lookupClassMember(ImportPath::Access accessPath,
|
||||
if (!declOrError) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(declOrError.takeError());
|
||||
consumeError(declOrError.takeError());
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -975,7 +975,7 @@ void ModuleFile::lookupObjCMethods(
|
||||
// Deserialize the method and add it to the list.
|
||||
auto declOrError = getDeclChecked(std::get<2>(result));
|
||||
if (!declOrError) {
|
||||
consumeError(declOrError.takeError());
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1002,13 +1002,16 @@ void ModuleFile::getTopLevelDecls(
|
||||
if (declOrError.errorIsA<DeclAttributesDidNotMatch>()) {
|
||||
// Decl rejected by matchAttributes, ignore it.
|
||||
assert(matchAttributes);
|
||||
consumeError(declOrError.takeError());
|
||||
|
||||
// We don't diagnose DeclAttributesDidNotMatch at the moment but
|
||||
// let's use the diagnose consume variant for consistency.
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(declOrError.takeError());
|
||||
consumeError(declOrError.takeError());
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
continue;
|
||||
}
|
||||
if (!ABIRoleInfo(declOrError.get()).providesAPI()) // FIXME: flags
|
||||
@@ -1024,7 +1027,7 @@ void ModuleFile::getExportedPrespecializations(
|
||||
if (!declOrError) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(declOrError.takeError());
|
||||
consumeError(declOrError.takeError());
|
||||
diagnoseAndConsumeError(declOrError.takeError());
|
||||
continue;
|
||||
}
|
||||
results.push_back(declOrError.get());
|
||||
|
||||
Reference in New Issue
Block a user