SIL: Verify kinds of vtable entries.

Validate that inherited entries are not left at "normal" state, and that non-overridden entries do not in fact have
overrides.
This commit is contained in:
Joe Groff
2020-06-03 16:26:33 -07:00
parent b5d66521f2
commit 8538a2afcc
24 changed files with 178 additions and 92 deletions

View File

@@ -814,7 +814,12 @@ bool SILDeclRef::requiresNewVTableEntry() const {
if (derivativeFunctionIdentifier)
if (derivativeFunctionRequiresNewVTableEntry(*this))
return true;
if (cast<AbstractFunctionDecl>(getDecl())->needsNewVTableEntry())
if (!hasDecl())
return false;
auto fnDecl = dyn_cast<AbstractFunctionDecl>(getDecl());
if (!fnDecl)
return false;
if (fnDecl->needsNewVTableEntry())
return true;
return false;
}