Skip to content

Commit 5068579

Browse files
committed
Serialization: Remove serialization support for @_allowFeatureSuppression.
It isn't used since the attribute doesn't get serialized.
1 parent 60a62db commit 5068579

File tree

3 files changed

+3
-36
lines changed

3 files changed

+3
-36
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6034,22 +6034,6 @@ llvm::Error DeclDeserializer::deserializeDeclCommon() {
60346034
break;
60356035
}
60366036

6037-
case decls_block::AllowFeatureSuppression_DECL_ATTR: {
6038-
bool isImplicit;
6039-
ArrayRef<uint64_t> featureIds;
6040-
serialization::decls_block::AllowFeatureSuppressionDeclAttrLayout
6041-
::readRecord(scratch, isImplicit, featureIds);
6042-
6043-
SmallVector<Identifier, 4> features;
6044-
for (auto id : featureIds)
6045-
features.push_back(MF.getIdentifier(id));
6046-
6047-
Attr = AllowFeatureSuppressionAttr::create(ctx, SourceLoc(),
6048-
SourceRange(), isImplicit,
6049-
features);
6050-
break;
6051-
}
6052-
60536037
case decls_block::UnavailableFromAsync_DECL_ATTR: {
60546038
bool isImplicit;
60556039
serialization::decls_block::UnavailableFromAsyncDeclAttrLayout::

lib/Serialization/ModuleFormat.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,12 +2138,6 @@ namespace decls_block {
21382138
BCArray<IdentifierIDField> // name components
21392139
>;
21402140

2141-
using AllowFeatureSuppressionDeclAttrLayout = BCRecordLayout<
2142-
AllowFeatureSuppression_DECL_ATTR,
2143-
BCFixed<1>, // implicit flag
2144-
BCArray<IdentifierIDField> // feature names
2145-
>;
2146-
21472141
using SPIAccessControlDeclAttrLayout = BCRecordLayout<
21482142
SPIAccessControl_DECL_ATTR,
21492143
BCArray<IdentifierIDField> // SPI names
@@ -2254,6 +2248,8 @@ namespace decls_block {
22542248
using ClangImporterSynthesizedTypeDeclAttrLayout
22552249
= BCRecordLayout<ClangImporterSynthesizedType_DECL_ATTR>;
22562250
using PrivateImportDeclAttrLayout = BCRecordLayout<PrivateImport_DECL_ATTR>;
2251+
using AllowFeatureSuppressionDeclAttrLayout =
2252+
BCRecordLayout<AllowFeatureSuppression_DECL_ATTR>;
22572253
using ProjectedValuePropertyDeclAttrLayout = BCRecordLayout<
22582254
ProjectedValueProperty_DECL_ATTR,
22592255
BCFixed<1>, // isImplicit

lib/Serialization/Serialization.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,6 +2717,7 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
27172717
case DeclAttrKind::RestatedObjCConformance:
27182718
case DeclAttrKind::ClangImporterSynthesizedType:
27192719
case DeclAttrKind::PrivateImport:
2720+
case DeclAttrKind::AllowFeatureSuppression:
27202721
llvm_unreachable("cannot serialize attribute");
27212722

27222723
#define SIMPLE_DECL_ATTR(_, CLASS, ...) \
@@ -2769,20 +2770,6 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
27692770
return;
27702771
}
27712772

2772-
case DeclAttrKind::AllowFeatureSuppression: {
2773-
auto *theAttr = cast<AllowFeatureSuppressionAttr>(DA);
2774-
auto abbrCode =
2775-
S.DeclTypeAbbrCodes[AllowFeatureSuppressionDeclAttrLayout::Code];
2776-
2777-
SmallVector<IdentifierID> ids;
2778-
for (auto id : theAttr->getSuppressedFeatures())
2779-
ids.push_back(S.addUniquedStringRef(id.str()));
2780-
2781-
AllowFeatureSuppressionDeclAttrLayout::emitRecord(
2782-
S.Out, S.ScratchRecord, abbrCode, theAttr->isImplicit(), ids);
2783-
return;
2784-
}
2785-
27862773
case DeclAttrKind::SPIAccessControl: {
27872774
auto theAttr = cast<SPIAccessControlAttr>(DA);
27882775
auto abbrCode = S.DeclTypeAbbrCodes[SPIAccessControlDeclAttrLayout::Code];

0 commit comments

Comments
 (0)