[Serialization] Update error message on deserialization failure

This adds information about whether the module was built from source or
from a swiftinterface, whether it's resilient or not, and tweaks the
format.
This commit is contained in:
Alexis Laferrière
2022-10-26 15:46:02 -07:00
parent 2854c1b3cb
commit 41ec454129
3 changed files with 27 additions and 10 deletions

View File

@@ -584,12 +584,17 @@ void ModuleFileSharedCore::fatal(llvm::Error error) const {
}
void ModuleFileSharedCore::outputDiagnosticInfo(llvm::raw_ostream &os) const {
os << "module '" << Name << "' with full misc version '" << MiscVersion
<< "'";
bool resilient = ResilienceStrategy(Bits.ResilienceStrategy) ==
ResilienceStrategy::Resilient;
os << "module '" << Name
<< "', builder version '" << MiscVersion
<< "', built from "
<< (Bits.IsBuiltFromInterface? "swiftinterface": "source")
<< ", " << (resilient? "resilient": "non-resilient");
if (Bits.IsAllowModuleWithCompilerErrorsEnabled)
os << " (built with -experimental-allow-module-with-compiler-errors)";
os << ", built with -experimental-allow-module-with-compiler-errors";
if (ModuleInputBuffer)
os << " at '" << ModuleInputBuffer->getBufferIdentifier() << "'";
os << ", loaded from '" << ModuleInputBuffer->getBufferIdentifier() << "'";
}
ModuleFileSharedCore::~ModuleFileSharedCore() { }