@@ -167,9 +167,6 @@ namespace {
167
167
<< " for layout " << Layout::Code << " \n " );
168
168
}
169
169
170
- // TODO: this is not required anymore. Remove it.
171
- bool ShouldSerializeAll;
172
-
173
170
// / Helper function to update ListOfValues for MethodInst. Format:
174
171
// / Attr, SILDeclRef (DeclID, Kind, uncurryLevel, IsObjC), and an operand.
175
172
void handleMethodInst (const MethodInst *MI, SILValue operand,
@@ -205,8 +202,8 @@ namespace {
205
202
206
203
public:
207
204
SILSerializer (Serializer &S, ASTContext &Ctx,
208
- llvm::BitstreamWriter &Out, bool serializeAll )
209
- : S(S), Ctx(Ctx), Out(Out), ShouldSerializeAll(serializeAll) {}
205
+ llvm::BitstreamWriter &Out)
206
+ : S(S), Ctx(Ctx), Out(Out) {}
210
207
211
208
void writeSILModule (const SILModule *SILMod);
212
209
};
@@ -1697,28 +1694,23 @@ void SILSerializer::writeSILBlock(const SILModule *SILMod) {
1697
1694
// FIXME: Resilience: could write out vtable for fragile classes.
1698
1695
const DeclContext *assocDC = SILMod->getAssociatedContext ();
1699
1696
for (const SILVTable &vt : SILMod->getVTables ()) {
1700
- if (ShouldSerializeAll &&
1701
- vt.getClass ()->isChildContextOf (assocDC))
1697
+ if (vt.getClass ()->isChildContextOf (assocDC))
1702
1698
writeSILVTable (vt);
1703
1699
}
1704
1700
1705
- // Write out WitnessTables. For now, write out only if EnableSerializeAll.
1701
+ // Write out WitnessTables.
1706
1702
for (const SILWitnessTable &wt : SILMod->getWitnessTables ()) {
1707
- if (ShouldSerializeAll &&
1708
- wt.getConformance ()->getDeclContext ()->isChildContextOf (assocDC))
1703
+ if (wt.getConformance ()->getDeclContext ()->isChildContextOf (assocDC))
1709
1704
writeSILWitnessTable (wt);
1710
1705
}
1711
1706
1712
1707
// Go through all the SILFunctions in SILMod and write out any
1713
1708
// mandatory function bodies.
1714
1709
for (const SILFunction &F : *SILMod) {
1715
- if (shouldEmitFunctionBody (F) || ShouldSerializeAll )
1710
+ if (shouldEmitFunctionBody (F))
1716
1711
writeSILFunction (F);
1717
1712
}
1718
1713
1719
- if (ShouldSerializeAll)
1720
- return ;
1721
-
1722
1714
// Now write function declarations for every function we've
1723
1715
// emitted a reference to without emitting a function body for.
1724
1716
for (const SILFunction &F : *SILMod) {
@@ -1732,10 +1724,10 @@ void SILSerializer::writeSILModule(const SILModule *SILMod) {
1732
1724
writeIndexTables ();
1733
1725
}
1734
1726
1735
- void Serializer::writeSIL (const SILModule *SILMod, bool serializeAllSIL ) {
1727
+ void Serializer::writeSIL (const SILModule *SILMod) {
1736
1728
if (!SILMod)
1737
1729
return ;
1738
1730
1739
- SILSerializer SILSer (*this , M->getASTContext (), Out, serializeAllSIL );
1731
+ SILSerializer SILSer (*this , M->getASTContext (), Out);
1740
1732
SILSer.writeSILModule (SILMod);
1741
1733
}
0 commit comments