@@ -894,16 +894,14 @@ std::pair<FullApplySite, bool> swift::tryDevirtualizeClassMethod(
894894// / \param classWitness The ClassDecl if this is a class witness method
895895static SubstitutionMap
896896getWitnessMethodSubstitutions (
897- ModuleDecl *mod ,
897+ ASTContext &ctx ,
898898 ProtocolConformanceRef conformanceRef,
899899 GenericSignature requirementSig,
900900 GenericSignature witnessThunkSig,
901901 SubstitutionMap origSubMap,
902902 bool isSelfAbstract,
903903 ClassDecl *classWitness) {
904904
905- auto &ctx = mod->getASTContext ();
906-
907905 if (witnessThunkSig.isNull ())
908906 return SubstitutionMap ();
909907
@@ -917,7 +915,7 @@ getWitnessMethodSubstitutions(
917915
918916 // If `Self` maps to a bound generic type, this gives us the
919917 // substitutions for the concrete type's generic parameters.
920- auto baseSubMap = conformance->getSubstitutions (mod );
918+ auto baseSubMap = conformance->getSubstitutionMap ( );
921919
922920 unsigned baseDepth = 0 ;
923921 auto *rootConformance = conformance->getRootConformance ();
@@ -1023,7 +1021,7 @@ swift::getWitnessMethodSubstitutions(SILModule &module, ApplySite applySite,
10231021
10241022 SubstitutionMap origSubs = applySite.getSubstitutionMap ();
10251023
1026- auto *mod = module .getSwiftModule ();
1024+ auto &ctx = module .getASTContext ();
10271025 bool isSelfAbstract =
10281026 witnessFnTy
10291027 ->getSelfInstanceType (
@@ -1032,7 +1030,7 @@ swift::getWitnessMethodSubstitutions(SILModule &module, ApplySite applySite,
10321030 auto *classWitness = witnessFnTy->getWitnessMethodClass (
10331031 module , applySite.getFunction ()->getTypeExpansionContext ());
10341032
1035- return ::getWitnessMethodSubstitutions (mod , cRef, requirementSig,
1033+ return ::getWitnessMethodSubstitutions (ctx , cRef, requirementSig,
10361034 witnessThunkSig, origSubs,
10371035 isSelfAbstract, classWitness);
10381036}
0 commit comments