Skip to content

Commit 499547a

Browse files
[Serialization] Remove serialization code for initializes() and accesses() attributes
1 parent e880124 commit 499547a

File tree

3 files changed

+1
-69
lines changed

3 files changed

+1
-69
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5584,36 +5584,6 @@ llvm::Error DeclDeserializer::deserializeDeclCommon() {
55845584
break;
55855585
}
55865586

5587-
case decls_block::Initializes_DECL_ATTR: {
5588-
ArrayRef<uint64_t> rawPropertyIDs;
5589-
serialization::decls_block::InitializesDeclAttrLayout::
5590-
readRecord(scratch, rawPropertyIDs);
5591-
5592-
SmallVector<Identifier, 4> properties;
5593-
for (auto rawID : rawPropertyIDs) {
5594-
properties.push_back(MF.getIdentifier(rawID));
5595-
}
5596-
5597-
Attr = InitializesAttr::create(ctx, SourceLoc(), SourceRange(),
5598-
properties);
5599-
break;
5600-
}
5601-
5602-
case decls_block::Accesses_DECL_ATTR: {
5603-
ArrayRef<uint64_t> rawPropertyIDs;
5604-
serialization::decls_block::AccessesDeclAttrLayout::
5605-
readRecord(scratch, rawPropertyIDs);
5606-
5607-
SmallVector<Identifier, 4> properties;
5608-
for (auto rawID : rawPropertyIDs) {
5609-
properties.push_back(MF.getIdentifier(rawID));
5610-
}
5611-
5612-
Attr = AccessesAttr::create(ctx, SourceLoc(), SourceRange(),
5613-
properties);
5614-
break;
5615-
}
5616-
56175587
case decls_block::StorageRestrictions_DECL_ATTR: {
56185588
unsigned numInitializesProperties;
56195589
ArrayRef<uint64_t> rawPropertyIDs;

lib/Serialization/ModuleFormat.h

Lines changed: 1 addition & 11 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 = 802; // added tuple_pack_extract
61+
const uint16_t SWIFTMODULE_VERSION_MINOR = 803; // removed initializes and accesses attributes
6262

6363
/// A standard hash seed used for all string hashes in a serialized module.
6464
///
@@ -2233,16 +2233,6 @@ namespace decls_block {
22332233
BCArray<IdentifierIDField> // target function pieces, spi groups, type erased params
22342234
>;
22352235

2236-
using InitializesDeclAttrLayout = BCRecordLayout<
2237-
Initializes_DECL_ATTR,
2238-
BCArray<IdentifierIDField> // initialized properties
2239-
>;
2240-
2241-
using AccessesDeclAttrLayout = BCRecordLayout<
2242-
Accesses_DECL_ATTR,
2243-
BCArray<IdentifierIDField> // initialized properties
2244-
>;
2245-
22462236
using StorageRestrictionsDeclAttrLayout = BCRecordLayout<
22472237
StorageRestrictions_DECL_ATTR,
22482238
BCVBR<16>, // num "initializes" properties

lib/Serialization/Serialization.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2923,34 +2923,6 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
29232923
return;
29242924
}
29252925

2926-
case DAK_Initializes: {
2927-
auto abbrCode = S.DeclTypeAbbrCodes[InitializesDeclAttrLayout::Code];
2928-
auto attr = cast<InitializesAttr>(DA);
2929-
2930-
SmallVector<IdentifierID, 4> properties;
2931-
for (auto identifier : attr->getProperties()) {
2932-
properties.push_back(S.addDeclBaseNameRef(identifier));
2933-
}
2934-
2935-
InitializesDeclAttrLayout::emitRecord(
2936-
S.Out, S.ScratchRecord, abbrCode, properties);
2937-
return;
2938-
}
2939-
2940-
case DAK_Accesses: {
2941-
auto abbrCode = S.DeclTypeAbbrCodes[AccessesDeclAttrLayout::Code];
2942-
auto attr = cast<InitializesAttr>(DA);
2943-
2944-
SmallVector<IdentifierID, 4> properties;
2945-
for (auto identifier : attr->getProperties()) {
2946-
properties.push_back(S.addDeclBaseNameRef(identifier));
2947-
}
2948-
2949-
AccessesDeclAttrLayout::emitRecord(
2950-
S.Out, S.ScratchRecord, abbrCode, properties);
2951-
return;
2952-
}
2953-
29542926
case DAK_StorageRestrictions: {
29552927
auto abbrCode = S.DeclTypeAbbrCodes[StorageRestrictionsDeclAttrLayout::Code];
29562928
auto attr = cast<StorageRestrictionsAttr>(DA);

0 commit comments

Comments
 (0)