[Serialization] If we fail to deserialize a type, dump it.

...rather than just printing it, which isn't giving us enough info.

In pursuit of rdar://problem/30382791.
This commit is contained in:
Jordan Rose
2017-02-24 16:36:52 -08:00
parent b10bc8ff0e
commit 99d2b171d3

View File

@@ -4240,7 +4240,11 @@ Type ModuleFile::getType(TypeID TID) {
#ifndef NDEBUG
PrettyStackTraceType trace(ctx, "deserializing", typeOrOffset.get());
assert(!typeOrOffset.get()->hasError());
if (typeOrOffset.get()->hasError()) {
typeOrOffset.get()->dump();
llvm_unreachable("deserialization produced an invalid type "
"(rdar://problem/30382791)");
}
#endif
// Invoke the callback on the deserialized type.