@@ -1780,9 +1780,6 @@ class AccessorConformanceInfo : public ConformanceInfo {
1780
1780
auto associatedWitness = entry.getAssociatedConformanceWitness ();
1781
1781
assert (associatedWitness.Requirement == requirement.getAssociation ()
1782
1782
&& " sil witness table does not match protocol" );
1783
- assert (associatedWitness.Protocol ==
1784
- requirement.getAssociatedRequirement ()
1785
- && " sil witness table does not match protocol" );
1786
1783
auto piIndex = PI.getAssociatedConformanceIndex (requirement);
1787
1784
assert ((size_t )piIndex.getValue () ==
1788
1785
Table.size () - WitnessTableFirstRequirementOffset &&
@@ -1792,10 +1789,8 @@ class AccessorConformanceInfo : public ConformanceInfo {
1792
1789
if (IGM.Context .LangOpts .hasFeature (Feature::Embedded)) {
1793
1790
// In Embedded Swift associated-conformance entries simply point to the witness table
1794
1791
// of the associated conformance.
1795
- ProtocolConformanceRef assocConf =
1796
- SILWT->getConformance ()->getAssociatedConformance (requirement.getAssociation (),
1797
- requirement.getAssociatedRequirement ());
1798
- llvm::Constant *witnessEntry = IGM.getAddrOfWitnessTable (assocConf.getConcrete ());
1792
+ ProtocolConformance *assocConf = associatedWitness.Witness .getConcrete ();
1793
+ llvm::Constant *witnessEntry = IGM.getAddrOfWitnessTable (assocConf);
1799
1794
auto &schema = IGM.getOptions ().PointerAuth
1800
1795
.ProtocolAssociatedTypeWitnessTableAccessFunctions ;
1801
1796
Table.addSignedPointer (witnessEntry, schema, requirement);
@@ -2030,10 +2025,11 @@ void ResilientWitnessTableBuilder::collectResilientWitnesses(
2030
2025
2031
2026
ProtocolConformanceRef associatedConformance =
2032
2027
ConformanceInContext.getAssociatedConformance (witness.Requirement ,
2033
- witness.Protocol );
2028
+ witness.Witness .getRequirement ());
2029
+
2034
2030
AssociatedConformance requirement (SILWT->getProtocol (),
2035
2031
witness.Requirement ,
2036
- witness.Protocol );
2032
+ witness.Witness . getRequirement () );
2037
2033
2038
2034
llvm::Constant *witnessEntry =
2039
2035
getAssociatedConformanceWitness (requirement, associate,
@@ -2353,7 +2349,7 @@ namespace {
2353
2349
2354
2350
AssociatedConformance requirement (SILWT->getProtocol (),
2355
2351
witness.Requirement ,
2356
- witness.Protocol );
2352
+ witness.Witness . getRequirement () );
2357
2353
auto assocConformanceDescriptor =
2358
2354
IGM.getAddrOfLLVMVariableOrGOTEquivalent (
2359
2355
LinkEntity::forAssociatedConformanceDescriptor (requirement));
@@ -3402,8 +3398,7 @@ MetadataResponse MetadataPath::followComponent(IRGenFunction &IGF,
3402
3398
}
3403
3399
3404
3400
case Component::Kind::OutOfLineBaseProtocol: {
3405
- auto conformance = sourceKey.Kind .getProtocolConformance ();
3406
- auto protocol = conformance.getRequirement ();
3401
+ auto protocol = sourceKey.Kind .getConformedProtocol ();
3407
3402
auto &pi = IGF.IGM .getProtocolInfo (protocol,
3408
3403
ProtocolInfoKind::RequirementSignature);
3409
3404
@@ -3413,9 +3408,10 @@ MetadataResponse MetadataPath::followComponent(IRGenFunction &IGF,
3413
3408
3414
3409
sourceKey.Kind =
3415
3410
LocalTypeDataKind::forAbstractProtocolWitnessTable (inheritedProtocol);
3416
- if (conformance. isConcrete ()) {
3411
+ if (sourceKey. Kind . isConcreteProtocolConformance ()) {
3417
3412
auto inheritedConformance =
3418
- conformance.getConcrete ()->getInheritedConformance (inheritedProtocol);
3413
+ sourceKey.Kind .getConcreteProtocolConformance ()
3414
+ ->getInheritedConformance (inheritedProtocol);
3419
3415
if (inheritedConformance) {
3420
3416
sourceKey.Kind = LocalTypeDataKind::forConcreteProtocolWitnessTable (
3421
3417
inheritedConformance);
@@ -3438,8 +3434,8 @@ MetadataResponse MetadataPath::followComponent(IRGenFunction &IGF,
3438
3434
3439
3435
case Component::Kind::AssociatedConformance: {
3440
3436
auto sourceType = sourceKey.Type ;
3441
- auto sourceConformance = sourceKey.Kind .getProtocolConformance ();
3442
- auto sourceProtocol = sourceConformance. getRequirement ();
3437
+ auto sourceConformance = sourceKey.Kind .getProtocolConformance (sourceType );
3438
+ auto sourceProtocol = sourceKey. Kind . getConformedProtocol ();
3443
3439
auto &pi = IGF.IGM .getProtocolInfo (sourceProtocol,
3444
3440
ProtocolInfoKind::RequirementSignature);
3445
3441
@@ -3473,7 +3469,8 @@ MetadataResponse MetadataPath::followComponent(IRGenFunction &IGF,
3473
3469
// In Embedded Swift associated-conformance entries simply point to the witness table
3474
3470
// of the associated conformance.
3475
3471
llvm::Value *sourceWTable = source.getMetadata ();
3476
- llvm::Value *associatedWTable = emitAssociatedConformanceValue (IGF, sourceWTable, associatedConformanceRef);
3472
+ llvm::Value *associatedWTable = emitAssociatedConformanceValue (
3473
+ IGF, sourceWTable, associatedConformanceRef);
3477
3474
return MetadataResponse::forComplete (associatedWTable);
3478
3475
}
3479
3476
@@ -3562,13 +3559,13 @@ MetadataResponse MetadataPath::followComponent(IRGenFunction &IGF,
3562
3559
}
3563
3560
3564
3561
case Component::Kind::ConditionalConformance: {
3565
- auto sourceConformance = sourceKey.Kind .getProtocolConformance ();
3562
+ auto sourceConformance = sourceKey.Kind .getConcreteProtocolConformance ();
3566
3563
3567
3564
auto reqtIndex = component.getPrimaryIndex ();
3568
3565
3569
3566
ProtocolDecl *conformingProto;
3570
3567
auto found = SILWitnessTable::enumerateWitnessTableConditionalConformances (
3571
- sourceConformance. getConcrete () ,
3568
+ sourceConformance,
3572
3569
[&](unsigned index , CanType type, ProtocolDecl *proto) {
3573
3570
if (reqtIndex == index ) {
3574
3571
conformingProto = proto;
0 commit comments