mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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.
|
||||
>;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user