[serialization] Sprinkle PrettyStackTrace throughout deserialization code.

Since we don't have soft-failure yet from deserialization, it's helpful to
at least know where to start looking when something crashes. There are some
rough edges here but it should be much better than nothing.

This also pulls the list of record nodes out into a separate file, so that
we can avoid repeating it.

Example crash:
1.	While reading from ./CTypes.swiftmodule
2.	While deserializing 'CBool' (StructDecl)
3.	While deserializing decl #26 (XREF)
4.	Cross-reference to 'LogicValue' in swift
(don't worry, this is an example where I'm tweaking things)

<rdar://problem/14838332>

Swift SVN r11057
This commit is contained in:
Jordan Rose
2013-12-10 00:23:40 +00:00
parent 549b2f1368
commit fac5659813
6 changed files with 315 additions and 169 deletions

View File

@@ -180,6 +180,8 @@ private:
/// Convenience function for module loading.
void error(ModuleStatus issue = ModuleStatus::Malformed) {
assert(issue != ModuleStatus::Valid);
assert((!FileContext || issue != ModuleStatus::Malformed) &&
"error deserializing an individual record");
Status = issue;
}