Skip to content

Commit c259be2

Browse files
committed
Remove never-used "version" field from ContextDescriptorFlags.
(cherry picked from commit 223645c)
1 parent 1de64ba commit c259be2

File tree

3 files changed

+1
-20
lines changed

3 files changed

+1
-20
lines changed

include/swift/ABI/MetadataValues.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,13 +1688,11 @@ struct ContextDescriptorFlags {
16881688
constexpr ContextDescriptorFlags(ContextDescriptorKind kind,
16891689
bool isGeneric,
16901690
bool isUnique,
1691-
uint8_t version,
16921691
uint16_t kindSpecificFlags)
16931692
: ContextDescriptorFlags(ContextDescriptorFlags()
16941693
.withKind(kind)
16951694
.withGeneric(isGeneric)
16961695
.withUnique(isUnique)
1697-
.withVersion(version)
16981696
.withKindSpecificFlags(kindSpecificFlags))
16991697
{}
17001698

@@ -1713,12 +1711,6 @@ struct ContextDescriptorFlags {
17131711
return (Value & 0x40u) != 0;
17141712
}
17151713

1716-
/// The format version of the descriptor. Higher version numbers may have
1717-
/// additional fields that aren't present in older versions.
1718-
constexpr uint8_t getVersion() const {
1719-
return (Value >> 8u) & 0xFFu;
1720-
}
1721-
17221714
/// The most significant two bytes of the flags word, which can have
17231715
/// kind-specific meaning.
17241716
constexpr uint16_t getKindSpecificFlags() const {
@@ -1740,10 +1732,6 @@ struct ContextDescriptorFlags {
17401732
| (isUnique ? 0x40u : 0));
17411733
}
17421734

1743-
constexpr ContextDescriptorFlags withVersion(uint8_t version) const {
1744-
return ContextDescriptorFlags((Value & 0xFFFF00FFu) | (version << 8u));
1745-
}
1746-
17471735
constexpr ContextDescriptorFlags
17481736
withKindSpecificFlags(uint16_t flags) const {
17491737
return ContextDescriptorFlags((Value & 0xFFFFu) | (flags << 16u));

lib/IRGen/GenMeta.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ namespace {
498498
ContextDescriptorFlags(asImpl().getContextKind(),
499499
!asImpl().getGenericSignature().isNull(),
500500
asImpl().isUniqueDescriptor(),
501-
asImpl().getVersion(),
502501
asImpl().getKindSpecificFlags())
503502
.getIntValue());
504503
}
@@ -578,10 +577,6 @@ namespace {
578577
irgen::addGenericPackShapeDescriptors(IGM, B, shapes, packArgs);
579578
}
580579

581-
uint8_t getVersion() {
582-
return 0;
583-
}
584-
585580
uint16_t getKindSpecificFlags() {
586581
return 0;
587582
}

unittests/runtime/MetadataObjectBuilder.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ inline void addModuleContextDescriptor(AnyObjectBuilder &builder,
3434
auto contextFlags = ContextDescriptorFlags(ContextDescriptorKind::Module,
3535
/*generic*/ false,
3636
/*unique*/ true,
37-
/*version*/ 0,
3837
/*kindSpecific*/ 0);
3938
builder.add32(contextFlags.getIntValue());
4039

@@ -55,7 +54,6 @@ inline void addProtocolDescriptor(AnyObjectBuilder &builder,
5554
auto contextFlags = ContextDescriptorFlags(ContextDescriptorKind::Protocol,
5655
/*generic*/ false,
5756
/*unique*/ true,
58-
/*version*/ 0,
5957
/*kindSpecific*/ 0);
6058
builder.add32(contextFlags.getIntValue());
6159

@@ -158,4 +156,4 @@ buildGlobalProtocolDescriptor(const ModuleContextDescriptor *module, Fn &&fn) {
158156

159157
} // end namespace swift
160158

161-
#endif
159+
#endif

0 commit comments

Comments
 (0)