@@ -2920,14 +2920,6 @@ void NecessaryBindings::save(IRGenFunction &IGF, Address buffer) const {
29202920void NecessaryBindings::addTypeMetadata (CanType type) {
29212921 assert (!isa<InOutType>(type));
29222922
2923- // If the bindings are for an async function, we will always need the type
2924- // metadata. The opportunities to reconstruct it available in the context of
2925- // partial apply forwarders are not available here.
2926- if (forAsyncFunction ()) {
2927- addRequirement ({type, nullptr });
2928- return ;
2929- }
2930-
29312923 // Bindings are only necessary at all if the type is dependent.
29322924 if (!type->hasArchetype ())
29332925 return ;
@@ -2995,21 +2987,12 @@ void NecessaryBindings::addProtocolConformance(CanType type,
29952987 dyn_cast<SpecializedProtocolConformance>(concreteConformance);
29962988 // The partial apply forwarder does not have the context to reconstruct
29972989 // abstract conditional conformance requirements.
2998- if (forPartialApply () && specializedConf) {
2990+ if (specializedConf) {
29992991 addAbstractConditionalRequirements (specializedConf);
3000- } else if (forAsyncFunction ()) {
3001- ProtocolDecl *protocol = conf.getRequirement ();
3002- GenericRequirement requirement;
3003- requirement.TypeParameter = type;
3004- requirement.Protocol = protocol;
3005- std::pair<GenericRequirement, ProtocolConformanceRef> pair{requirement,
3006- conf};
3007- Conformances.insert (pair);
3008- addRequirement ({type, concreteConformance->getProtocol ()});
30092992 }
30102993 return ;
30112994 }
3012- assert (isa<ArchetypeType>(type) || forAsyncFunction () );
2995+ assert (isa<ArchetypeType>(type));
30132996
30142997 // TODO: pass something about the root conformance necessary to
30152998 // reconstruct this.
@@ -3204,29 +3187,20 @@ void EmitPolymorphicArguments::emit(SubstitutionMap subs,
32043187 }
32053188}
32063189
3207- NecessaryBindings NecessaryBindings::forAsyncFunctionInvocation (
3208- IRGenModule &IGM, CanSILFunctionType origType, SubstitutionMap subs) {
3209- return computeBindings (IGM, origType, subs,
3210- false /* forPartialApplyForwarder*/ );
3211- }
3212-
32133190NecessaryBindings
32143191NecessaryBindings::forPartialApplyForwarder (IRGenModule &IGM,
32153192 CanSILFunctionType origType,
32163193 SubstitutionMap subs,
32173194 bool considerParameterSources) {
32183195 return computeBindings (IGM, origType, subs,
3219- true /* forPartialApplyForwarder*/ ,
32203196 considerParameterSources);
32213197}
32223198
32233199NecessaryBindings NecessaryBindings::computeBindings (
32243200 IRGenModule &IGM, CanSILFunctionType origType, SubstitutionMap subs,
3225- bool forPartialApplyForwarder, bool considerParameterSources) {
3201+ bool considerParameterSources) {
32263202
32273203 NecessaryBindings bindings;
3228- bindings.kind =
3229- forPartialApplyForwarder ? Kind::PartialApply : Kind::AsyncFunction;
32303204
32313205 // Bail out early if we don't have polymorphic parameters.
32323206 if (!hasPolymorphicParameters (origType))
@@ -3249,9 +3223,7 @@ NecessaryBindings NecessaryBindings::computeBindings(
32493223 case MetadataSource::Kind::SelfMetadata:
32503224 // Async functions pass the SelfMetadata and SelfWitnessTable parameters
32513225 // along explicitly.
3252- if (forPartialApplyForwarder) {
3253- bindings.addTypeMetadata (getSubstSelfType (IGM, origType, subs));
3254- }
3226+ bindings.addTypeMetadata (getSubstSelfType (IGM, origType, subs));
32553227 continue ;
32563228
32573229 case MetadataSource::Kind::SelfWitnessTable:
0 commit comments