Skip to content

Commit 223645c

Browse files
committed
Remove never-used "version" field from ContextDescriptorFlags.
1 parent 32a5b4f commit 223645c

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
@@ -497,7 +497,6 @@ namespace {
497497
ContextDescriptorFlags(asImpl().getContextKind(),
498498
!asImpl().getGenericSignature().isNull(),
499499
asImpl().isUniqueDescriptor(),
500-
asImpl().getVersion(),
501500
asImpl().getKindSpecificFlags())
502501
.getIntValue());
503502
}
@@ -577,10 +576,6 @@ namespace {
577576
irgen::addGenericPackShapeDescriptors(IGM, B, shapes, packArgs);
578577
}
579578

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

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)