Skip to content

Commit 623582d

Browse files
committed
fixup serialization
1 parent 62262a2 commit 623582d

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

include/swift/AST/Attr.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,10 +2235,11 @@ class ObjCImplementationAttr final : public DeclAttribute {
22352235
Identifier CategoryName;
22362236

22372237
ObjCImplementationAttr(Identifier CategoryName, SourceLoc AtLoc,
2238-
SourceRange Range, bool Implicit = false)
2238+
SourceRange Range, bool Implicit = false,
2239+
bool isCategoryNameInvalid = false)
22392240
: DeclAttribute(DAK_ObjCImplementation, AtLoc, Range, Implicit),
22402241
CategoryName(CategoryName) {
2241-
Bits.ObjCImplementationAttr.isCategoryNameInvalid = false;
2242+
Bits.ObjCImplementationAttr.isCategoryNameInvalid = isCategoryNameInvalid;
22422243
}
22432244

22442245
bool isCategoryNameInvalid() const {

lib/Serialization/Deserialization.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5052,6 +5052,20 @@ llvm::Error DeclDeserializer::deserializeDeclCommon() {
50525052
break;
50535053
}
50545054

5055+
case decls_block::ObjCImplementation_DECL_ATTR: {
5056+
bool isImplicit;
5057+
bool isCategoryNameInvalid;
5058+
uint64_t categoryNameID;
5059+
serialization::decls_block::ObjCImplementationDeclAttrLayout::
5060+
readRecord(scratch, isImplicit, isCategoryNameInvalid,
5061+
categoryNameID);
5062+
Identifier categoryName = MF.getIdentifier(categoryNameID);
5063+
Attr = new (ctx) ObjCImplementationAttr(categoryName, SourceLoc(),
5064+
SourceRange(), isImplicit,
5065+
isCategoryNameInvalid);
5066+
break;
5067+
}
5068+
50555069
#define SIMPLE_DECL_ATTR(NAME, CLASS, ...) \
50565070
case decls_block::CLASS##_DECL_ATTR: { \
50575071
bool isImplicit; \

lib/Serialization/Serialization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2683,7 +2683,7 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
26832683
auto abbrCode =
26842684
S.DeclTypeAbbrCodes[ObjCImplementationDeclAttrLayout::Code];
26852685
ObjCImplementationDeclAttrLayout::emitRecord(S.Out, S.ScratchRecord,
2686-
abbrCode, theAttr->isInvalid(), theAttr->isCategoryNameInvalid(),
2686+
abbrCode, theAttr->isImplicit(), theAttr->isCategoryNameInvalid(),
26872687
categoryNameID);
26882688
return;
26892689
}

0 commit comments

Comments
 (0)