@@ -364,12 +364,21 @@ class alignas(1 << DeclAlignInBits) Decl {
364
364
unsigned DefaultArgumentResilienceExpansion : 1 ;
365
365
BITFIELD_END;
366
366
367
- BITFIELD_START (FuncDecl, AbstractFunctionDecl, 3 );
367
+ BITFIELD_START (FuncDecl, AbstractFunctionDecl, 7 );
368
368
// / Whether this function is a 'static' method.
369
369
unsigned IsStatic : 1 ;
370
370
371
371
// / \brief Whether 'static' or 'class' was used.
372
372
unsigned StaticSpelling : 2 ;
373
+
374
+ // / Whether we are statically dispatched even if overridable
375
+ unsigned ForcedStaticDispatch : 1 ;
376
+
377
+ // / Whether this function has a dynamic Self return type.
378
+ unsigned HasDynamicSelf : 1 ;
379
+
380
+ // / Backing bits for 'self' access kind.
381
+ unsigned SelfAccess : 2 ;
373
382
BITFIELD_END;
374
383
375
384
BITFIELD_START (ConstructorDecl, AbstractFunctionDecl, 8 );
@@ -5157,15 +5166,6 @@ class FuncDecl final : public AbstractFunctionDecl,
5157
5166
5158
5167
TypeLoc FnRetType;
5159
5168
5160
- // / Whether we are statically dispatched even if overridable
5161
- unsigned ForcedStaticDispatch : 1 ;
5162
-
5163
- // / Whether this function has a dynamic Self return type.
5164
- unsigned HasDynamicSelf : 1 ;
5165
-
5166
- // / Backing bits for 'self' access kind.
5167
- unsigned SelfAccess : 2 ;
5168
-
5169
5169
// / \brief If this FuncDecl is an accessor for a property, this indicates
5170
5170
// / which property and what kind of accessor.
5171
5171
llvm::PointerIntPair<AbstractStorageDecl*, 3 , AccessorKind> AccessorDecl;
@@ -5194,9 +5194,9 @@ class FuncDecl final : public AbstractFunctionDecl,
5194
5194
FuncDeclBits.StaticSpelling = static_cast <unsigned >(StaticSpelling);
5195
5195
assert (NumParameterLists > 0 && " Must have at least an empty tuple arg" );
5196
5196
5197
- HasDynamicSelf = false ;
5198
- ForcedStaticDispatch = false ;
5199
- SelfAccess = static_cast <unsigned >(SelfAccessKind::NonMutating);
5197
+ FuncDeclBits. HasDynamicSelf = false ;
5198
+ FuncDeclBits. ForcedStaticDispatch = false ;
5199
+ FuncDeclBits. SelfAccess = static_cast <unsigned >(SelfAccessKind::NonMutating);
5200
5200
}
5201
5201
5202
5202
static FuncDecl *createImpl (ASTContext &Context, SourceLoc StaticLoc,
@@ -5263,10 +5263,10 @@ class FuncDecl final : public AbstractFunctionDecl,
5263
5263
}
5264
5264
5265
5265
SelfAccessKind getSelfAccessKind () const {
5266
- return static_cast <SelfAccessKind>(SelfAccess);
5266
+ return static_cast <SelfAccessKind>(FuncDeclBits. SelfAccess );
5267
5267
}
5268
5268
void setSelfAccessKind (SelfAccessKind mod) {
5269
- SelfAccess = static_cast <unsigned >(mod);
5269
+ FuncDeclBits. SelfAccess = static_cast <unsigned >(mod);
5270
5270
}
5271
5271
5272
5272
// / \brief Returns the parameter lists(s) for the function definition.
@@ -5374,11 +5374,11 @@ class FuncDecl final : public AbstractFunctionDecl,
5374
5374
5375
5375
// / Determine whether this function has a dynamic \c Self return
5376
5376
// / type.
5377
- bool hasDynamicSelf () const { return HasDynamicSelf; }
5377
+ bool hasDynamicSelf () const { return FuncDeclBits. HasDynamicSelf ; }
5378
5378
5379
5379
// / Set whether this function has a dynamic \c Self return or not.
5380
5380
void setDynamicSelf (bool hasDynamicSelf) {
5381
- HasDynamicSelf = hasDynamicSelf;
5381
+ FuncDeclBits. HasDynamicSelf = hasDynamicSelf;
5382
5382
}
5383
5383
5384
5384
void getLocalCaptures (SmallVectorImpl<CapturedValue> &Result) const {
@@ -5427,10 +5427,10 @@ class FuncDecl final : public AbstractFunctionDecl,
5427
5427
5428
5428
// / Returns true if the function is forced to be statically dispatched.
5429
5429
bool hasForcedStaticDispatch () const {
5430
- return ForcedStaticDispatch;
5430
+ return FuncDeclBits. ForcedStaticDispatch ;
5431
5431
}
5432
5432
void setForcedStaticDispatch (bool flag) {
5433
- ForcedStaticDispatch = flag;
5433
+ FuncDeclBits. ForcedStaticDispatch = flag;
5434
5434
}
5435
5435
5436
5436
static bool classof (const Decl *D) { return D->getKind () == DeclKind::Func; }
0 commit comments