Skip to content

Commit 3088105

Browse files
committed
Serialization: Read and write the underscored bit for @cdecl
1 parent fc77dc5 commit 3088105

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5993,9 +5993,9 @@ llvm::Error DeclDeserializer::deserializeDeclCommon() {
59935993

59945994
case decls_block::CDecl_DECL_ATTR: {
59955995
bool isImplicit;
5996-
bool isUnderscored = false;
5996+
bool isUnderscored;
59975997
serialization::decls_block::CDeclDeclAttrLayout::readRecord(
5998-
scratch, isImplicit); // TODO isUnderscored
5998+
scratch, isImplicit, isUnderscored);
59995999
Attr = new (ctx) CDeclAttr(blobData, isImplicit, isUnderscored);
60006000
break;
60016001
}

lib/Serialization/ModuleFormat.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
5858
/// describe what change you made. The content of this comment isn't important;
5959
/// it just ensures a conflict if two people change the module format.
6060
/// Don't worry about adhering to the 80-column limit for this line.
61-
const uint16_t SWIFTMODULE_VERSION_MINOR = 938; // custom AvailabilityDomains
61+
const uint16_t SWIFTMODULE_VERSION_MINOR = 939; // cdecl isUnderscored
6262

6363
/// A standard hash seed used for all string hashes in a serialized module.
6464
///
@@ -2232,7 +2232,8 @@ namespace decls_block {
22322232
using CDeclDeclAttrLayout = BCRecordLayout<
22332233
CDecl_DECL_ATTR,
22342234
BCFixed<1>, // implicit flag
2235-
BCBlob // _silgen_name
2235+
BCFixed<1>, // underscored flag
2236+
BCBlob // cname
22362237
>;
22372238

22382239
using ImplementsDeclAttrLayout = BCRecordLayout<

lib/Serialization/Serialization.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2993,6 +2993,7 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
29932993
auto abbrCode = S.DeclTypeAbbrCodes[CDeclDeclAttrLayout::Code];
29942994
CDeclDeclAttrLayout::emitRecord(S.Out, S.ScratchRecord, abbrCode,
29952995
theAttr->isImplicit(),
2996+
theAttr->Underscored,
29962997
theAttr->Name);
29972998
return;
29982999
}

0 commit comments

Comments
 (0)