@@ -1875,14 +1875,13 @@ static bool isRetroactiveConformance(const RootProtocolConformance *root) {
18751875// / Determine whether the given protocol conformance contains a retroactive
18761876// / protocol conformance anywhere in it.
18771877static bool containsRetroactiveConformance (
1878- ProtocolConformanceRef conformanceRef,
1879- ModuleDecl *module ) {
1878+ ProtocolConformanceRef conformanceRef) {
18801879 if (!conformanceRef.isPack () && !conformanceRef.isConcrete ())
18811880 return false ;
18821881
18831882 if (conformanceRef.isPack ()) {
18841883 for (auto patternConf : conformanceRef.getPack ()->getPatternConformances ()) {
1885- if (containsRetroactiveConformance (patternConf, module ))
1884+ if (containsRetroactiveConformance (patternConf))
18861885 return true ;
18871886 }
18881887
@@ -1912,7 +1911,7 @@ static bool containsRetroactiveConformance(
19121911 // for indexing purposes.
19131912 continue ;
19141913 }
1915- if (containsRetroactiveConformance (conformance, module )) {
1914+ if (containsRetroactiveConformance (conformance)) {
19161915 return true ;
19171916 }
19181917 }
@@ -1921,8 +1920,7 @@ static bool containsRetroactiveConformance(
19211920}
19221921
19231922void ASTMangler::appendRetroactiveConformances (SubstitutionMap subMap,
1924- GenericSignature sig,
1925- ModuleDecl *fromModule) {
1923+ GenericSignature sig) {
19261924 if (subMap.empty ()) return ;
19271925
19281926 unsigned numProtocolRequirements = 0 ;
@@ -1942,7 +1940,7 @@ void ASTMangler::appendRetroactiveConformances(SubstitutionMap subMap,
19421940 continue ;
19431941
19441942 // Skip non-retroactive conformances.
1945- if (!containsRetroactiveConformance (conformance, fromModule ))
1943+ if (!containsRetroactiveConformance (conformance))
19461944 continue ;
19471945
19481946 if (conformance.isConcrete ())
@@ -1972,7 +1970,7 @@ void ASTMangler::appendRetroactiveConformances(Type type, GenericSignature sig)
19721970 subMap = type->getContextSubstitutionMap (module , nominal);
19731971 }
19741972
1975- appendRetroactiveConformances (subMap, sig, module );
1973+ appendRetroactiveConformances (subMap, sig);
19761974}
19771975
19781976void ASTMangler::appendSymbolicExtendedExistentialType (
@@ -1995,11 +1993,7 @@ void ASTMangler::appendSymbolicExtendedExistentialType(
19951993 for (auto argType : genInfo.Generalization .getReplacementTypes ())
19961994 appendType (argType, sig, forDecl);
19971995
1998- // What module should be used here? The existential isn't anchored
1999- // to any given module; we should just treat conformances as
2000- // retroactive if they're "objectively" retroactive.
2001- appendRetroactiveConformances (genInfo.Generalization , sig,
2002- /* from module*/ nullptr );
1996+ appendRetroactiveConformances (genInfo.Generalization , sig);
20031997 }
20041998
20051999 appendOperator (" Xj" );
@@ -2190,7 +2184,7 @@ void ASTMangler::appendImplFunctionType(SILFunctionType *fn,
21902184 }
21912185 if (auto subs = fn->getInvocationSubstitutions ()) {
21922186 appendFlatGenericArgs (subs, sig, forDecl);
2193- appendRetroactiveConformances (subs, sig, Mod );
2187+ appendRetroactiveConformances (subs, sig);
21942188 }
21952189 if (auto subs = fn->getPatternSubstitutions ()) {
21962190 appendGenericSignature (subs.getGenericSignature ());
@@ -2199,7 +2193,7 @@ void ASTMangler::appendImplFunctionType(SILFunctionType *fn,
21992193 ? fn->getInvocationGenericSignature ()
22002194 : outerGenericSig;
22012195 appendFlatGenericArgs (subs, sig, forDecl);
2202- appendRetroactiveConformances (subs, sig, Mod );
2196+ appendRetroactiveConformances (subs, sig);
22032197 }
22042198
22052199 OpArgs.push_back (' _' );
@@ -2235,7 +2229,7 @@ void ASTMangler::appendOpaqueTypeArchetype(ArchetypeType *archetype,
22352229 appendOpaqueDeclName (opaqueDecl);
22362230 bool isFirstArgList = true ;
22372231 appendBoundGenericArgs (opaqueDecl, sig, subs, isFirstArgList, forDecl);
2238- appendRetroactiveConformances (subs, sig, opaqueDecl-> getParentModule () );
2232+ appendRetroactiveConformances (subs, sig);
22392233
22402234 appendOperator (" Qo" , Index (genericParam->getIndex ()));
22412235 } else {
0 commit comments