[embedded] Serialize+deserialize vtables, fix using non-generic classes from other modules in embedded Swift

This commit is contained in:
Kuba Mracek
2023-10-05 10:45:49 -07:00
parent 2278098c21
commit 7da86b1148
8 changed files with 149 additions and 38 deletions

View File

@@ -518,6 +518,17 @@ SILVTable *SILModule::lookUpVTable(const ClassDecl *C,
if (!Vtbl)
return nullptr;
if (C->walkSuperclasses([&](ClassDecl *S) {
SILVTable *Vtbl = getSILLoader()->lookupVTable(S);
if (!Vtbl) {
return TypeWalker::Action::Stop;
}
VTableMap[C] = Vtbl;
return TypeWalker::Action::Continue;
})) {
return nullptr;
}
// If we succeeded, map C -> VTbl in the table and return VTbl.
VTableMap[C] = Vtbl;
return Vtbl;