mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Serialization] Only serialize inlinable body text in partial modules
Since this text is only needed for printing a parseable interface during a non-whole-module build, only put the text inside partial modules. When we're merging the modules at the end, skip serializing the text. rdar://44394186
This commit is contained in:
@@ -1345,9 +1345,15 @@ void Serializer::writeGenericRequirements(ArrayRef<Requirement> requirements,
|
||||
void Serializer::writeInlinableBodyTextIfNeeded(
|
||||
const AbstractFunctionDecl *AFD) {
|
||||
using namespace decls_block;
|
||||
// Only serialize the text for an inlinable function body if we're emitting
|
||||
// a partial module. It's not needed in the final module file, but it's
|
||||
// needed in partial modules so you can emit a parseable interface after
|
||||
// merging them.
|
||||
if (!SF) return;
|
||||
|
||||
if (AFD->getResilienceExpansion() != swift::ResilienceExpansion::Minimal)
|
||||
return;
|
||||
|
||||
if (!AFD->hasInlinableBodyText()) return;
|
||||
SmallString<128> scratch;
|
||||
auto body = AFD->getInlinableBodyText(scratch);
|
||||
|
||||
Reference in New Issue
Block a user