mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
use an enum to make serialized modules more stable against changes to the AST.
This isn't really how we'd like to serialize vardecls in the 2.0 timeframe anyway, but it helps maintain the existing pattern. Swift SVN r13373
This commit is contained in:
@@ -1290,9 +1290,22 @@ void Serializer::writeDecl(const Decl *D) {
|
||||
|
||||
FuncDecl *WillSet = nullptr, *DidSet = nullptr;
|
||||
|
||||
if (var->getStorageKind() == VarDecl::WillSetDidSet) {
|
||||
VarDeclStorageKind StorageKind;
|
||||
switch (var->getStorageKind()) {
|
||||
case VarDecl::Stored:
|
||||
StorageKind = VarDeclStorageKind::Stored;
|
||||
break;
|
||||
case VarDecl::StoredObjC:
|
||||
StorageKind = VarDeclStorageKind::StoredObjC;
|
||||
break;
|
||||
case VarDecl::Computed:
|
||||
StorageKind = VarDeclStorageKind::Computed;
|
||||
break;
|
||||
case VarDecl::WillSetDidSet:
|
||||
StorageKind = VarDeclStorageKind::WillSetDidSet;
|
||||
WillSet = var->getWillSetFunc();
|
||||
DidSet = var->getDidSetFunc();
|
||||
break;
|
||||
}
|
||||
|
||||
unsigned abbrCode = DeclTypeAbbrCodes[VarLayout::Code];
|
||||
@@ -1305,7 +1318,7 @@ void Serializer::writeDecl(const Decl *D) {
|
||||
var->getAttrs().isOptional(),
|
||||
var->isStatic(),
|
||||
var->isLet(),
|
||||
var->getStorageKind(),
|
||||
uint8_t(StorageKind),
|
||||
addTypeRef(type),
|
||||
addTypeRef(var->getInterfaceType()),
|
||||
addDeclRef(var->getGetter()),
|
||||
|
||||
Reference in New Issue
Block a user