@@ -412,7 +412,7 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated<Decl> {
412412 SWIFT_INLINE_BITFIELD (SubscriptDecl, VarDecl, 2 ,
413413 StaticSpelling : 2
414414 );
415- SWIFT_INLINE_BITFIELD (AbstractFunctionDecl, ValueDecl, 3 +2 +8 +1 +1 +1 +1 +1 +1 ,
415+ SWIFT_INLINE_BITFIELD (AbstractFunctionDecl, ValueDecl, 3 +2 +8 +1 +1 +1 +1 +1 +1 + 1 ,
416416 // / \see AbstractFunctionDecl::BodyKind
417417 BodyKind : 3 ,
418418
@@ -439,7 +439,11 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated<Decl> {
439439
440440 // / Whether peeking into this function detected nested type declarations.
441441 // / This is set when skipping over the decl at parsing.
442- HasNestedTypeDeclarations : 1
442+ HasNestedTypeDeclarations : 1 ,
443+
444+ // / Whether this function is a distributed thunk for a distributed
445+ // / function or computed property.
446+ DistributedThunk: 1
443447 );
444448
445449 SWIFT_INLINE_BITFIELD (FuncDecl, AbstractFunctionDecl, 1 +1 +2 +1 +1 +2 +1 ,
@@ -5119,6 +5123,13 @@ class AbstractStorageDecl : public ValueDecl {
51195123
51205124 bool hasAnyNativeDynamicAccessors () const ;
51215125
5126+ // / Does this have a 'distributed' modifier?
5127+ bool isDistributed () const ;
5128+
5129+ // / Return a distributed thunk if this computed property is marked as
5130+ // / 'distributed' and and nullptr otherwise.
5131+ FuncDecl *getDistributedThunk () const ;
5132+
51225133 // Implement isa/cast/dyncast/etc.
51235134 static bool classof (const Decl *D) {
51245135 return D->getKind () >= DeclKind::First_AbstractStorageDecl &&
@@ -5352,9 +5363,6 @@ class VarDecl : public AbstractStorageDecl {
53525363 // / Is this an "async let" property?
53535364 bool isAsyncLet () const ;
53545365
5355- // / Does this have a 'distributed' modifier?
5356- bool isDistributed () const ;
5357-
53585366 // / Is this var known to be a "local" distributed actor,
53595367 // / if so the implicit throwing ans some isolation checks can be skipped.
53605368 bool isKnownToBeLocal () const ;
@@ -6331,6 +6339,7 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
63316339 Bits.AbstractFunctionDecl .Throws = Throws;
63326340 Bits.AbstractFunctionDecl .HasSingleExpressionBody = false ;
63336341 Bits.AbstractFunctionDecl .HasNestedTypeDeclarations = false ;
6342+ Bits.AbstractFunctionDecl .DistributedThunk = false ;
63346343 }
63356344
63366345 void setBodyKind (BodyKind K) {
@@ -6429,6 +6438,16 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
64296438 // / Returns 'true' if the function is distributed.
64306439 bool isDistributed () const ;
64316440
6441+ // / Is this a thunk function used to access a distributed method
6442+ // / or computed property outside of its actor isolation context?
6443+ bool isDistributedThunk () const {
6444+ return Bits.AbstractFunctionDecl .DistributedThunk ;
6445+ }
6446+
6447+ void setDistributedThunk (bool isThunk) {
6448+ Bits.AbstractFunctionDecl .DistributedThunk = isThunk;
6449+ }
6450+
64326451 // / For a 'distributed' target (func or computed property),
64336452 // / get the 'thunk' responsible for performing the 'remoteCall'.
64346453 // /
0 commit comments