@@ -31,6 +31,16 @@ class DeclContext;
3131class FuncDecl ;
3232class NominalTypeDecl ;
3333
34+ Type getAssociatedTypeOfDistributedSystemOfActor (DeclContext *actorOrExtension,
35+ Identifier member);
36+
37+ // / Find the concrete invocation decoder associated with the given actor.
38+ NominalTypeDecl *getDistributedActorInvocationDecoder (NominalTypeDecl *);
39+
40+ // / Find `decodeNextArgument<T>(type: T.Type) -> T` method associated with
41+ // / invocation decoder of the given distributed actor.
42+ FuncDecl *getDistributedActorArgumentDecodingMethod (NominalTypeDecl *);
43+
3444// / Determine the concrete type of 'ActorSystem' as seen from the member.
3545// / E.g. when in a protocol, and trying to determine what the actor system was
3646// / constrained to.
@@ -47,12 +57,6 @@ Type getDistributedActorSystemType(NominalTypeDecl *actor);
4757// / Determine the `ID` type for the given actor.
4858Type getDistributedActorIDType (NominalTypeDecl *actor);
4959
50- // / Similar to `getDistributedSerializationRequirementType`, however, from the
51- // / perspective of a concrete function. This way we're able to get the
52- // / serialization requirement for specific members, also in protocols.
53- Type getSerializationRequirementTypesForMember (
54- ValueDecl *member, llvm::SmallPtrSet<ProtocolDecl *, 2 > &serializationRequirements);
55-
5660// / Get specific 'SerializationRequirement' as defined in 'nominal'
5761// / type, which must conform to the passed 'protocol' which is expected
5862// / to require the 'SerializationRequirement'.
@@ -66,6 +70,12 @@ AbstractFunctionDecl *
6670getAssociatedDistributedInvocationDecoderDecodeNextArgumentFunction (
6771 ValueDecl *thunk);
6872
73+ Type getDistributedActorSerializationType (DeclContext *actorOrExtension);
74+
75+ // / Get the specific 'SerializationRequirement' type of a specific distributed
76+ // / actor system.
77+ Type getDistributedActorSystemSerializationType (NominalTypeDecl *system);
78+
6979// / Get the specific 'InvocationEncoder' type of a specific distributed actor
7080// / system.
7181Type getDistributedActorSystemInvocationEncoderType (NominalTypeDecl *system);
@@ -81,17 +91,6 @@ Type getDistributedActorSystemResultHandlerType(NominalTypeDecl *system);
8191// / Get the 'ActorID' type of a specific distributed actor system.
8292Type getDistributedActorSystemActorIDType (NominalTypeDecl *system);
8393
84- // / Get the specific protocols that the `SerializationRequirement` specifies,
85- // / and all parameters / return types of distributed targets must conform to.
86- // /
87- // / E.g. if a system declares `typealias SerializationRequirement = Codable`
88- // / then this will return `{encodableProtocol, decodableProtocol}`.
89- // /
90- // / Returns an empty set if the requirement was `Any`.
91- llvm::SmallPtrSet<ProtocolDecl *, 2 >
92- getDistributedSerializationRequirementProtocols (
93- NominalTypeDecl *decl, ProtocolDecl* protocol);
94-
9594// / Check if the `allRequirements` represent *exactly* the
9695// / `Encodable & Decodable` (also known as `Codable`) requirement.
9796// /
@@ -115,6 +114,70 @@ getDistributedSerializationRequirements(
115114 ProtocolDecl *protocol,
116115 llvm::SmallPtrSetImpl<ProtocolDecl *> &requirementProtos);
117116
117+ // / Retrieve the declaration of DistributedActorSystem.remoteCall(Void)(...).
118+ // /
119+ // / \param actorOrSystem distributed actor or actor system to get the
120+ // / remoteCall function for. Since the method we're looking for is an ad-hoc
121+ // / requirement, a specific type MUST be passed here as it is not possible
122+ // / to obtain the decl from just the `DistributedActorSystem` protocol type.
123+ // / \param isVoidReturn true if the call will be returning `Void`.
124+ AbstractFunctionDecl *
125+ getRemoteCallOnDistributedActorSystem (NominalTypeDecl *actorOrSystem,
126+ bool isVoidReturn);
127+
128+ // / Retrieve the declaration of DistributedActorSystem.make().
129+ // /
130+ // / \param thunk the function from which we'll be invoking things on the
131+ // / obtained actor system; This way we'll always get the right type, taking care
132+ // / of any where clauses etc.
133+ FuncDecl *
134+ getMakeInvocationEncoderOnDistributedActorSystem (AbstractFunctionDecl *thunk);
135+
136+ // Retrieve the declaration of
137+ // DistributedInvocationEncoder.recordGenericSubstitution(_:).
138+ //
139+ // \param nominal optionally provide a 'NominalTypeDecl' from which the
140+ // function decl shall be extracted. This is useful to avoid witness calls
141+ // through the protocol which is looked up when nominal is null.
142+ FuncDecl *getRecordGenericSubstitutionOnDistributedInvocationEncoder (
143+ NominalTypeDecl *nominal);
144+
145+ // Retrieve the declaration of
146+ // DistributedTargetInvocationEncoder.recordArgument(_:).
147+ //
148+ // \param nominal optionally provide a 'NominalTypeDecl' from which the
149+ // function decl shall be extracted. This is useful to avoid witness calls
150+ // through the protocol which is looked up when nominal is null.
151+ AbstractFunctionDecl *
152+ getRecordArgumentOnDistributedInvocationEncoder (NominalTypeDecl *nominal);
153+
154+ // Retrieve the declaration of
155+ // DistributedTargetInvocationEncoder.recordReturnType(_:).
156+ AbstractFunctionDecl *
157+ getRecordReturnTypeOnDistributedInvocationEncoder (NominalTypeDecl *nominal);
158+
159+ // Retrieve the declaration of
160+ // DistributedTargetInvocationEncoder.recordErrorType(_:).
161+ AbstractFunctionDecl *
162+ getRecordErrorTypeOnDistributedInvocationEncoder (NominalTypeDecl *nominal);
163+
164+ // Retrieve the declaration of
165+ // DistributedTargetInvocationDecoder.getDecodeNextArgumentOnDistributedInvocationDecoder(_:).
166+ AbstractFunctionDecl *
167+ getDecodeNextArgumentOnDistributedInvocationDecoder (NominalTypeDecl *nominal);
168+
169+ // Retrieve the declaration of
170+ // getOnReturnOnDistributedTargetInvocationResultHandler.onReturn(_:).
171+ AbstractFunctionDecl *
172+ getOnReturnOnDistributedTargetInvocationResultHandler (NominalTypeDecl *nominal);
173+
174+ // Retrieve the declaration of DistributedInvocationEncoder.doneRecording().
175+ //
176+ // \param nominal optionally provide a 'NominalTypeDecl' from which the
177+ // function decl shall be extracted. This is useful to avoid witness calls
178+ // through the protocol which is looked up when nominal is null.
179+ FuncDecl *
180+ getDoneRecordingOnDistributedInvocationEncoder (NominalTypeDecl *nominal);
118181}
119182
120183#endif /* SWIFT_DECL_DISTRIBUTEDDECL_H */
0 commit comments