@@ -3172,7 +3172,7 @@ void EmitPolymorphicArguments::emit(SubstitutionMap subs,
31723172 // For now, treat all archetypes independently.
31733173 enumerateUnfulfilledRequirements ([&](GenericRequirement requirement) {
31743174 llvm::Value *requiredValue =
3175- emitGenericRequirementFromSubstitutions (IGF, Generics, M,
3175+ emitGenericRequirementFromSubstitutions (IGF, Generics,
31763176 requirement, subs);
31773177 out.add (requiredValue);
31783178 });
@@ -3294,14 +3294,17 @@ NecessaryBindings NecessaryBindings::computeBindings(
32943294// / that takes the (thick) parent metatype as an argument.
32953295GenericTypeRequirements::GenericTypeRequirements (IRGenModule &IGM,
32963296 NominalTypeDecl *typeDecl)
3297- : TheDecl(typeDecl) {
3297+ : GenericTypeRequirements(IGM, typeDecl->getGenericSignatureOfContext ()) {}
3298+
3299+ GenericTypeRequirements::GenericTypeRequirements (IRGenModule &IGM,
3300+ GenericSignature ncGenerics) {
32983301 // We only need to do something here if the declaration context is
32993302 // somehow generic.
3300- auto ncGenerics = typeDecl->getGenericSignatureOfContext ();
33013303 if (!ncGenerics || ncGenerics->areAllParamsConcrete ()) return ;
33023304
33033305 // Construct a representative function type.
33043306 auto generics = ncGenerics.getCanonicalSignature ();
3307+ Generics = generics;
33053308 auto fnType = SILFunctionType::get (generics, SILFunctionType::ExtInfo (),
33063309 SILCoroutineKind::None,
33073310 /* callee*/ ParameterConvention::Direct_Unowned,
@@ -3345,12 +3348,9 @@ void GenericTypeRequirements::emitInitOfBuffer(IRGenFunction &IGF,
33453348 Address buffer) {
33463349 if (Requirements.empty ()) return ;
33473350
3348- auto generics =
3349- TheDecl->getGenericSignatureOfContext ().getCanonicalSignature ();
3350- auto &module = *TheDecl->getParentModule ();
33513351 emitInitOfGenericRequirementsBuffer (IGF, Requirements, buffer,
33523352 [&](GenericRequirement requirement) {
3353- return emitGenericRequirementFromSubstitutions (IGF, generics, module ,
3353+ return emitGenericRequirementFromSubstitutions (IGF, Generics ,
33543354 requirement, subs);
33553355 });
33563356}
@@ -3383,7 +3383,6 @@ void irgen::emitInitOfGenericRequirementsBuffer(IRGenFunction &IGF,
33833383llvm::Value *
33843384irgen::emitGenericRequirementFromSubstitutions (IRGenFunction &IGF,
33853385 CanGenericSignature generics,
3386- ModuleDecl &module ,
33873386 GenericRequirement requirement,
33883387 SubstitutionMap subs) {
33893388 CanType depTy = requirement.TypeParameter ;
0 commit comments