Skip to content

Commit 154e6c0

Browse files
committed
Output all vtables with all their entries if ShouldSerializeAll is true
1 parent 06efb77 commit 154e6c0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/Serialization/SerializeSIL.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,8 +2072,10 @@ void SILSerializer::writeSILGlobalVar(const SILGlobalVariable &g) {
20722072
}
20732073

20742074
void SILSerializer::writeSILVTable(const SILVTable &vt) {
2075-
// Do not emit vtables for non-public classes.
2076-
if (vt.getClass()->getEffectiveAccess() < swift::AccessLevel::Public)
2075+
// Do not emit vtables for non-public classes unless everything has to be
2076+
// serialized.
2077+
if (!ShouldSerializeAll &&
2078+
vt.getClass()->getEffectiveAccess() < swift::AccessLevel::Public)
20772079
return;
20782080
VTableList[vt.getClass()->getName()] = NextVTableID++;
20792081
VTableOffset.push_back(Out.GetCurrentBitNo());
@@ -2082,8 +2084,9 @@ void SILSerializer::writeSILVTable(const SILVTable &vt) {
20822084

20832085
for (auto &entry : vt.getEntries()) {
20842086
SmallVector<ValueID, 4> ListOfValues;
2085-
// Do not emit entries which are not public or serialized.
2086-
if (entry.Implementation &&
2087+
// Do not emit entries which are not public or serialized, unless everything
2088+
// has to be serialized.
2089+
if (!ShouldSerializeAll && entry.Implementation &&
20872090
!entry.Implementation->isPossiblyUsedExternally() &&
20882091
!entry.Implementation->isSerialized())
20892092
continue;

0 commit comments

Comments
 (0)