@@ -946,11 +946,11 @@ namespace {
946946 }
947947 }
948948
949- void addAssociatedType (AssociatedType requirement ) {
949+ void addAssociatedType (AssociatedTypeDecl *assocType ) {
950950 // In Embedded Swift witness tables don't have associated-types entries.
951- if (requirement. getAssociation () ->getASTContext ().LangOpts .hasFeature (Feature::Embedded))
951+ if (assocType ->getASTContext ().LangOpts .hasFeature (Feature::Embedded))
952952 return ;
953- Entries.push_back (WitnessTableEntry::forAssociatedType (requirement ));
953+ Entries.push_back (WitnessTableEntry::forAssociatedType (assocType ));
954954 }
955955
956956 void addAssociatedConformance (const AssociatedConformance &req) {
@@ -1330,8 +1330,8 @@ mapConformanceIntoContext(const RootProtocolConformance *conf) {
13301330
13311331WitnessIndex ProtocolInfo::getAssociatedTypeIndex (
13321332 IRGenModule &IGM,
1333- AssociatedType assocType) const {
1334- assert (!IGM.isResilient (assocType. getSourceProtocol (),
1333+ AssociatedTypeDecl * assocType) const {
1334+ assert (!IGM.isResilient (assocType-> getProtocol (),
13351335 ResilienceExpansion::Maximal) &&
13361336 " Cannot ask for the associated type index of non-resilient protocol" );
13371337 for (auto &witness : getWitnessEntries ()) {
@@ -1707,7 +1707,7 @@ class AccessorConformanceInfo : public ConformanceInfo {
17071707 llvm_unreachable (" cannot emit a witness table with placeholders in it" );
17081708 }
17091709
1710- void addAssociatedType (AssociatedType requirement ) {
1710+ void addAssociatedType (AssociatedTypeDecl *assocType ) {
17111711 auto &entry = SILEntries.front ();
17121712 SILEntries = SILEntries.slice (1 );
17131713
@@ -1718,34 +1718,32 @@ class AccessorConformanceInfo : public ConformanceInfo {
17181718#ifndef NDEBUG
17191719 assert (entry.getKind () == SILWitnessTable::AssociatedType
17201720 && " sil witness table does not match protocol" );
1721- assert (entry.getAssociatedTypeWitness ().Requirement
1722- == requirement.getAssociation ()
1721+ assert (entry.getAssociatedTypeWitness ().Requirement == assocType
17231722 && " sil witness table does not match protocol" );
1724- auto piIndex = PI.getAssociatedTypeIndex (IGM, requirement );
1723+ auto piIndex = PI.getAssociatedTypeIndex (IGM, assocType );
17251724 assert ((size_t )piIndex.getValue () ==
17261725 Table.size () - WitnessTableFirstRequirementOffset &&
17271726 " offset doesn't match ProtocolInfo layout" );
17281727#else
17291728 (void )entry;
17301729#endif
17311730
1732- auto associate =
1733- Conformance.getTypeWitness (requirement.getAssociation ());
1734- llvm::Constant *witness =
1731+ auto typeWitness = Conformance.getTypeWitness (assocType);
1732+ llvm::Constant *typeWitnessAddr =
17351733 IGM.getAssociatedTypeWitness (
1736- associate ,
1734+ typeWitness ,
17371735 Conformance.getDeclContext ()->getGenericSignatureOfContext (),
17381736 /* inProtocolContext=*/ false );
1739- witness = llvm::ConstantExpr::getBitCast (witness , IGM.Int8PtrTy );
1737+ typeWitnessAddr = llvm::ConstantExpr::getBitCast (typeWitnessAddr , IGM.Int8PtrTy );
17401738
17411739 if (isRelative) {
1742- Table.addRelativeAddress (witness );
1740+ Table.addRelativeAddress (typeWitnessAddr );
17431741 return ;
17441742 }
17451743
17461744 auto &schema = IGM.getOptions ().PointerAuth
17471745 .ProtocolAssociatedTypeAccessFunctions ;
1748- Table.addSignedPointer (witness , schema, requirement );
1746+ Table.addSignedPointer (typeWitnessAddr , schema, assocType );
17491747 }
17501748
17511749 void addAssociatedConformance (AssociatedConformance requirement) {
@@ -3513,7 +3511,7 @@ MetadataResponse MetadataPath::followComponent(IRGenFunction &IGF,
35133511 SubstitutionMap::getProtocolSubstitutions (sourceConformance))
35143512 ->getCanonicalType ();
35153513 if (auto archetypeType = dyn_cast<ArchetypeType>(baseSubstType)) {
3516- AssociatedType baseAssocType ( depMemType->getAssocType () );
3514+ auto * baseAssocType = depMemType->getAssocType ();
35173515
35183516 MetadataResponse response =
35193517 emitAssociatedTypeMetadataRef (IGF, archetypeType, baseAssocType,
@@ -4538,18 +4536,18 @@ MetadataResponse
45384536irgen::emitAssociatedTypeMetadataRef (IRGenFunction &IGF,
45394537 llvm::Value *parentMetadata,
45404538 llvm::Value *wtable,
4541- AssociatedType associatedType ,
4539+ AssociatedTypeDecl *assocType ,
45424540 DynamicMetadataRequest request) {
45434541 auto &IGM = IGF.IGM ;
45444542
45454543 // Extract the requirements base descriptor.
45464544 auto reqBaseDescriptor =
45474545 IGM.getAddrOfProtocolRequirementsBaseDescriptor (
4548- associatedType. getSourceProtocol ());
4546+ assocType-> getProtocol ());
45494547
45504548 // Extract the associated type descriptor.
45514549 auto assocTypeDescriptor =
4552- IGM.getAddrOfAssociatedTypeDescriptor (associatedType. getAssociation () );
4550+ IGM.getAddrOfAssociatedTypeDescriptor (assocType );
45534551 // Call swift_getAssociatedTypeWitness().
45544552 auto call =
45554553 IGF.IGM .IRGen .Opts .UseRelativeProtocolWitnessTables ?
0 commit comments