IRGen: Don't reify internal vtable entries that are marked overridden.

Private and internal classes shouldn't have ABI constraints on their concrete vtable layout, so if methods
don't have overrides in practice, we can elide their vtable entries.
This commit is contained in:
Joe Groff
2020-06-11 15:12:18 -07:00
parent db9cf4cd80
commit 04c8f0df42
17 changed files with 221 additions and 55 deletions

View File

@@ -476,7 +476,8 @@ void SILModule::eraseGlobalVariable(SILGlobalVariable *G) {
getSILGlobalList().erase(G);
}
SILVTable *SILModule::lookUpVTable(const ClassDecl *C) {
SILVTable *SILModule::lookUpVTable(const ClassDecl *C,
bool deserializeLazily) {
if (!C)
return nullptr;
@@ -485,6 +486,9 @@ SILVTable *SILModule::lookUpVTable(const ClassDecl *C) {
if (R != VTableMap.end())
return R->second;
if (!deserializeLazily)
return nullptr;
// If that fails, try to deserialize it. If that fails, return nullptr.
SILVTable *Vtbl = getSILLoader()->lookupVTable(C);
if (!Vtbl)