File tree Expand file tree Collapse file tree 5 files changed +13
-8
lines changed Expand file tree Collapse file tree 5 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -1871,11 +1871,16 @@ using ProtocolDescriptor = TargetProtocolDescriptor<InProcess>;
1871
1871
// / the layout of a witness table is dependent on the protocol being
1872
1872
// / represented.
1873
1873
template <typename Runtime>
1874
- struct TargetWitnessTable {
1874
+ class TargetWitnessTable {
1875
1875
// / The protocol conformance descriptor from which this witness table
1876
1876
// / was generated.
1877
1877
ConstTargetMetadataPointer<Runtime, TargetProtocolConformanceDescriptor>
1878
1878
Description;
1879
+
1880
+ public:
1881
+ const TargetProtocolConformanceDescriptor<Runtime> *getDescription () const {
1882
+ return Description;
1883
+ }
1879
1884
};
1880
1885
1881
1886
using WitnessTable = TargetWitnessTable<InProcess>;
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ static const Metadata *findHashableBaseTypeImpl(const Metadata *type) {
89
89
return nullptr ;
90
90
}
91
91
// By this point, `type` is known to conform to `Hashable`.
92
- const auto *conformance = witnessTable->Description ;
92
+ const auto *conformance = witnessTable->getDescription () ;
93
93
const Metadata *baseTypeThatConformsToHashable =
94
94
findConformingSuperclass (type, conformance);
95
95
HashableConformances.getOrInsert (HashableConformanceKey{type},
Original file line number Diff line number Diff line change @@ -2568,7 +2568,7 @@ MetadataResponse _getBridgedObjectiveCType(
2568
2568
const Metadata *conformingType,
2569
2569
const _ObjectiveCBridgeableWitnessTable *wtable) {
2570
2570
// FIXME: Can we directly reference the descriptor somehow?
2571
- const ProtocolConformanceDescriptor *conformance = wtable->Description ;
2571
+ const ProtocolConformanceDescriptor *conformance = wtable->getDescription () ;
2572
2572
const ProtocolDescriptor *protocol = conformance->getProtocol ();
2573
2573
auto assocTypeRequirement = protocol->getRequirements ().begin ();
2574
2574
assert (assocTypeRequirement->Flags .getKind () ==
Original file line number Diff line number Diff line change @@ -4624,7 +4624,7 @@ swift_getAssociatedTypeWitnessSlowImpl(
4624
4624
const ProtocolRequirement *assocType) {
4625
4625
#ifndef NDEBUG
4626
4626
{
4627
- const ProtocolConformanceDescriptor *conformance = wtable->Description ;
4627
+ const ProtocolConformanceDescriptor *conformance = wtable->getDescription () ;
4628
4628
const ProtocolDescriptor *protocol = conformance->getProtocol ();
4629
4629
auto requirements = protocol->getRequirements ();
4630
4630
assert (assocType >= requirements.begin () &&
@@ -4669,7 +4669,7 @@ swift_getAssociatedTypeWitnessSlowImpl(
4669
4669
}
4670
4670
4671
4671
// Dig out the protocol.
4672
- const ProtocolConformanceDescriptor *conformance = wtable->Description ;
4672
+ const ProtocolConformanceDescriptor *conformance = wtable->getDescription () ;
4673
4673
const ProtocolDescriptor *protocol = conformance->getProtocol ();
4674
4674
4675
4675
// Extract the mangled name itself.
@@ -4788,7 +4788,7 @@ static const WitnessTable *swift_getAssociatedConformanceWitnessSlowImpl(
4788
4788
const ProtocolRequirement *assocConformance) {
4789
4789
#ifndef NDEBUG
4790
4790
{
4791
- const ProtocolConformanceDescriptor *conformance = wtable->Description ;
4791
+ const ProtocolConformanceDescriptor *conformance = wtable->getDescription () ;
4792
4792
const ProtocolDescriptor *protocol = conformance->getProtocol ();
4793
4793
auto requirements = protocol->getRequirements ();
4794
4794
assert (assocConformance >= requirements.begin () &&
Original file line number Diff line number Diff line change @@ -365,8 +365,8 @@ class MetadataCacheKey {
365
365
if (awt == bwt)
366
366
return 0 ;
367
367
368
- auto *aDescription = awt->Description ;
369
- auto *bDescription = bwt->Description ;
368
+ auto *aDescription = awt->getDescription () ;
369
+ auto *bDescription = bwt->getDescription () ;
370
370
if (aDescription == bDescription)
371
371
return 0 ;
372
372
You can’t perform that action at this time.
0 commit comments