@@ -332,6 +332,18 @@ class alignas(1 << DeclAlignInBits) Decl {
332
332
unsigned IsDebuggerVar : 1 ;
333
333
BITFIELD_END;
334
334
335
+ BITFIELD_START (ParamDecl, VarDecl, 1 + NumDefaultArgumentKindBits);
336
+ // / True if the type is implicitly specified in the source, but this has an
337
+ // / apparently valid typeRepr. This is used in accessors, which look like:
338
+ // / set (value) {
339
+ // / but need to get the typeRepr from the property as a whole so Sema can
340
+ // / resolve the type.
341
+ unsigned IsTypeLocImplicit : 1 ;
342
+
343
+ // / Information about a symbolic default argument, like #file.
344
+ unsigned defaultArgumentKind : NumDefaultArgumentKindBits;
345
+ BITFIELD_END;
346
+
335
347
BITFIELD_START (EnumElementDecl, ValueDecl, 3 );
336
348
// / \brief Whether or not this element directly or indirectly references
337
349
// / the enum type.
@@ -553,6 +565,7 @@ class alignas(1 << DeclAlignInBits) Decl {
553
565
AbstractStorageDeclBitfields AbstractStorageDeclBits;
554
566
AbstractFunctionDeclBitfields AbstractFunctionDeclBits;
555
567
VarDeclBitfields VarDeclBits;
568
+ ParamDeclBitfields ParamDeclBits;
556
569
EnumElementDeclBitfields EnumElementDeclBits;
557
570
FuncDeclBitfields FuncDeclBits;
558
571
ConstructorDeclBitfields ConstructorDeclBits;
@@ -4570,16 +4583,6 @@ class ParamDecl : public VarDecl {
4570
4583
// / The default value, if any, along with whether this is varargs.
4571
4584
llvm::PointerIntPair<StoredDefaultArgument *, 1 > DefaultValueAndIsVariadic;
4572
4585
4573
- // / True if the type is implicitly specified in the source, but this has an
4574
- // / apparently valid typeRepr. This is used in accessors, which look like:
4575
- // / set (value) {
4576
- // / but need to get the typeRepr from the property as a whole so Sema can
4577
- // / resolve the type.
4578
- bool IsTypeLocImplicit = false ;
4579
-
4580
- // / Information about a symbolic default argument, like #file.
4581
- DefaultArgumentKind defaultArgumentKind = DefaultArgumentKind::None;
4582
-
4583
4586
public:
4584
4587
ParamDecl (VarDecl::Specifier specifier,
4585
4588
SourceLoc specifierLoc, SourceLoc argumentNameLoc,
@@ -4606,17 +4609,17 @@ class ParamDecl : public VarDecl {
4606
4609
4607
4610
SourceLoc getSpecifierLoc () const { return SpecifierLoc; }
4608
4611
4609
- bool isTypeLocImplicit () const { return IsTypeLocImplicit; }
4610
- void setIsTypeLocImplicit (bool val) { IsTypeLocImplicit = val; }
4612
+ bool isTypeLocImplicit () const { return ParamDeclBits. IsTypeLocImplicit ; }
4613
+ void setIsTypeLocImplicit (bool val) { ParamDeclBits. IsTypeLocImplicit = val; }
4611
4614
4612
- bool isDefaultArgument () const {
4613
- return defaultArgumentKind != DefaultArgumentKind::None;
4614
- }
4615
4615
DefaultArgumentKind getDefaultArgumentKind () const {
4616
- return defaultArgumentKind;
4616
+ return static_cast <DefaultArgumentKind>(ParamDeclBits.defaultArgumentKind );
4617
+ }
4618
+ bool isDefaultArgument () const {
4619
+ return getDefaultArgumentKind () != DefaultArgumentKind::None;
4617
4620
}
4618
4621
void setDefaultArgumentKind (DefaultArgumentKind K) {
4619
- defaultArgumentKind = K ;
4622
+ ParamDeclBits. defaultArgumentKind = static_cast < unsigned >(K) ;
4620
4623
}
4621
4624
4622
4625
Expr *getDefaultValue () const {
0 commit comments