@@ -1515,16 +1515,14 @@ class DeclContext {
1515
1515
uint64_t IsThisDeclarationADemotedDefinition : 1 ;
1516
1516
};
1517
1517
1518
- // / Number of non-inherited bits in TagDeclBitfields.
1519
- enum { NumTagDeclBits = 10 };
1518
+ // / Number of inherited and non-inherited bits in TagDeclBitfields.
1519
+ enum { NumTagDeclBits = NumDeclContextBits + 10 };
1520
1520
1521
1521
// / Stores the bits used by EnumDecl.
1522
1522
// / If modified NumEnumDeclBit and the accessor
1523
1523
// / methods in EnumDecl should be updated appropriately.
1524
1524
class EnumDeclBitfields {
1525
1525
friend class EnumDecl ;
1526
- // / For the bits in DeclContextBitfields.
1527
- uint64_t : NumDeclContextBits;
1528
1526
// / For the bits in TagDeclBitfields.
1529
1527
uint64_t : NumTagDeclBits;
1530
1528
@@ -1554,16 +1552,14 @@ class DeclContext {
1554
1552
uint64_t HasODRHash : 1 ;
1555
1553
};
1556
1554
1557
- // / Number of non-inherited bits in EnumDeclBitfields.
1558
- enum { NumEnumDeclBits = 20 };
1555
+ // / Number of inherited and non-inherited bits in EnumDeclBitfields.
1556
+ enum { NumEnumDeclBits = NumTagDeclBits + 20 };
1559
1557
1560
1558
// / Stores the bits used by RecordDecl.
1561
1559
// / If modified NumRecordDeclBits and the accessor
1562
1560
// / methods in RecordDecl should be updated appropriately.
1563
1561
class RecordDeclBitfields {
1564
1562
friend class RecordDecl ;
1565
- // / For the bits in DeclContextBitfields.
1566
- uint64_t : NumDeclContextBits;
1567
1563
// / For the bits in TagDeclBitfields.
1568
1564
uint64_t : NumTagDeclBits;
1569
1565
@@ -1615,8 +1611,8 @@ class DeclContext {
1615
1611
uint64_t ODRHash : 26 ;
1616
1612
};
1617
1613
1618
- // / Number of non-inherited bits in RecordDeclBitfields.
1619
- enum { NumRecordDeclBits = 41 };
1614
+ // / Number of inherited and non-inherited bits in RecordDeclBitfields.
1615
+ enum { NumRecordDeclBits = NumTagDeclBits + 41 };
1620
1616
1621
1617
// / Stores the bits used by OMPDeclareReductionDecl.
1622
1618
// / If modified NumOMPDeclareReductionDeclBits and the accessor
@@ -1631,8 +1627,9 @@ class DeclContext {
1631
1627
uint64_t InitializerKind : 2 ;
1632
1628
};
1633
1629
1634
- // / Number of non-inherited bits in OMPDeclareReductionDeclBitfields.
1635
- enum { NumOMPDeclareReductionDeclBits = 2 };
1630
+ // / Number of inherited and non-inherited bits in
1631
+ // / OMPDeclareReductionDeclBitfields.
1632
+ enum { NumOMPDeclareReductionDeclBits = NumDeclContextBits + 2 };
1636
1633
1637
1634
// / Stores the bits used by FunctionDecl.
1638
1635
// / If modified NumFunctionDeclBits and the accessor
@@ -1711,16 +1708,14 @@ class DeclContext {
1711
1708
uint64_t FriendConstraintRefersToEnclosingTemplate : 1 ;
1712
1709
};
1713
1710
1714
- // / Number of non-inherited bits in FunctionDeclBitfields.
1715
- enum { NumFunctionDeclBits = 31 };
1711
+ // / Number of inherited and non-inherited bits in FunctionDeclBitfields.
1712
+ enum { NumFunctionDeclBits = NumDeclContextBits + 31 };
1716
1713
1717
1714
// / Stores the bits used by CXXConstructorDecl. If modified
1718
1715
// / NumCXXConstructorDeclBits and the accessor
1719
1716
// / methods in CXXConstructorDecl should be updated appropriately.
1720
1717
class CXXConstructorDeclBitfields {
1721
1718
friend class CXXConstructorDecl ;
1722
- // / For the bits in DeclContextBitfields.
1723
- uint64_t : NumDeclContextBits;
1724
1719
// / For the bits in FunctionDeclBitfields.
1725
1720
uint64_t : NumFunctionDeclBits;
1726
1721
@@ -1739,10 +1734,8 @@ class DeclContext {
1739
1734
uint64_t IsSimpleExplicit : 1 ;
1740
1735
};
1741
1736
1742
- // / Number of non-inherited bits in CXXConstructorDeclBitfields.
1743
- enum {
1744
- NumCXXConstructorDeclBits = 64 - NumDeclContextBits - NumFunctionDeclBits
1745
- };
1737
+ // / Number of inherited and non-inherited bits in CXXConstructorDeclBitfields.
1738
+ enum { NumCXXConstructorDeclBits = NumFunctionDeclBits + 20 };
1746
1739
1747
1740
// / Stores the bits used by ObjCMethodDecl.
1748
1741
// / If modified NumObjCMethodDeclBits and the accessor
@@ -1803,8 +1796,8 @@ class DeclContext {
1803
1796
uint64_t HasSkippedBody : 1 ;
1804
1797
};
1805
1798
1806
- // / Number of non-inherited bits in ObjCMethodDeclBitfields.
1807
- enum { NumObjCMethodDeclBits = 24 };
1799
+ // / Number of inherited and non-inherited bits in ObjCMethodDeclBitfields.
1800
+ enum { NumObjCMethodDeclBits = NumDeclContextBits + 24 };
1808
1801
1809
1802
// / Stores the bits used by ObjCContainerDecl.
1810
1803
// / If modified NumObjCContainerDeclBits and the accessor
@@ -1819,10 +1812,10 @@ class DeclContext {
1819
1812
SourceLocation AtStart;
1820
1813
};
1821
1814
1822
- // / Number of non-inherited bits in ObjCContainerDeclBitfields.
1815
+ // / Number of inherited and non-inherited bits in ObjCContainerDeclBitfields.
1823
1816
// / Note that here we rely on the fact that SourceLocation is 32 bits
1824
1817
// / wide. We check this with the static_assert in the ctor of DeclContext.
1825
- enum { NumObjCContainerDeclBits = 64 - NumDeclContextBits };
1818
+ enum { NumObjCContainerDeclBits = 64 };
1826
1819
1827
1820
// / Stores the bits used by LinkageSpecDecl.
1828
1821
// / If modified NumLinkageSpecDeclBits and the accessor
@@ -1843,8 +1836,8 @@ class DeclContext {
1843
1836
uint64_t HasBraces : 1 ;
1844
1837
};
1845
1838
1846
- // / Number of non-inherited bits in LinkageSpecDeclBitfields.
1847
- enum { NumLinkageSpecDeclBits = 4 };
1839
+ // / Number of inherited and non-inherited bits in LinkageSpecDeclBitfields.
1840
+ enum { NumLinkageSpecDeclBits = NumDeclContextBits + 4 };
1848
1841
1849
1842
// / Stores the bits used by BlockDecl.
1850
1843
// / If modified NumBlockDeclBits and the accessor
@@ -1869,8 +1862,8 @@ class DeclContext {
1869
1862
uint64_t CanAvoidCopyToHeap : 1 ;
1870
1863
};
1871
1864
1872
- // / Number of non-inherited bits in BlockDeclBitfields.
1873
- enum { NumBlockDeclBits = 5 };
1865
+ // / Number of inherited and non-inherited bits in BlockDeclBitfields.
1866
+ enum { NumBlockDeclBits = NumDeclContextBits + 5 };
1874
1867
1875
1868
// / Pointer to the data structure used to lookup declarations
1876
1869
// / within this context (or a DependentStoredDeclsMap if this is a
0 commit comments