Skip to content

Commit 82410c6

Browse files
authored
Merge pull request #41082 from xedin/dist-decode-in-accessor
[Distributed] Augment accessor to be able to decode arguments instead of accepting buffer
2 parents d6f6edf + 35e639f commit 82410c6

File tree

42 files changed

+919
-1042
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+919
-1042
lines changed

include/swift/AST/ASTContext.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,14 @@ class ASTContext final {
13451345
/// alternative specified via the -entry-point-function-name frontend flag.
13461346
std::string getEntryPointFunctionName() const;
13471347

1348+
/// Find the concrete invocation decoder associated with the given actor.
1349+
NominalTypeDecl *
1350+
getDistributedActorInvocationDecoder(NominalTypeDecl *);
1351+
1352+
/// Find `decodeNextArgument<T>(type: T.Type) -> T` method associated with
1353+
/// invocation decoder of the given distributed actor.
1354+
FuncDecl *getDistributedActorArgumentDecodingMethod(NominalTypeDecl *);
1355+
13481356
private:
13491357
friend Decl;
13501358

include/swift/AST/KnownIdentifiers.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ IDENTIFIER(system)
289289
IDENTIFIER(target)
290290
IDENTIFIER(throwing)
291291
IDENTIFIER(using)
292+
IDENTIFIER(InvocationDecoder)
292293
IDENTIFIER(whenLocal)
294+
IDENTIFIER(decodeNextArgument)
293295

294296
#undef IDENTIFIER
295297
#undef IDENTIFIER_

include/swift/AST/TypeCheckRequests.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,43 @@ class GetDistributedActorIDPropertyRequest :
10911091
bool isCached() const { return true; }
10921092
};
10931093

1094+
/// Obtain the invocation decoder associated with the given distributed actor.
1095+
class GetDistributedActorInvocationDecoderRequest :
1096+
public SimpleRequest<GetDistributedActorInvocationDecoderRequest,
1097+
NominalTypeDecl *(NominalTypeDecl *),
1098+
RequestFlags::Cached> {
1099+
public:
1100+
using SimpleRequest::SimpleRequest;
1101+
1102+
private:
1103+
friend SimpleRequest;
1104+
1105+
NominalTypeDecl *evaluate(Evaluator &evaluator, NominalTypeDecl *actor) const;
1106+
1107+
public:
1108+
// Caching
1109+
bool isCached() const { return true; }
1110+
};
1111+
1112+
/// Obtain the method that could be used to decode argument values passed
1113+
/// to a particular actor invocation type.
1114+
class GetDistributedActorArgumentDecodingMethodRequest :
1115+
public SimpleRequest<GetDistributedActorArgumentDecodingMethodRequest,
1116+
FuncDecl *(NominalTypeDecl *),
1117+
RequestFlags::Cached> {
1118+
public:
1119+
using SimpleRequest::SimpleRequest;
1120+
1121+
private:
1122+
friend SimpleRequest;
1123+
1124+
FuncDecl *evaluate(Evaluator &evaluator, NominalTypeDecl *actor) const;
1125+
1126+
public:
1127+
// Caching
1128+
bool isCached() const { return true; }
1129+
};
1130+
10941131
/// Retrieve the static "shared" property within a global actor that provides
10951132
/// the actor instance representing the global actor.
10961133
///

include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ SWIFT_REQUEST(TypeChecker, GetDistributedActorIDPropertyRequest, VarDecl *(Nomin
112112
Cached, NoLocationInfo)
113113
SWIFT_REQUEST(TypeChecker, GetDistributedActorSystemPropertyRequest, VarDecl *(NominalTypeDecl *),
114114
Cached, NoLocationInfo)
115+
SWIFT_REQUEST(TypeChecker, GetDistributedActorInvocationDecoderRequest,
116+
NominalTypeDecl *(NominalTypeDecl *),
117+
Cached, NoLocationInfo)
118+
SWIFT_REQUEST(TypeChecker, GetDistributedActorArgumentDecodingMethodRequest,
119+
FuncDecl *(NominalTypeDecl *),
120+
Cache, NoLocationInfo)
115121
SWIFT_REQUEST(TypeChecker, GlobalActorInstanceRequest,
116122
VarDecl *(NominalTypeDecl *),
117123
Cached, NoLocationInfo)

0 commit comments

Comments
 (0)