@@ -418,7 +418,7 @@ class alignas(1 << DeclAlignInBits) Decl {
418418 HasNestedTypeDeclarations : 1
419419 );
420420
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 ,
422422 // / Whether we've computed the 'static' flag yet.
423423 IsStaticComputed : 1 ,
424424
@@ -437,21 +437,28 @@ class alignas(1 << DeclAlignInBits) Decl {
437437 // / Backing bits for 'self' access kind.
438438 SelfAccess : 2 ,
439439
440+ // / Whether we've computed the IsAsyncHandlerRequest.
441+ IsAsyncHandlerComputed : 1 ,
442+
443+ // / The value of IsAsyncHandlerRequest.
444+ IsAsyncHandler : 1 ,
445+
440446 // / Whether this is a top-level function which should be treated
441447 // / as if it were in local context for the purposes of capture
442448 // / analysis.
443449 HasTopLevelLocalContextCaptures : 1
444450 );
445451
446452 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 ,
449455
450- // / Whether the accessor is transparent.
451- IsTransparent : 1 ,
456+ // / Whether the accessor is transparent.
457+ IsTransparent : 1 ,
452458
453- // / Whether we have computed the above.
454- IsTransparentComputed : 1 );
459+ // / Whether we have computed the above.
460+ IsTransparentComputed : 1
461+ );
455462
456463 SWIFT_INLINE_BITFIELD (ConstructorDecl, AbstractFunctionDecl, 1 +1 ,
457464 // / Whether this constructor can fail, by building an Optional type.
@@ -5926,6 +5933,7 @@ class FuncDecl : public AbstractFunctionDecl {
59265933 friend class SelfAccessKindRequest ;
59275934 friend class IsStaticRequest ;
59285935 friend class ResultTypeRequest ;
5936+ friend class IsAsyncHandlerRequest ;
59295937
59305938 SourceLoc StaticLoc; // Location of the 'static' token or invalid.
59315939 SourceLoc FuncLoc; // Location of the 'func' token.
@@ -5957,6 +5965,8 @@ class FuncDecl : public AbstractFunctionDecl {
59575965 Bits.FuncDecl .SelfAccessComputed = false ;
59585966 Bits.FuncDecl .IsStaticComputed = false ;
59595967 Bits.FuncDecl .IsStatic = false ;
5968+ Bits.FuncDecl .IsAsyncHandlerComputed = false ;
5969+ Bits.FuncDecl .IsAsyncHandler = false ;
59605970 Bits.FuncDecl .HasTopLevelLocalContextCaptures = false ;
59615971 }
59625972
@@ -5987,6 +5997,18 @@ class FuncDecl : public AbstractFunctionDecl {
59875997 return None;
59885998 }
59895999
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+
59906012public:
59916013 // / Factory function only for use by deserialization.
59926014 static FuncDecl *createDeserialized (ASTContext &Context,
0 commit comments