mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user