@@ -2920,14 +2920,6 @@ void NecessaryBindings::save(IRGenFunction &IGF, Address buffer) const {
2920
2920
void NecessaryBindings::addTypeMetadata (CanType type) {
2921
2921
assert (!isa<InOutType>(type));
2922
2922
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
-
2931
2923
// Bindings are only necessary at all if the type is dependent.
2932
2924
if (!type->hasArchetype ())
2933
2925
return ;
@@ -2995,21 +2987,12 @@ void NecessaryBindings::addProtocolConformance(CanType type,
2995
2987
dyn_cast<SpecializedProtocolConformance>(concreteConformance);
2996
2988
// The partial apply forwarder does not have the context to reconstruct
2997
2989
// abstract conditional conformance requirements.
2998
- if (forPartialApply () && specializedConf) {
2990
+ if (specializedConf) {
2999
2991
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 ()});
3009
2992
}
3010
2993
return ;
3011
2994
}
3012
- assert (isa<ArchetypeType>(type) || forAsyncFunction () );
2995
+ assert (isa<ArchetypeType>(type));
3013
2996
3014
2997
// TODO: pass something about the root conformance necessary to
3015
2998
// reconstruct this.
@@ -3204,29 +3187,20 @@ void EmitPolymorphicArguments::emit(SubstitutionMap subs,
3204
3187
}
3205
3188
}
3206
3189
3207
- NecessaryBindings NecessaryBindings::forAsyncFunctionInvocation (
3208
- IRGenModule &IGM, CanSILFunctionType origType, SubstitutionMap subs) {
3209
- return computeBindings (IGM, origType, subs,
3210
- false /* forPartialApplyForwarder*/ );
3211
- }
3212
-
3213
3190
NecessaryBindings
3214
3191
NecessaryBindings::forPartialApplyForwarder (IRGenModule &IGM,
3215
3192
CanSILFunctionType origType,
3216
3193
SubstitutionMap subs,
3217
3194
bool considerParameterSources) {
3218
3195
return computeBindings (IGM, origType, subs,
3219
- true /* forPartialApplyForwarder*/ ,
3220
3196
considerParameterSources);
3221
3197
}
3222
3198
3223
3199
NecessaryBindings NecessaryBindings::computeBindings (
3224
3200
IRGenModule &IGM, CanSILFunctionType origType, SubstitutionMap subs,
3225
- bool forPartialApplyForwarder, bool considerParameterSources) {
3201
+ bool considerParameterSources) {
3226
3202
3227
3203
NecessaryBindings bindings;
3228
- bindings.kind =
3229
- forPartialApplyForwarder ? Kind::PartialApply : Kind::AsyncFunction;
3230
3204
3231
3205
// Bail out early if we don't have polymorphic parameters.
3232
3206
if (!hasPolymorphicParameters (origType))
@@ -3249,9 +3223,7 @@ NecessaryBindings NecessaryBindings::computeBindings(
3249
3223
case MetadataSource::Kind::SelfMetadata:
3250
3224
// Async functions pass the SelfMetadata and SelfWitnessTable parameters
3251
3225
// along explicitly.
3252
- if (forPartialApplyForwarder) {
3253
- bindings.addTypeMetadata (getSubstSelfType (IGM, origType, subs));
3254
- }
3226
+ bindings.addTypeMetadata (getSubstSelfType (IGM, origType, subs));
3255
3227
continue ;
3256
3228
3257
3229
case MetadataSource::Kind::SelfWitnessTable:
0 commit comments