@@ -5265,78 +5265,6 @@ RValue SILGenFunction::emitApplyAllocatingInitializer(SILLocation loc,
5265
5265
return result;
5266
5266
}
5267
5267
5268
- // / Emit an application of the given method.
5269
- RValue SILGenFunction::emitApplyMethod (SILLocation loc, ConcreteDeclRef declRef,
5270
- ArgumentSource &&self,
5271
- PreparedArguments &&args, SGFContext C) {
5272
- auto *call = cast<AbstractFunctionDecl>(declRef.getDecl ());
5273
-
5274
- // Form the reference to the method.
5275
- auto callRef = SILDeclRef (call, SILDeclRef::Kind::Func)
5276
- .asForeign (requiresForeignEntryPoint (declRef.getDecl ()));
5277
-
5278
- if (auto distributedThunk = call->getDistributedThunk ()) {
5279
- callRef = SILDeclRef (distributedThunk).asDistributed ();
5280
- } else if (call->isBackDeployed ()) {
5281
- callRef =
5282
- callRef.asBackDeploymentKind (SILDeclRef::BackDeploymentKind::Thunk);
5283
- }
5284
-
5285
- auto declRefConstant = getConstantInfo (getTypeExpansionContext (), callRef);
5286
- auto subs = declRef.getSubstitutions ();
5287
- bool throws = false ;
5288
- bool markedAsRethrows = call->getAttrs ().hasAttribute <swift::RethrowsAttr>();
5289
- PolymorphicEffectKind rethrowingKind =
5290
- call->getPolymorphicEffectKind (EffectKind::Throws);
5291
- if (rethrowingKind == PolymorphicEffectKind::ByConformance) {
5292
- for (auto conformanceRef : subs.getConformances ()) {
5293
- if (conformanceRef.hasEffect (EffectKind::Throws)) {
5294
- throws = true ;
5295
- break ;
5296
- }
5297
- }
5298
- } else if (markedAsRethrows &&
5299
- rethrowingKind == PolymorphicEffectKind::Always) {
5300
- throws = true ;
5301
- }
5302
-
5303
- // Scope any further writeback just within this operation.
5304
- FormalEvaluationScope writebackScope (*this );
5305
-
5306
- // Form the metatype argument.
5307
- ManagedValue selfMetaVal;
5308
- SILType selfMetaTy;
5309
- {
5310
- // Determine the self metatype type.
5311
- CanSILFunctionType substFnType =
5312
- declRefConstant.SILFnType ->substGenericArgs (SGM.M , subs,
5313
- getTypeExpansionContext ());
5314
- SILType selfParamMetaTy =
5315
- getSILType (substFnType->getSelfParameter (), substFnType);
5316
- selfMetaTy = selfParamMetaTy;
5317
- }
5318
-
5319
- // Form the callee.
5320
- Optional<Callee> callee;
5321
- if (isa<ProtocolDecl>(call->getDeclContext ())) {
5322
- callee.emplace (Callee::forWitnessMethod (*this , selfMetaTy.getASTType (),
5323
- callRef, subs, loc));
5324
- } else if (getMethodDispatch (call) == MethodDispatch::Class) {
5325
- callee.emplace (Callee::forClassMethod (*this , callRef, subs, loc));
5326
- } else {
5327
- callee.emplace (Callee::forDirect (*this , callRef, subs, loc));
5328
- }
5329
-
5330
- auto substFormalType = callee->getSubstFormalType ();
5331
-
5332
- // Form the call emission.
5333
- CallEmission emission (*this , std::move (*callee), std::move (writebackScope));
5334
- emission.addSelfParam (loc, std::move (self), substFormalType.getParams ()[0 ]);
5335
- emission.addCallSite (loc, std::move (args), !throws);
5336
-
5337
- return emission.apply (C);
5338
- }
5339
-
5340
5268
RValue SILGenFunction::emitApplyOfPropertyWrapperBackingInitializer (
5341
5269
SILLocation loc,
5342
5270
VarDecl *var,
0 commit comments