@@ -283,6 +283,13 @@ class alignas(1 << DeclAlignInBits) Decl {
283
283
unsigned NumPatternEntries : 16 ;
284
284
BITFIELD_END;
285
285
286
+ BITFIELD_START (EnumCaseDecl, Decl, 51 );
287
+ unsigned : 19 ; // unused / padding
288
+
289
+ // / The number of tail-allocated element pointers.
290
+ unsigned NumElements : 32 ;
291
+ BITFIELD_END;
292
+
286
293
BITFIELD_START (ValueDecl, Decl, 3 );
287
294
friend class MemberLookupTable ;
288
295
@@ -597,6 +604,7 @@ class alignas(1 << DeclAlignInBits) Decl {
597
604
union {
598
605
DeclBitfields DeclBits;
599
606
PatternBindingDeclBitfields PatternBindingDeclBits;
607
+ EnumCaseDeclBitfields EnumCaseDeclBits;
600
608
ValueDeclBitfields ValueDeclBits;
601
609
AbstractStorageDeclBitfields AbstractStorageDeclBits;
602
610
AbstractFunctionDeclBitfields AbstractFunctionDeclBits;
@@ -5504,15 +5512,13 @@ class EnumCaseDecl final : public Decl,
5504
5512
friend TrailingObjects;
5505
5513
SourceLoc CaseLoc;
5506
5514
5507
- // / The number of tail-allocated element pointers.
5508
- unsigned NumElements;
5509
-
5510
5515
EnumCaseDecl (SourceLoc CaseLoc,
5511
5516
ArrayRef<EnumElementDecl *> Elements,
5512
5517
DeclContext *DC)
5513
5518
: Decl(DeclKind::EnumCase, DC),
5514
- CaseLoc (CaseLoc), NumElements(Elements.size())
5519
+ CaseLoc (CaseLoc)
5515
5520
{
5521
+ EnumCaseDeclBits.NumElements = Elements.size ();
5516
5522
std::uninitialized_copy (Elements.begin (), Elements.end (),
5517
5523
getTrailingObjects<EnumElementDecl *>());
5518
5524
}
@@ -5524,7 +5530,8 @@ class EnumCaseDecl final : public Decl,
5524
5530
5525
5531
// / Get the list of elements declared in this case.
5526
5532
ArrayRef<EnumElementDecl *> getElements () const {
5527
- return {getTrailingObjects<EnumElementDecl *>(), NumElements};
5533
+ return {getTrailingObjects<EnumElementDecl *>(),
5534
+ EnumCaseDeclBits.NumElements };
5528
5535
}
5529
5536
5530
5537
SourceLoc getLoc () const {
0 commit comments