@@ -418,7 +418,7 @@ class alignas(1 << DeclAlignInBits) Decl {
418
418
HasNestedTypeDeclarations : 1
419
419
);
420
420
421
- SWIFT_INLINE_BITFIELD (FuncDecl, AbstractFunctionDecl, 1 +1 +2 +1 +1 +2 +1 ,
421
+ SWIFT_INLINE_BITFIELD (FuncDecl, AbstractFunctionDecl, 1 +1 +2 +1 +1 +2 +1 + 1 + 1 ,
422
422
// / Whether we've computed the 'static' flag yet.
423
423
IsStaticComputed : 1 ,
424
424
@@ -437,21 +437,28 @@ class alignas(1 << DeclAlignInBits) Decl {
437
437
// / Backing bits for 'self' access kind.
438
438
SelfAccess : 2 ,
439
439
440
+ // / Whether we've computed the IsAsyncHandlerRequest.
441
+ IsAsyncHandlerComputed : 1 ,
442
+
443
+ // / The value of IsAsyncHandlerRequest.
444
+ IsAsyncHandler : 1 ,
445
+
440
446
// / Whether this is a top-level function which should be treated
441
447
// / as if it were in local context for the purposes of capture
442
448
// / analysis.
443
449
HasTopLevelLocalContextCaptures : 1
444
450
);
445
451
446
452
SWIFT_INLINE_BITFIELD (AccessorDecl, FuncDecl, 4 + 1 + 1 ,
447
- // / The kind of accessor this is.
448
- AccessorKind : 4 ,
453
+ // / The kind of accessor this is.
454
+ AccessorKind : 4 ,
449
455
450
- // / Whether the accessor is transparent.
451
- IsTransparent : 1 ,
456
+ // / Whether the accessor is transparent.
457
+ IsTransparent : 1 ,
452
458
453
- // / Whether we have computed the above.
454
- IsTransparentComputed : 1 );
459
+ // / Whether we have computed the above.
460
+ IsTransparentComputed : 1
461
+ );
455
462
456
463
SWIFT_INLINE_BITFIELD (ConstructorDecl, AbstractFunctionDecl, 1 +1 ,
457
464
// / Whether this constructor can fail, by building an Optional type.
@@ -5926,6 +5933,7 @@ class FuncDecl : public AbstractFunctionDecl {
5926
5933
friend class SelfAccessKindRequest ;
5927
5934
friend class IsStaticRequest ;
5928
5935
friend class ResultTypeRequest ;
5936
+ friend class IsAsyncHandlerRequest ;
5929
5937
5930
5938
SourceLoc StaticLoc; // Location of the 'static' token or invalid.
5931
5939
SourceLoc FuncLoc; // Location of the 'func' token.
@@ -5957,6 +5965,8 @@ class FuncDecl : public AbstractFunctionDecl {
5957
5965
Bits.FuncDecl .SelfAccessComputed = false ;
5958
5966
Bits.FuncDecl .IsStaticComputed = false ;
5959
5967
Bits.FuncDecl .IsStatic = false ;
5968
+ Bits.FuncDecl .IsAsyncHandlerComputed = false ;
5969
+ Bits.FuncDecl .IsAsyncHandler = false ;
5960
5970
Bits.FuncDecl .HasTopLevelLocalContextCaptures = false ;
5961
5971
}
5962
5972
@@ -5987,6 +5997,18 @@ class FuncDecl : public AbstractFunctionDecl {
5987
5997
return None;
5988
5998
}
5989
5999
6000
+ Optional<bool > getCachedIsAsyncHandler () const {
6001
+ if (Bits.FuncDecl .IsAsyncHandlerComputed )
6002
+ return Bits.FuncDecl .IsAsyncHandler ;
6003
+
6004
+ return None;
6005
+ }
6006
+
6007
+ void setIsAsyncHandler (bool value) {
6008
+ Bits.FuncDecl .IsAsyncHandlerComputed = true ;
6009
+ Bits.FuncDecl .IsAsyncHandler = value;
6010
+ }
6011
+
5990
6012
public:
5991
6013
// / Factory function only for use by deserialization.
5992
6014
static FuncDecl *createDeserialized (ASTContext &Context,
0 commit comments