mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Intro -Rmodule-recovery to remark about silent errors
Deserialization recovery silently drops errors and the affected decls. This can lead to surprises when a function from an imported module simply disappears without an explanation. This commit introduces the flag -Rmodule-recovery to report as remarks some of these previously silently dropped issues. It can be used to debug project configuration issues.
This commit is contained in:
@@ -7384,6 +7384,14 @@ llvm::Error ModuleFile::consumeExpectedError(llvm::Error &&error) {
|
||||
}
|
||||
|
||||
void ModuleFile::diagnoseAndConsumeError(llvm::Error error) const {
|
||||
auto &ctx = getContext();
|
||||
if (ctx.LangOpts.EnableModuleRecoveryRemarks) {
|
||||
error = diagnoseModularizationError(std::move(error),
|
||||
DiagnosticBehavior::Remark);
|
||||
// If error was already diagnosed it was also consumed.
|
||||
if (!error)
|
||||
return;
|
||||
}
|
||||
|
||||
consumeError(std::move(error));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user