@@ -3683,12 +3683,6 @@ class ClosureExpr : public AbstractClosureExpr {
3683
3683
SeparatelyTypeChecked,
3684
3684
};
3685
3685
3686
- // / Bits used to indicate contextual information that is concurrency-specific.
3687
- enum UnsafeConcurrencyBits {
3688
- Sendable = 1 << 0 ,
3689
- MainActor = 1 << 1
3690
- };
3691
-
3692
3686
private:
3693
3687
// / The attributes attached to the closure.
3694
3688
DeclAttributes Attributes;
@@ -3703,10 +3697,7 @@ class ClosureExpr : public AbstractClosureExpr {
3703
3697
// / the CaptureListExpr which would normally maintain this sort of
3704
3698
// / information about captured variables), we need to have some way to access
3705
3699
// / this information directly on the ClosureExpr.
3706
- // /
3707
- // / The integer indicates how the closure is contextually concurrent.
3708
- llvm::PointerIntPair<VarDecl *, 2 , uint8_t >
3709
- CapturedSelfDeclAndUnsafeConcurrent;
3700
+ VarDecl *CapturedSelfDecl;
3710
3701
3711
3702
// / The location of the "async", if present.
3712
3703
SourceLoc AsyncLoc;
@@ -3736,7 +3727,7 @@ class ClosureExpr : public AbstractClosureExpr {
3736
3727
: AbstractClosureExpr(ExprKind::Closure, Type(), /* Implicit=*/ false ,
3737
3728
discriminator, parent),
3738
3729
Attributes (attributes), BracketRange(bracketRange),
3739
- CapturedSelfDeclAndUnsafeConcurrent (capturedSelfDecl, 0 ),
3730
+ CapturedSelfDecl (capturedSelfDecl),
3740
3731
AsyncLoc(asyncLoc), ThrowsLoc(throwsLoc), ArrowLoc(arrowLoc),
3741
3732
InLoc(inLoc),
3742
3733
ExplicitResultTypeAndBodyState(explicitResultType, BodyState::Parsed),
@@ -3864,27 +3855,7 @@ class ClosureExpr : public AbstractClosureExpr {
3864
3855
3865
3856
// / VarDecl captured by this closure under the literal name \c self , if any.
3866
3857
VarDecl *getCapturedSelfDecl () const {
3867
- return CapturedSelfDeclAndUnsafeConcurrent.getPointer ();
3868
- }
3869
-
3870
- bool isUnsafeSendable () const {
3871
- return CapturedSelfDeclAndUnsafeConcurrent.getInt () &
3872
- UnsafeConcurrencyBits::Sendable;
3873
- }
3874
-
3875
- bool isUnsafeMainActor () const {
3876
- return CapturedSelfDeclAndUnsafeConcurrent.getInt () &
3877
- UnsafeConcurrencyBits::MainActor;
3878
- }
3879
-
3880
- void setUnsafeConcurrent (bool sendable, bool forMainActor) {
3881
- uint8_t bits = 0 ;
3882
- if (sendable)
3883
- bits |= UnsafeConcurrencyBits::Sendable;
3884
- if (forMainActor)
3885
- bits |= UnsafeConcurrencyBits::MainActor;
3886
-
3887
- CapturedSelfDeclAndUnsafeConcurrent.setInt (bits);
3858
+ return CapturedSelfDecl;
3888
3859
}
3889
3860
3890
3861
// / Get the type checking state of this closure's body.
0 commit comments