[Serialization] Preserve a deinitializer's interface type.

We haven't actually needed this for anything, but we should probably follow
the invariants of the AST.

Swift SVN r22199
This commit is contained in:
Jordan Rose
2014-09-23 02:06:25 +00:00
parent 7fe346a091
commit 988b8c2033
3 changed files with 8 additions and 5 deletions

View File

@@ -40,7 +40,7 @@ const uint16_t VERSION_MAJOR = 0;
/// Serialized module format minor version number.
///
/// When the format changes IN ANY WAY, this number should be incremented.
const uint16_t VERSION_MINOR = 141;
const uint16_t VERSION_MINOR = 142;
using DeclID = Fixnum<31>;
using DeclIDField = BCFixed<31>;
@@ -844,7 +844,8 @@ namespace decls_block {
DeclIDField, // context decl
BCFixed<1>, // implicit?
BCFixed<1>, // objc?
TypeIDField // type (signature)
TypeIDField, // type (signature)
TypeIDField // interface type
// Trailed by a pattern for self.
>;

View File

@@ -2644,10 +2644,10 @@ Decl *ModuleFile::getDecl(DeclID DID, Optional<DeclContext *> ForcedContext) {
case decls_block::DESTRUCTOR_DECL: {
DeclID parentID;
bool isImplicit, isObjC;
TypeID signatureID;
TypeID signatureID, interfaceID;
decls_block::DestructorLayout::readRecord(scratch, parentID, isImplicit,
isObjC, signatureID);
isObjC, signatureID, interfaceID);
DeclContext *DC = getDeclContext(parentID);
if (declOrOffset.isComplete())
@@ -2663,6 +2663,7 @@ Decl *ModuleFile::getDecl(DeclID DID, Optional<DeclContext *> ForcedContext) {
dtor->setSelfPattern(selfParams);
dtor->setType(getType(signatureID));
dtor->setInterfaceType(getType(interfaceID));
if (isImplicit)
dtor->setImplicit();

View File

@@ -1981,7 +1981,8 @@ void Serializer::writeDecl(const Decl *D) {
addDeclRef(DC),
dtor->isImplicit(),
dtor->isObjC(),
addTypeRef(dtor->getType()));
addTypeRef(dtor->getType()),
addTypeRef(dtor->getInterfaceType()));
assert(dtor->getBodyParamPatterns().size() == 1);
for (auto pattern : dtor->getBodyParamPatterns())
writePattern(pattern);