[Serialization] Add @autoclosure to parameter decl serialization format

This commit is contained in:
Pavel Yaskevich
2018-10-26 11:20:37 -07:00
parent 4c1885b51b
commit 0857611fa0
3 changed files with 6 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
/// describe what change you made. The content of this comment isn't important; /// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format. /// it just ensures a conflict if two people change the module format.
/// Don't worry about adhering to the 80-column limit for this line. /// Don't worry about adhering to the 80-column limit for this line.
const uint16_t SWIFTMODULE_VERSION_MINOR = 465; // Last change: Remove owning addressors const uint16_t SWIFTMODULE_VERSION_MINOR = 466; // Last change: add isAutoClosure flag to param
using DeclIDField = BCFixed<31>; using DeclIDField = BCFixed<31>;
@@ -1024,6 +1024,7 @@ namespace decls_block {
VarDeclSpecifierField, // specifier VarDeclSpecifierField, // specifier
TypeIDField, // interface type TypeIDField, // interface type
BCFixed<1>, // isVariadic? BCFixed<1>, // isVariadic?
BCFixed<1>, // isAutoClosure?
DefaultArgumentField, // default argument kind DefaultArgumentField, // default argument kind
BCBlob // default argument text BCBlob // default argument text
>; >;

View File

@@ -3029,12 +3029,13 @@ ModuleFile::getDeclCheckedImpl(DeclID DID) {
unsigned rawSpecifier; unsigned rawSpecifier;
TypeID interfaceTypeID; TypeID interfaceTypeID;
bool isVariadic; bool isVariadic;
bool isAutoClosure;
uint8_t rawDefaultArg; uint8_t rawDefaultArg;
decls_block::ParamLayout::readRecord(scratch, argNameID, paramNameID, decls_block::ParamLayout::readRecord(scratch, argNameID, paramNameID,
contextID, rawSpecifier, contextID, rawSpecifier,
interfaceTypeID, isVariadic, interfaceTypeID, isVariadic,
rawDefaultArg); isAutoClosure, rawDefaultArg);
auto DC = getDeclContext(contextID); auto DC = getDeclContext(contextID);
if (declOrOffset.isComplete()) if (declOrOffset.isComplete())
@@ -3065,6 +3066,7 @@ ModuleFile::getDeclCheckedImpl(DeclID DID) {
param->setInterfaceType(paramTy); param->setInterfaceType(paramTy);
param->setVariadic(isVariadic); param->setVariadic(isVariadic);
param->setAutoClosure(isAutoClosure);
// Decode the default argument kind. // Decode the default argument kind.
// FIXME: Default argument expression, if available. // FIXME: Default argument expression, if available.

View File

@@ -3228,6 +3228,7 @@ void Serializer::writeDecl(const Decl *D) {
getRawStableVarDeclSpecifier(param->getSpecifier()), getRawStableVarDeclSpecifier(param->getSpecifier()),
addTypeRef(interfaceType), addTypeRef(interfaceType),
param->isVariadic(), param->isVariadic(),
param->isAutoClosure(),
getRawStableDefaultArgumentKind(param->getDefaultArgumentKind()), getRawStableDefaultArgumentKind(param->getDefaultArgumentKind()),
defaultArgumentText); defaultArgumentText);