SIL: Better error when linker finds SILGen did not emit a conformance

I hit this assert a few times while working on making conformance
emission lazier, so let's at least print out the missing conformance
in question.
This commit is contained in:
Slava Pestov
2019-04-25 14:04:27 -04:00
parent 39335f4905
commit 9ffe12dad2

View File

@@ -217,8 +217,14 @@ void SILLinkerVisitor::visitProtocolConformance(
// If the looked up witness table is a declaration, there is nothing we can
// do here.
if (WT == nullptr || WT->isDeclaration()) {
assert(!mustDeserialize &&
"unable to deserialize witness table when we must?!");
#ifndef NDEBUG
if (mustDeserialize) {
llvm::errs() << "SILGen failed to emit required conformance:\n";
ref.dump(llvm::errs());
llvm::errs() << "\n";
abort();
}
#endif
return;
}