Skip to content

Commit 6f25f76

Browse files
committed
Merge pull request #420 from gabrielPeart/master
Fix TODO by removing unneeded ShouldSerializeAll parameters.
2 parents e871424 + 971f399 commit 6f25f76

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

lib/Serialization/SerializeSIL.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,6 @@ namespace {
167167
<< " for layout " << Layout::Code << "\n");
168168
}
169169

170-
// TODO: this is not required anymore. Remove it.
171-
bool ShouldSerializeAll;
172-
173170
/// Helper function to update ListOfValues for MethodInst. Format:
174171
/// Attr, SILDeclRef (DeclID, Kind, uncurryLevel, IsObjC), and an operand.
175172
void handleMethodInst(const MethodInst *MI, SILValue operand,
@@ -205,8 +202,8 @@ namespace {
205202

206203
public:
207204
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) {}
210207

211208
void writeSILModule(const SILModule *SILMod);
212209
};
@@ -1697,28 +1694,23 @@ void SILSerializer::writeSILBlock(const SILModule *SILMod) {
16971694
// FIXME: Resilience: could write out vtable for fragile classes.
16981695
const DeclContext *assocDC = SILMod->getAssociatedContext();
16991696
for (const SILVTable &vt : SILMod->getVTables()) {
1700-
if (ShouldSerializeAll &&
1701-
vt.getClass()->isChildContextOf(assocDC))
1697+
if (vt.getClass()->isChildContextOf(assocDC))
17021698
writeSILVTable(vt);
17031699
}
17041700

1705-
// Write out WitnessTables. For now, write out only if EnableSerializeAll.
1701+
// Write out WitnessTables.
17061702
for (const SILWitnessTable &wt : SILMod->getWitnessTables()) {
1707-
if (ShouldSerializeAll &&
1708-
wt.getConformance()->getDeclContext()->isChildContextOf(assocDC))
1703+
if (wt.getConformance()->getDeclContext()->isChildContextOf(assocDC))
17091704
writeSILWitnessTable(wt);
17101705
}
17111706

17121707
// Go through all the SILFunctions in SILMod and write out any
17131708
// mandatory function bodies.
17141709
for (const SILFunction &F : *SILMod) {
1715-
if (shouldEmitFunctionBody(F) || ShouldSerializeAll)
1710+
if (shouldEmitFunctionBody(F))
17161711
writeSILFunction(F);
17171712
}
17181713

1719-
if (ShouldSerializeAll)
1720-
return;
1721-
17221714
// Now write function declarations for every function we've
17231715
// emitted a reference to without emitting a function body for.
17241716
for (const SILFunction &F : *SILMod) {
@@ -1732,10 +1724,10 @@ void SILSerializer::writeSILModule(const SILModule *SILMod) {
17321724
writeIndexTables();
17331725
}
17341726

1735-
void Serializer::writeSIL(const SILModule *SILMod, bool serializeAllSIL) {
1727+
void Serializer::writeSIL(const SILModule *SILMod) {
17361728
if (!SILMod)
17371729
return;
17381730

1739-
SILSerializer SILSer(*this, M->getASTContext(), Out, serializeAllSIL);
1731+
SILSerializer SILSer(*this, M->getASTContext(), Out);
17401732
SILSer.writeSILModule(SILMod);
17411733
}

0 commit comments

Comments
 (0)