@@ -1611,22 +1611,28 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1611
1611
template <class T > friend class TypePropertyCache ;
1612
1612
1613
1613
// / TypeClass bitfield - Enum that specifies what subclass this belongs to.
1614
+ [[clang::preferred_type(TypeClass)]]
1614
1615
unsigned TC : 8 ;
1615
1616
1616
1617
// / Store information on the type dependency.
1618
+ [[clang::preferred_type(TypeDependence)]]
1617
1619
unsigned Dependence : llvm::BitWidth<TypeDependence>;
1618
1620
1619
1621
// / True if the cache (i.e. the bitfields here starting with
1620
1622
// / 'Cache') is valid.
1623
+ [[clang::preferred_type(bool )]]
1621
1624
mutable unsigned CacheValid : 1 ;
1622
1625
1623
1626
// / Linkage of this type.
1627
+ [[clang::preferred_type(Linkage)]]
1624
1628
mutable unsigned CachedLinkage : 3 ;
1625
1629
1626
1630
// / Whether this type involves and local or unnamed types.
1631
+ [[clang::preferred_type(bool )]]
1627
1632
mutable unsigned CachedLocalOrUnnamed : 1 ;
1628
1633
1629
1634
// / Whether this type comes from an AST file.
1635
+ [[clang::preferred_type(bool )]]
1630
1636
mutable unsigned FromAST : 1 ;
1631
1637
1632
1638
bool isCacheValid () const {
@@ -1652,10 +1658,12 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1652
1658
class ArrayTypeBitfields {
1653
1659
friend class ArrayType ;
1654
1660
1661
+ [[clang::preferred_type(TypeBitfields)]]
1655
1662
unsigned : NumTypeBits;
1656
1663
1657
1664
// / CVR qualifiers from declarations like
1658
1665
// / 'int X[static restrict 4]'. For function parameters only.
1666
+ [[clang::preferred_type(Qualifiers)]]
1659
1667
unsigned IndexTypeQuals : 3 ;
1660
1668
1661
1669
// / Storage class qualifiers from declarations like
@@ -1671,12 +1679,14 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1671
1679
unsigned : NumArrayTypeBits;
1672
1680
1673
1681
// / Whether we have a stored size expression.
1682
+ [[clang::preferred_type(bool )]]
1674
1683
unsigned HasStoredSizeExpr : 1 ;
1675
1684
};
1676
1685
1677
1686
class BuiltinTypeBitfields {
1678
1687
friend class BuiltinType ;
1679
1688
1689
+ [[clang::preferred_type(TypeBitfields)]]
1680
1690
unsigned : NumTypeBits;
1681
1691
1682
1692
// / The kind (BuiltinType::Kind) of builtin type this is.
@@ -1691,15 +1701,18 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1691
1701
friend class FunctionProtoType ;
1692
1702
friend class FunctionType ;
1693
1703
1704
+ [[clang::preferred_type(TypeBitfields)]]
1694
1705
unsigned : NumTypeBits;
1695
1706
1696
1707
// / Extra information which affects how the function is called, like
1697
1708
// / regparm and the calling convention.
1709
+ [[clang::preferred_type(CallingConv)]]
1698
1710
unsigned ExtInfo : 13 ;
1699
1711
1700
1712
// / The ref-qualifier associated with a \c FunctionProtoType.
1701
1713
// /
1702
1714
// / This is a value of type \c RefQualifierKind.
1715
+ [[clang::preferred_type(RefQualifierKind)]]
1703
1716
unsigned RefQualifier : 2 ;
1704
1717
1705
1718
// / Used only by FunctionProtoType, put here to pack with the
@@ -1708,8 +1721,10 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1708
1721
// /
1709
1722
// / C++ 8.3.5p4: The return type, the parameter type list and the
1710
1723
// / cv-qualifier-seq, [...], are part of the function type.
1724
+ [[clang::preferred_type(Qualifiers)]]
1711
1725
unsigned FastTypeQuals : Qualifiers::FastWidth;
1712
1726
// / Whether this function has extended Qualifiers.
1727
+ [[clang::preferred_type(bool )]]
1713
1728
unsigned HasExtQuals : 1 ;
1714
1729
1715
1730
// / The number of parameters this function has, not counting '...'.
@@ -1719,24 +1734,30 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1719
1734
unsigned NumParams : 16 ;
1720
1735
1721
1736
// / The type of exception specification this function has.
1737
+ [[clang::preferred_type(ExceptionSpecificationType)]]
1722
1738
unsigned ExceptionSpecType : 4 ;
1723
1739
1724
1740
// / Whether this function has extended parameter information.
1741
+ [[clang::preferred_type(bool )]]
1725
1742
unsigned HasExtParameterInfos : 1 ;
1726
1743
1727
1744
// / Whether this function has extra bitfields for the prototype.
1745
+ [[clang::preferred_type(bool )]]
1728
1746
unsigned HasExtraBitfields : 1 ;
1729
1747
1730
1748
// / Whether the function is variadic.
1749
+ [[clang::preferred_type(bool )]]
1731
1750
unsigned Variadic : 1 ;
1732
1751
1733
1752
// / Whether this function has a trailing return type.
1753
+ [[clang::preferred_type(bool )]]
1734
1754
unsigned HasTrailingReturn : 1 ;
1735
1755
};
1736
1756
1737
1757
class ObjCObjectTypeBitfields {
1738
1758
friend class ObjCObjectType ;
1739
1759
1760
+ [[clang::preferred_type(TypeBitfields)]]
1740
1761
unsigned : NumTypeBits;
1741
1762
1742
1763
// / The number of type arguments stored directly on this object type.
@@ -1746,12 +1767,14 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1746
1767
unsigned NumProtocols : 6 ;
1747
1768
1748
1769
// / Whether this is a "kindof" type.
1770
+ [[clang::preferred_type(bool )]]
1749
1771
unsigned IsKindOf : 1 ;
1750
1772
};
1751
1773
1752
1774
class ReferenceTypeBitfields {
1753
1775
friend class ReferenceType ;
1754
1776
1777
+ [[clang::preferred_type(TypeBitfields)]]
1755
1778
unsigned : NumTypeBits;
1756
1779
1757
1780
// / True if the type was originally spelled with an lvalue sigil.
@@ -1765,16 +1788,19 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1765
1788
// / ref &&a; // lvalue, inner ref
1766
1789
// / rvref &a; // lvalue, inner ref, spelled lvalue
1767
1790
// / rvref &&a; // rvalue, inner ref
1791
+ [[clang::preferred_type(bool )]]
1768
1792
unsigned SpelledAsLValue : 1 ;
1769
1793
1770
1794
// / True if the inner type is a reference type. This only happens
1771
1795
// / in non-canonical forms.
1796
+ [[clang::preferred_type(bool )]]
1772
1797
unsigned InnerRef : 1 ;
1773
1798
};
1774
1799
1775
1800
class TypeWithKeywordBitfields {
1776
1801
friend class TypeWithKeyword ;
1777
1802
1803
+ [[clang::preferred_type(TypeBitfields)]]
1778
1804
unsigned : NumTypeBits;
1779
1805
1780
1806
// / An ElaboratedTypeKeyword. 8 bits for efficient access.
@@ -1786,17 +1812,19 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1786
1812
class ElaboratedTypeBitfields {
1787
1813
friend class ElaboratedType ;
1788
1814
1789
- unsigned : NumTypeBits;
1815
+ [[clang::preferred_type(TypeWithKeywordBitfields)]]
1790
1816
unsigned : NumTypeWithKeywordBits;
1791
1817
1792
1818
// / Whether the ElaboratedType has a trailing OwnedTagDecl.
1819
+ [[clang::preferred_type(bool )]]
1793
1820
unsigned HasOwnedTagDecl : 1 ;
1794
1821
};
1795
1822
1796
1823
class VectorTypeBitfields {
1797
1824
friend class VectorType ;
1798
1825
friend class DependentVectorType ;
1799
1826
1827
+ [[clang::preferred_type(TypeBitfields)]]
1800
1828
unsigned : NumTypeBits;
1801
1829
1802
1830
// / The kind of vector, either a generic vector type or some
@@ -1809,6 +1837,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1809
1837
class AttributedTypeBitfields {
1810
1838
friend class AttributedType ;
1811
1839
1840
+ [[clang::preferred_type(TypeBitfields)]]
1812
1841
unsigned : NumTypeBits;
1813
1842
1814
1843
// / An AttributedType::Kind
@@ -1818,10 +1847,12 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1818
1847
class AutoTypeBitfields {
1819
1848
friend class AutoType ;
1820
1849
1850
+ [[clang::preferred_type(TypeBitfields)]]
1821
1851
unsigned : NumTypeBits;
1822
1852
1823
1853
// / Was this placeholder type spelled as 'auto', 'decltype(auto)',
1824
1854
// / or '__auto_type'? AutoTypeKeyword value.
1855
+ [[clang::preferred_type(AutoTypeKeyword)]]
1825
1856
unsigned Keyword : 2 ;
1826
1857
1827
1858
// / The number of template arguments in the type-constraints, which is
@@ -1838,33 +1869,40 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1838
1869
friend class TypeOfType ;
1839
1870
friend class TypeOfExprType ;
1840
1871
1872
+ [[clang::preferred_type(TypeBitfields)]]
1841
1873
unsigned : NumTypeBits;
1874
+ [[clang::preferred_type(bool )]]
1842
1875
unsigned IsUnqual : 1 ; // If true: typeof_unqual, else: typeof
1843
1876
};
1844
1877
1845
1878
class UsingBitfields {
1846
1879
friend class UsingType ;
1847
1880
1848
- unsigned : NumTypeBits;
1881
+ [[clang::preferred_type(TypeBitfields)]] unsigned : NumTypeBits;
1849
1882
1850
1883
// / True if the underlying type is different from the declared one.
1884
+ [[clang::preferred_type(bool )]]
1851
1885
unsigned hasTypeDifferentFromDecl : 1 ;
1852
1886
};
1853
1887
1854
1888
class TypedefBitfields {
1855
1889
friend class TypedefType ;
1856
1890
1891
+ [[clang::preferred_type(TypeBitfields)]]
1857
1892
unsigned : NumTypeBits;
1858
1893
1859
1894
// / True if the underlying type is different from the declared one.
1895
+ [[clang::preferred_type(bool )]]
1860
1896
unsigned hasTypeDifferentFromDecl : 1 ;
1861
1897
};
1862
1898
1863
1899
class SubstTemplateTypeParmTypeBitfields {
1864
1900
friend class SubstTemplateTypeParmType ;
1865
1901
1902
+ [[clang::preferred_type(TypeBitfields)]]
1866
1903
unsigned : NumTypeBits;
1867
1904
1905
+ [[clang::preferred_type(bool )]]
1868
1906
unsigned HasNonCanonicalUnderlyingType : 1 ;
1869
1907
1870
1908
// The index of the template parameter this substitution represents.
@@ -1881,6 +1919,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1881
1919
class SubstTemplateTypeParmPackTypeBitfields {
1882
1920
friend class SubstTemplateTypeParmPackType ;
1883
1921
1922
+ [[clang::preferred_type(TypeBitfields)]]
1884
1923
unsigned : NumTypeBits;
1885
1924
1886
1925
// The index of the template parameter this substitution represents.
@@ -1896,9 +1935,11 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1896
1935
class TemplateSpecializationTypeBitfields {
1897
1936
friend class TemplateSpecializationType ;
1898
1937
1938
+ [[clang::preferred_type(TypeBitfields)]]
1899
1939
unsigned : NumTypeBits;
1900
1940
1901
1941
// / Whether this template specialization type is a substituted type alias.
1942
+ [[clang::preferred_type(bool )]]
1902
1943
unsigned TypeAlias : 1 ;
1903
1944
1904
1945
// / The number of template arguments named in this class template
@@ -1929,6 +1970,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
1929
1970
class PackExpansionTypeBitfields {
1930
1971
friend class PackExpansionType ;
1931
1972
1973
+ [[clang::preferred_type(TypeBitfields)]]
1932
1974
unsigned : NumTypeBits;
1933
1975
1934
1976
// / The number of expansions that this pack expansion will
0 commit comments