@@ -124,6 +124,12 @@ enum class AccessSemantics : uint8_t {
124124 // / This is an ordinary access to a declaration, using whatever
125125 // / polymorphism is expected.
126126 Ordinary,
127+
128+ // / This is an access to the underlying storage through a distributed thunk.
129+ // /
130+ // / The declaration must be a 'distributed' computed property used outside
131+ // / of its actor isolation context.
132+ DistributedThunk,
127133};
128134
129135// / Expr - Base class for all expressions in swift.
@@ -155,11 +161,10 @@ class alignas(8) Expr : public ASTAllocated<Expr> {
155161
156162 SWIFT_INLINE_BITFIELD_EMPTY (LiteralExpr, Expr);
157163 SWIFT_INLINE_BITFIELD_EMPTY (IdentityExpr, Expr);
158- SWIFT_INLINE_BITFIELD (LookupExpr, Expr, 1 +1 +1 + 1 ,
164+ SWIFT_INLINE_BITFIELD (LookupExpr, Expr, 1 +1 +1 ,
159165 IsSuper : 1 ,
160166 IsImplicitlyAsync : 1 ,
161- IsImplicitlyThrows : 1 ,
162- ShouldApplyDistributedThunk: 1
167+ IsImplicitlyThrows : 1
163168 );
164169 SWIFT_INLINE_BITFIELD_EMPTY (DynamicLookupExpr, LookupExpr);
165170
@@ -1656,18 +1661,6 @@ class LookupExpr : public Expr {
16561661 Bits.LookupExpr .IsImplicitlyThrows = isImplicitlyThrows;
16571662 }
16581663
1659- // / Informs IRGen to that this expression should be applied as its distributed
1660- // / thunk, rather than invoking the function directly.
1661- // /
1662- // / Only intended to be set on distributed get-only computed properties.
1663- bool shouldApplyLookupDistributedThunk () const {
1664- return Bits.LookupExpr .ShouldApplyDistributedThunk ;
1665- }
1666-
1667- void setShouldApplyLookupDistributedThunk (bool flag) {
1668- Bits.LookupExpr .ShouldApplyDistributedThunk = flag;
1669- }
1670-
16711664 static bool classof (const Expr *E) {
16721665 return E->getKind () >= ExprKind::First_LookupExpr &&
16731666 E->getKind () <= ExprKind::Last_LookupExpr;
@@ -1697,6 +1690,14 @@ class MemberRefExpr : public LookupExpr {
16971690 return (AccessSemantics) Bits.MemberRefExpr .Semantics ;
16981691 }
16991692
1693+ // / Informs IRGen to that this member should be applied via its distributed
1694+ // / thunk, rather than invoking it directly.
1695+ // /
1696+ // / Only intended to be set on distributed get-only computed properties.
1697+ void setAccessViaDistributedThunk () {
1698+ Bits.MemberRefExpr .Semantics = (unsigned )AccessSemantics::DistributedThunk;
1699+ }
1700+
17001701 SourceLoc getLoc () const { return NameLoc.getBaseNameLoc (); }
17011702 SourceLoc getStartLoc () const {
17021703 SourceLoc BaseStartLoc = getBase ()->getStartLoc ();
0 commit comments