@@ -75,7 +75,7 @@ class DistributedAccessor {
7575 IRGenFunction &IGF;
7676
7777 // / Underlying distributed method for this accessor.
78- SILFunction *Method ;
78+ SILFunction *Target ;
7979
8080 // / The interface type of this accessor function.
8181 CanSILFunctionType AccessorType;
@@ -86,25 +86,25 @@ class DistributedAccessor {
8686 SmallVector<AllocationInfo, 4 > AllocatedArguments;
8787
8888public:
89- DistributedAccessor (IRGenFunction &IGF, SILFunction *method ,
89+ DistributedAccessor (IRGenFunction &IGF, SILFunction *target ,
9090 CanSILFunctionType accessorTy);
9191
9292 void emit ();
9393
9494private:
9595 void computeArguments (llvm::Value *argumentBuffer, Explosion &arguments);
9696
97- FunctionPointer getPointerToMethod () const ;
97+ FunctionPointer getPointerToTarget () const ;
9898
99- Callee getCalleeForDistributedMethod (llvm::Value *self) const ;
99+ Callee getCalleeForDistributedTarget (llvm::Value *self) const ;
100100};
101101
102102} // end namespace
103103
104104// / Compute a type of a distributed method accessor function based
105105// / on the provided distributed method.
106106static CanSILFunctionType getAccessorType (IRGenModule &IGM,
107- SILFunction *DistMethod ) {
107+ SILFunction *Target ) {
108108 auto &Context = IGM.Context ;
109109
110110 auto getRawPointerParmeter = [&]() {
@@ -120,10 +120,10 @@ static CanSILFunctionType getAccessorType(IRGenModule &IGM,
120120 .withAsync ()
121121 .build ();
122122
123- auto methodTy = DistMethod ->getLoweredFunctionType ();
123+ auto targetTy = Target ->getLoweredFunctionType ();
124124
125- assert (methodTy ->isAsync ());
126- assert (methodTy ->hasErrorResult ());
125+ assert (targetTy ->isAsync ());
126+ assert (targetTy ->hasErrorResult ());
127127
128128 // Accessor gets argument value buffer and a reference to `self` of
129129 // the actor and produces a call to the distributed thunk forwarding
@@ -133,18 +133,18 @@ static CanSILFunctionType getAccessorType(IRGenModule &IGM,
133133 ParameterConvention::Direct_Guaranteed,
134134 {/* argumentBuffer=*/ getRawPointerParmeter (),
135135 /* resultBuffer=*/ getRawPointerParmeter (),
136- /* actor=*/ methodTy ->getParameters ().back ()},
136+ /* actor=*/ targetTy ->getParameters ().back ()},
137137 /* Yields=*/ {},
138138 /* Results=*/ {},
139- /* ErrorResult=*/ methodTy ->getErrorResult (),
139+ /* ErrorResult=*/ targetTy ->getErrorResult (),
140140 /* patternSubs=*/ SubstitutionMap (),
141141 /* invocationSubs=*/ SubstitutionMap (), Context);
142142}
143143
144144llvm::Function *
145- IRGenModule::getAddrOfDistributedMethodAccessor (SILFunction *F,
145+ IRGenModule::getAddrOfDistributedTargetAccessor (SILFunction *F,
146146 ForDefinition_t forDefinition) {
147- auto entity = LinkEntity::forDistributedMethodAccessor (F);
147+ auto entity = LinkEntity::forDistributedTargetAccessor (F);
148148
149149 llvm::Function *&entry = GlobalFuncs[entity];
150150 if (entry) {
@@ -159,21 +159,21 @@ IRGenModule::getAddrOfDistributedMethodAccessor(SILFunction *F,
159159 return createFunction (*this , link, signature);
160160}
161161
162- void IRGenModule::emitDistributedMethodAccessor (SILFunction *method ) {
163- assert (method ->isDistributed ());
162+ void IRGenModule::emitDistributedTargetAccessor (SILFunction *target ) {
163+ assert (target ->isDistributed ());
164164
165- auto *f = getAddrOfDistributedMethodAccessor (method , ForDefinition);
165+ auto *f = getAddrOfDistributedTargetAccessor (target , ForDefinition);
166166 if (!f->isDeclaration ())
167167 return ;
168168
169169 IRGenFunction IGF (*this , f);
170- DistributedAccessor (IGF, method , getAccessorType (*this , method )).emit ();
170+ DistributedAccessor (IGF, target , getAccessorType (*this , target )).emit ();
171171}
172172
173173DistributedAccessor::DistributedAccessor (IRGenFunction &IGF,
174- SILFunction *method ,
174+ SILFunction *target ,
175175 CanSILFunctionType accessorTy)
176- : IGM(IGF.IGM), IGF(IGF), Method(method ), AccessorType(accessorTy),
176+ : IGM(IGF.IGM), IGF(IGF), Target(target ), AccessorType(accessorTy),
177177 AsyncLayout(getAsyncContextLayout(
178178 IGM, AccessorType, AccessorType, SubstitutionMap(),
179179 /* suppress generics*/ true,
@@ -182,7 +182,7 @@ DistributedAccessor::DistributedAccessor(IRGenFunction &IGF,
182182
183183void DistributedAccessor::computeArguments (llvm::Value *argumentBuffer,
184184 Explosion &arguments) {
185- auto fnType = Method ->getLoweredFunctionType ();
185+ auto fnType = Target ->getLoweredFunctionType ();
186186
187187 // Cover all of the arguments except to `self` of the actor.
188188 auto parameters = fnType->getParameters ().drop_back ();
@@ -283,8 +283,8 @@ void DistributedAccessor::computeArguments(llvm::Value *argumentBuffer,
283283}
284284
285285void DistributedAccessor::emit () {
286- auto methodTy = Method ->getLoweredFunctionType ();
287- SILFunctionConventions targetConv (methodTy , IGF.getSILModule ());
286+ auto targetTy = Target ->getLoweredFunctionType ();
287+ SILFunctionConventions targetConv (targetTy , IGF.getSILModule ());
288288 SILFunctionConventions accessorConv (AccessorType, IGF.getSILModule ());
289289 TypeExpansionContext expansionContext = IGM.getMaximalTypeExpansionContext ();
290290
@@ -306,7 +306,7 @@ void DistributedAccessor::emit() {
306306 // Reference to a `self` of the actor to be called.
307307 auto *actorSelf = params.claimNext ();
308308
309- GenericContextScope scope (IGM, methodTy ->getInvocationGenericSignature ());
309+ GenericContextScope scope (IGM, targetTy ->getInvocationGenericSignature ());
310310
311311 // Preliminary: Setup async context for this accessor.
312312 {
@@ -315,7 +315,7 @@ void DistributedAccessor::emit() {
315315 /* useSpecialConvention*/ false )
316316 .getAsyncContextIndex ();
317317
318- auto entity = LinkEntity::forDistributedMethodAccessor (Method );
318+ auto entity = LinkEntity::forDistributedTargetAccessor (Target );
319319 emitAsyncFunctionEntry (IGF, AsyncLayout, entity, asyncContextIdx);
320320 emitAsyncFunctionPointer (IGM, IGF.CurFn , entity, AsyncLayout.getSize ());
321321 }
@@ -341,7 +341,7 @@ void DistributedAccessor::emit() {
341341 Explosion result;
342342 Explosion error;
343343
344- auto callee = getCalleeForDistributedMethod (actorSelf);
344+ auto callee = getCalleeForDistributedTarget (actorSelf);
345345 auto emission =
346346 getCallEmission (IGF, callee.getSwiftContext (), std::move (callee));
347347
@@ -363,7 +363,7 @@ void DistributedAccessor::emit() {
363363 // Both accessor and distributed method are always `async throws`
364364 // so we need to load error value (if any) from the slot.
365365 {
366- assert (methodTy ->hasErrorResult ());
366+ assert (targetTy ->hasErrorResult ());
367367
368368 SILType errorType = accessorConv.getSILErrorType (expansionContext);
369369 Address calleeErrorSlot =
@@ -386,23 +386,23 @@ void DistributedAccessor::emit() {
386386 }
387387}
388388
389- FunctionPointer DistributedAccessor::getPointerToMethod () const {
390- auto fnType = Method ->getLoweredFunctionType ();
391- auto fpKind = classifyFunctionPointerKind (Method );
389+ FunctionPointer DistributedAccessor::getPointerToTarget () const {
390+ auto fnType = Target ->getLoweredFunctionType ();
391+ auto fpKind = classifyFunctionPointerKind (Target );
392392 auto signature = IGM.getSignature (fnType, fpKind.useSpecialConvention ());
393393
394394 auto *fnPtr =
395- llvm::ConstantExpr::getBitCast (IGM.getAddrOfAsyncFunctionPointer (Method ),
395+ llvm::ConstantExpr::getBitCast (IGM.getAddrOfAsyncFunctionPointer (Target ),
396396 signature.getType ()->getPointerTo ());
397397
398398 return FunctionPointer::forDirect (
399399 FunctionPointer::Kind (fnType), fnPtr,
400- IGM.getAddrOfSILFunction (Method , NotForDefinition), signature);
400+ IGM.getAddrOfSILFunction (Target , NotForDefinition), signature);
401401}
402402
403403Callee
404- DistributedAccessor::getCalleeForDistributedMethod (llvm::Value *self) const {
405- auto fnType = Method ->getLoweredFunctionType ();
404+ DistributedAccessor::getCalleeForDistributedTarget (llvm::Value *self) const {
405+ auto fnType = Target ->getLoweredFunctionType ();
406406 CalleeInfo info{fnType, fnType, SubstitutionMap ()};
407- return {std::move (info), getPointerToMethod (), self};
407+ return {std::move (info), getPointerToTarget (), self};
408408}
0 commit comments