From b2d7073fb135ca3f4c453b0c118ad5ce7b23f3d8 Mon Sep 17 00:00:00 2001 From: Kanstantsin Linou Date: Mon, 7 Dec 2015 20:48:10 +0300 Subject: [PATCH 1/3] Fix typo in StackPromotion.cpp allocaiton -> allocation --- lib/SILPasses/Scalar/StackPromotion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/SILPasses/Scalar/StackPromotion.cpp b/lib/SILPasses/Scalar/StackPromotion.cpp index 241ab1fb3eb48..d17ec071b3fda 100644 --- a/lib/SILPasses/Scalar/StackPromotion.cpp +++ b/lib/SILPasses/Scalar/StackPromotion.cpp @@ -180,7 +180,7 @@ StackPromoter::ChangeState StackPromoter::promote() { // Search the whole function for stack promotable allocations. for (SILBasicBlock &BB : *F) { for (auto Iter = BB.begin(); Iter != BB.end();) { - // The allocaiton instruction may be moved, so increment Iter prior to + // The allocation instruction may be moved, so increment Iter prior to // doing the optimization. SILInstruction *I = &*Iter++; if (isPromotableAllocInst(I)) { From 4a3d61c8cbf6c791e420859e2f7699fd8be6a9b9 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 7 Dec 2015 19:54:42 +0100 Subject: [PATCH 2/3] TODO: this is not required anymore. Remove it. Removing ShouldSerializeAll usage --- lib/Serialization/SerializeSIL.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/Serialization/SerializeSIL.cpp b/lib/Serialization/SerializeSIL.cpp index 4642f188c5815..7ab4ecc2c8abf 100644 --- a/lib/Serialization/SerializeSIL.cpp +++ b/lib/Serialization/SerializeSIL.cpp @@ -167,9 +167,6 @@ namespace { << " for layout " << Layout::Code << "\n"); } - // TODO: this is not required anymore. Remove it. - bool ShouldSerializeAll; - /// Helper function to update ListOfValues for MethodInst. Format: /// Attr, SILDeclRef (DeclID, Kind, uncurryLevel, IsObjC), and an operand. void handleMethodInst(const MethodInst *MI, SILValue operand, @@ -206,7 +203,7 @@ namespace { public: SILSerializer(Serializer &S, ASTContext &Ctx, llvm::BitstreamWriter &Out, bool serializeAll) - : S(S), Ctx(Ctx), Out(Out), ShouldSerializeAll(serializeAll) {} + : S(S), Ctx(Ctx), Out(Out) {} void writeSILModule(const SILModule *SILMod); }; @@ -1691,28 +1688,23 @@ void SILSerializer::writeSILBlock(const SILModule *SILMod) { // FIXME: Resilience: could write out vtable for fragile classes. const DeclContext *assocDC = SILMod->getAssociatedContext(); for (const SILVTable &vt : SILMod->getVTables()) { - if (ShouldSerializeAll && - vt.getClass()->isChildContextOf(assocDC)) + if (vt.getClass()->isChildContextOf(assocDC)) writeSILVTable(vt); } // Write out WitnessTables. For now, write out only if EnableSerializeAll. for (const SILWitnessTable &wt : SILMod->getWitnessTables()) { - if (ShouldSerializeAll && - wt.getConformance()->getDeclContext()->isChildContextOf(assocDC)) + if (wt.getConformance()->getDeclContext()->isChildContextOf(assocDC)) writeSILWitnessTable(wt); } // Go through all the SILFunctions in SILMod and write out any // mandatory function bodies. for (const SILFunction &F : *SILMod) { - if (shouldEmitFunctionBody(F) || ShouldSerializeAll) + if (shouldEmitFunctionBody(F)) writeSILFunction(F); } - if (ShouldSerializeAll) - return; - // Now write function declarations for every function we've // emitted a reference to without emitting a function body for. for (const SILFunction &F : *SILMod) { From 6426d31dd7f89329fae84ffd67bcbae5980264c3 Mon Sep 17 00:00:00 2001 From: Gabriel Peart Date: Tue, 8 Dec 2015 09:10:21 +0100 Subject: [PATCH 3/3] zapping the serializeAll parameters --- lib/Serialization/SerializeSIL.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Serialization/SerializeSIL.cpp b/lib/Serialization/SerializeSIL.cpp index 7ab4ecc2c8abf..a1a0687a21f76 100644 --- a/lib/Serialization/SerializeSIL.cpp +++ b/lib/Serialization/SerializeSIL.cpp @@ -202,7 +202,7 @@ namespace { public: SILSerializer(Serializer &S, ASTContext &Ctx, - llvm::BitstreamWriter &Out, bool serializeAll) + llvm::BitstreamWriter &Out) : S(S), Ctx(Ctx), Out(Out) {} void writeSILModule(const SILModule *SILMod); @@ -1692,7 +1692,7 @@ void SILSerializer::writeSILBlock(const SILModule *SILMod) { writeSILVTable(vt); } - // Write out WitnessTables. For now, write out only if EnableSerializeAll. + // Write out WitnessTables. for (const SILWitnessTable &wt : SILMod->getWitnessTables()) { if (wt.getConformance()->getDeclContext()->isChildContextOf(assocDC)) writeSILWitnessTable(wt); @@ -1718,10 +1718,10 @@ void SILSerializer::writeSILModule(const SILModule *SILMod) { writeIndexTables(); } -void Serializer::writeSIL(const SILModule *SILMod, bool serializeAllSIL) { +void Serializer::writeSIL(const SILModule *SILMod) { if (!SILMod) return; - SILSerializer SILSer(*this, M->getASTContext(), Out, serializeAllSIL); + SILSerializer SILSer(*this, M->getASTContext(), Out); SILSer.writeSILModule(SILMod); }