mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[NFC] Improve deserialization errors for wrong record kind
There are a bunch of places where we expect to find a record with a particular record ID/kind in the decls_block and have to bail out if we see something we don’t expect. Add an `InvalidRecordKindError` we can use in this situation to produce a useful error message and adopt it in various places. This change also makes deserialization errors print the path to the invalid file.
This commit is contained in:
committed by
GitHub
parent
6075af2652
commit
d20e00e531
@@ -585,6 +585,8 @@ void ModuleFileSharedCore::outputDiagnosticInfo(llvm::raw_ostream &os) const {
|
||||
<< "'";
|
||||
if (Bits.IsAllowModuleWithCompilerErrorsEnabled)
|
||||
os << " (built with -experimental-allow-module-with-compiler-errors)";
|
||||
if (ModuleInputBuffer)
|
||||
os << " at '" << ModuleInputBuffer->getBufferIdentifier() << "'";
|
||||
}
|
||||
|
||||
ModuleFileSharedCore::~ModuleFileSharedCore() { }
|
||||
|
||||
Reference in New Issue
Block a user