mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILSerializer: handle body of closure.
Body of closure needs to be serialized if its caller is serialized. To fix this, we serialize private functions that are referenced by a serialized function. rdar://15884245 Swift SVN r13162
This commit is contained in:
@@ -1333,8 +1333,12 @@ void SILSerializer::writeAllSILFunctions(const SILModule *SILMod) {
|
||||
|
||||
// Helper function for whether to emit a function body.
|
||||
auto shouldEmitFunctionBody = [&](const SILFunction &F) {
|
||||
// Emit function body if a private function is referenced in this module.
|
||||
// This is needed for body of closure.
|
||||
return (!F.empty() &&
|
||||
(EnableSerializeAll || F.isTransparent()));
|
||||
(EnableSerializeAll || F.isTransparent() ||
|
||||
(F.getLinkage() == SILLinkage::Private &&
|
||||
FuncsToDeclare.count(&F))));
|
||||
};
|
||||
|
||||
// Go through all the SILFunctions in SILMod and write out any
|
||||
|
||||
Reference in New Issue
Block a user