17#ifndef LLVM_CLANG_AST_TYPE_H
18#define LLVM_CLANG_AST_TYPE_H
35#include "llvm/ADT/APInt.h"
36#include "llvm/ADT/APSInt.h"
37#include "llvm/ADT/ArrayRef.h"
38#include "llvm/ADT/FoldingSet.h"
39#include "llvm/ADT/PointerIntPair.h"
40#include "llvm/ADT/PointerUnion.h"
41#include "llvm/ADT/STLForwardCompat.h"
42#include "llvm/ADT/StringRef.h"
43#include "llvm/ADT/Twine.h"
44#include "llvm/ADT/iterator_range.h"
45#include "llvm/Support/Casting.h"
46#include "llvm/Support/Compiler.h"
47#include "llvm/Support/ErrorHandling.h"
48#include "llvm/Support/PointerLikeTypeTraits.h"
49#include "llvm/Support/TrailingObjects.h"
50#include "llvm/Support/type_traits.h"
68class TemplateParameterList;
76namespace serialization {
77 template <
class T>
class AbstractTypeReader;
114template <
typename>
class CanQual;
119class ExtQualsTypeCommonBase;
123class ObjCInterfaceDecl;
124class ObjCProtocolDecl;
125class ObjCTypeParamDecl;
126struct PrintingPolicy;
130class TemplateArgument;
131class TemplateArgumentListInfo;
132class TemplateArgumentLoc;
133class TemplateTypeParmDecl;
134class TypedefNameDecl;
135class UnresolvedUsingTypenameDecl;
136class UsingShadowDecl;
141#define TYPE(Class, Base) class Class##Type;
142#include "clang/AST/TypeNodes.inc"
149 EnabledMask = 1 << EnabledShift,
150 AddressDiscriminatedShift = EnabledShift + EnabledBits,
151 AddressDiscriminatedBits = 1,
152 AddressDiscriminatedMask = 1 << AddressDiscriminatedShift,
153 AuthenticationModeShift =
154 AddressDiscriminatedShift + AddressDiscriminatedBits,
155 AuthenticationModeBits = 2,
156 AuthenticationModeMask = ((1 << AuthenticationModeBits) - 1)
157 << AuthenticationModeShift,
158 IsaPointerShift = AuthenticationModeShift + AuthenticationModeBits,
160 IsaPointerMask = ((1 << IsaPointerBits) - 1) << IsaPointerShift,
161 AuthenticatesNullValuesShift = IsaPointerShift + IsaPointerBits,
162 AuthenticatesNullValuesBits = 1,
163 AuthenticatesNullValuesMask = ((1 << AuthenticatesNullValuesBits) - 1)
164 << AuthenticatesNullValuesShift,
165 KeyShift = AuthenticatesNullValuesShift + AuthenticatesNullValuesBits,
167 KeyMask = ((1 << KeyBits) - 1) << KeyShift,
168 DiscriminatorShift = KeyShift + KeyBits,
169 DiscriminatorBits = 16,
170 DiscriminatorMask = ((1u << DiscriminatorBits) - 1) << DiscriminatorShift,
181 static_assert((EnabledBits + AddressDiscriminatedBits +
182 AuthenticationModeBits + IsaPointerBits +
183 AuthenticatesNullValuesBits + KeyBits + DiscriminatorBits) ==
185 "PointerAuthQualifier should be exactly 32 bits");
186 static_assert((EnabledMask + AddressDiscriminatedMask +
187 AuthenticationModeMask + IsaPointerMask +
188 AuthenticatesNullValuesMask + KeyMask + DiscriminatorMask) ==
190 "All masks should cover the entire bits");
191 static_assert((EnabledMask ^ AddressDiscriminatedMask ^
192 AuthenticationModeMask ^ IsaPointerMask ^
193 AuthenticatesNullValuesMask ^ KeyMask ^ DiscriminatorMask) ==
195 "All masks should cover the entire bits");
198 unsigned ExtraDiscriminator,
200 bool IsIsaPointer,
bool AuthenticatesNullValues)
202 (IsAddressDiscriminated
203 ? llvm::to_underlying(AddressDiscriminatedMask)
206 (llvm::to_underlying(AuthenticationMode)
207 << AuthenticationModeShift) |
208 (ExtraDiscriminator << DiscriminatorShift) |
209 (IsIsaPointer << IsaPointerShift) |
210 (AuthenticatesNullValues << AuthenticatesNullValuesShift)) {
213 assert((
Data == 0) ==
232 Create(
unsigned Key,
bool IsAddressDiscriminated,
unsigned ExtraDiscriminator,
234 bool AuthenticatesNullValues) {
239 AuthenticationMode, IsIsaPointer,
240 AuthenticatesNullValues);
244 assert((
Data == 0) ==
253 return (
Data & KeyMask) >> KeyShift;
260 return (
Data & AddressDiscriminatedMask) >> AddressDiscriminatedShift;
265 return (
Data >> DiscriminatorShift);
270 AuthenticationModeShift);
275 return (
Data & IsaPointerMask) >> IsaPointerShift;
280 return (
Data & AuthenticatesNullValuesMask) >> AuthenticatesNullValuesShift;
288 return Lhs.Data == Rhs.Data;
291 return Lhs.Data != Rhs.Data;
304 assert((
Result.Data == 0) ==
384 Q.Mask = L.Mask & R.Mask;
478 assert(!(mask & ~
CVRMask) &&
"bitmask contains non-CVR bits");
479 Mask = (Mask & ~CVRMask) | mask;
482 assert(!(mask & ~
CVRMask) &&
"bitmask contains non-CVR bits");
489 assert(!(mask & ~
CVRMask) &&
"bitmask contains non-CVR bits");
493 assert(!(mask & ~
CVRMask & ~UMask) &&
"bitmask contains non-CVRU bits");
499 Mask = (Mask & ~UMask) | (flag ? UMask : 0);
507 Mask = (Mask & ~GCAttrMask) | (
type << GCAttrShift);
532 return ObjCLifetime((Mask & LifetimeMask) >> LifetimeShift);
535 Mask = (Mask & ~LifetimeMask) | (
type << LifetimeShift);
541 Mask |= (
type << LifetimeShift);
558 return static_cast<LangAS>(Mask >> AddressSpaceShift);
579 Mask = (Mask & ~AddressSpaceMask)
580 | (((uint32_t) space) << AddressSpaceShift);
593 Mask = (Mask & ~PtrAuthMask) |
607 assert(!(mask & ~
FastMask) &&
"bitmask contains non-fast qualifier bits");
608 Mask = (Mask & ~FastMask) | mask;
611 assert(!(mask & ~
FastMask) &&
"bitmask contains non-fast qualifier bits");
618 assert(!(mask & ~
FastMask) &&
"bitmask contains non-fast qualifier bits");
633 bool empty()
const {
return !Mask; }
806 bool appendSpaceIfNonEmpty =
false)
const;
808 void Profile(llvm::FoldingSetNodeID &
ID)
const {
ID.AddInteger(Mask); }
815 "PointerAuthQualifier must be 32 bits");
817 static constexpr uint64_t UMask = 0x8;
818 static constexpr uint64_t UShift = 3;
819 static constexpr uint64_t GCAttrMask = 0x30;
820 static constexpr uint64_t GCAttrShift = 4;
821 static constexpr uint64_t LifetimeMask = 0x1C0;
822 static constexpr uint64_t LifetimeShift = 6;
823 static constexpr uint64_t AddressSpaceMask =
824 ~(
CVRMask | UMask | GCAttrMask | LifetimeMask);
825 static constexpr uint64_t AddressSpaceShift = 9;
826 static constexpr uint64_t PtrAuthShift = 32;
827 static constexpr uint64_t PtrAuthMask = uint64_t(0xffffffff) << PtrAuthShift;
837 : Quals(Quals), HasAtomic(HasAtomic) {}
886 std::pair<const Type *,Qualifiers>
asPair()
const {
887 return std::pair<const Type *, Qualifiers>(
Ty,
Quals);
891 return a.
Ty ==
b.Ty && a.
Quals ==
b.Quals;
894 return a.
Ty !=
b.Ty || a.
Quals !=
b.Quals;
944 llvm::PointerIntPair<llvm::PointerUnion<const Type *, const ExtQuals *>,
947 const ExtQuals *getExtQualsUnsafe()
const {
951 const Type *getTypePtrUnsafe()
const {
952 return Value.getPointer().get<
const Type*>();
955 const ExtQualsTypeCommonBase *getCommonPtr()
const {
956 assert(!
isNull() &&
"Cannot retrieve a NULL type pointer");
957 auto CommonPtrVal =
reinterpret_cast<uintptr_t>(
Value.getOpaqueValue());
959 return reinterpret_cast<ExtQualsTypeCommonBase*
>(CommonPtrVal);
991 T.Value.setFromOpaqueValue(
const_cast<void*
>(Ptr));
1008 return Value.getPointer().isNull();
1035 std::optional<NonConstantStorageReason>
1180 &&
"non-fast qualifier bits set in mask!");
1198 T.addFastQualifiers(TQs);
1211 T.removeLocalFastQualifiers();
1305 return getSingleStepDesugaredTypeImpl(*
this, Context);
1311 if (isa<ParenType>(*
this))
1318 return LHS.Value == RHS.Value;
1321 return LHS.Value != RHS.Value;
1324 return LHS.Value < RHS.Value;
1338 const Twine &PlaceHolder = Twine(),
1339 unsigned Indentation = 0)
const;
1343 unsigned Indentation = 0) {
1349 const Twine &PlaceHolder,
1350 unsigned Indentation = 0);
1367 const Twine &PlaceHolder;
1368 unsigned Indentation;
1372 const Twine &PlaceHolder,
unsigned Indentation)
1373 :
T(
T), Policy(Policy), PlaceHolder(PlaceHolder),
1374 Indentation(Indentation) {}
1378 SQT.T.
print(OS, SQT.Policy, SQT.PlaceHolder, SQT.Indentation);
1384 const Twine &PlaceHolder = Twine(),
1385 unsigned Indentation = 0)
const {
1389 void dump(
const char *
s)
const;
1391 void dump(llvm::raw_ostream &OS,
const ASTContext &Context)
const;
1531 return isDestructedTypeImpl(*
this);
1629raw_ostream &
operator<<(raw_ostream &OS, QualType QT);
1649 return P.getAsOpaquePtr();
1657 static constexpr int NumLowBitsAvailable = 0;
1677 const Type *
const BaseType;
1683 : BaseType(baseType), CanonicalType(canon) {}
1697 public llvm::FoldingSetNode {
1720 canon.isNull() ?
QualType(this_(), 0) : canon),
1722 assert(Quals.hasNonFastQualifiers()
1723 &&
"ExtQuals created with no fast qualifiers");
1724 assert(!Quals.hasFastQualifiers()
1725 &&
"ExtQuals created with fast qualifiers");
1735 return Quals.getObjCLifetime();
1745 Profile(
ID, getBaseType(), Quals);
1749 const Type *BaseType,
1752 ID.AddPointer(BaseType);
1783enum class ArraySizeModifier;
1784enum class ElaboratedTypeKeyword;
1785enum class VectorKind;
1816#define TYPE(Class, Base) Class,
1817#define LAST_TYPE(Class) TypeLast = Class
1818#define ABSTRACT_TYPE(Class, Base)
1819#include "clang/AST/TypeNodes.inc"
1824 class TypeBitfields {
1826 template <
class T>
friend class TypePropertyCache;
1829 LLVM_PREFERRED_TYPE(TypeClass)
1834 unsigned Dependence : llvm::BitWidth<TypeDependence>;
1838 LLVM_PREFERRED_TYPE(
bool)
1839 mutable unsigned CacheValid : 1;
1843 mutable unsigned CachedLinkage : 3;
1846 LLVM_PREFERRED_TYPE(
bool)
1847 mutable unsigned CachedLocalOrUnnamed : 1;
1850 LLVM_PREFERRED_TYPE(
bool)
1851 mutable unsigned FromAST : 1;
1853 bool isCacheValid()
const {
1858 assert(isCacheValid() &&
"getting linkage from invalid cache");
1859 return static_cast<Linkage>(CachedLinkage);
1862 bool hasLocalOrUnnamedType()
const {
1863 assert(isCacheValid() &&
"getting linkage from invalid cache");
1864 return CachedLocalOrUnnamed;
1867 enum { NumTypeBits = 8 + llvm::BitWidth<TypeDependence> + 6 };
1876 LLVM_PREFERRED_TYPE(TypeBitfields)
1882 unsigned IndexTypeQuals : 3;
1887 unsigned SizeModifier : 3;
1889 enum { NumArrayTypeBits = NumTypeBits + 6 };
1898 LLVM_PREFERRED_TYPE(
bool)
1899 unsigned HasExternalSize : 1;
1901 LLVM_PREFERRED_TYPE(
unsigned)
1902 unsigned SizeWidth : 5;
1908 LLVM_PREFERRED_TYPE(TypeBitfields)
1912 static constexpr unsigned NumOfBuiltinTypeBits = 9;
1913 unsigned Kind : NumOfBuiltinTypeBits;
1923 LLVM_PREFERRED_TYPE(TypeBitfields)
1929 unsigned ExtInfo : 13;
1935 unsigned RefQualifier : 2;
1944 unsigned FastTypeQuals : Qualifiers::FastWidth;
1946 LLVM_PREFERRED_TYPE(
bool)
1947 unsigned HasExtQuals : 1;
1953 unsigned NumParams : 16;
1957 unsigned ExceptionSpecType : 4;
1960 LLVM_PREFERRED_TYPE(
bool)
1961 unsigned HasExtParameterInfos : 1;
1964 LLVM_PREFERRED_TYPE(
bool)
1965 unsigned HasExtraBitfields : 1;
1968 LLVM_PREFERRED_TYPE(
bool)
1969 unsigned Variadic : 1;
1972 LLVM_PREFERRED_TYPE(
bool)
1973 unsigned HasTrailingReturn : 1;
1979 LLVM_PREFERRED_TYPE(TypeBitfields)
1983 unsigned NumTypeArgs : 7;
1986 unsigned NumProtocols : 6;
1989 LLVM_PREFERRED_TYPE(
bool)
1990 unsigned IsKindOf : 1;
1996 LLVM_PREFERRED_TYPE(TypeBitfields)
2010 LLVM_PREFERRED_TYPE(
bool)
2011 unsigned SpelledAsLValue : 1;
2015 LLVM_PREFERRED_TYPE(
bool)
2016 unsigned InnerRef : 1;
2022 LLVM_PREFERRED_TYPE(TypeBitfields)
2027 unsigned Keyword : 8;
2030 enum { NumTypeWithKeywordBits = NumTypeBits + 8 };
2039 LLVM_PREFERRED_TYPE(
bool)
2040 unsigned HasOwnedTagDecl : 1;
2047 LLVM_PREFERRED_TYPE(TypeBitfields)
2053 unsigned VecKind : 4;
2055 uint32_t NumElements;
2061 LLVM_PREFERRED_TYPE(TypeBitfields)
2065 unsigned AttrKind : 32 - NumTypeBits;
2071 LLVM_PREFERRED_TYPE(TypeBitfields)
2077 unsigned Keyword : 2;
2093 LLVM_PREFERRED_TYPE(TypeBitfields)
2095 LLVM_PREFERRED_TYPE(
bool)
2096 unsigned IsUnqual : 1;
2102 LLVM_PREFERRED_TYPE(TypeBitfields)
2106 LLVM_PREFERRED_TYPE(
bool)
2107 unsigned hasTypeDifferentFromDecl : 1;
2113 LLVM_PREFERRED_TYPE(TypeBitfields)
2117 LLVM_PREFERRED_TYPE(
bool)
2118 unsigned hasTypeDifferentFromDecl : 1;
2124 LLVM_PREFERRED_TYPE(TypeBitfields)
2127 LLVM_PREFERRED_TYPE(
bool)
2128 unsigned HasNonCanonicalUnderlyingType : 1;
2131 unsigned Index : 15;
2138 unsigned PackIndex : 16;
2144 LLVM_PREFERRED_TYPE(TypeBitfields)
2148 unsigned Index : 16;
2154 unsigned NumArgs : 16;
2160 LLVM_PREFERRED_TYPE(TypeBitfields)
2164 LLVM_PREFERRED_TYPE(
bool)
2165 unsigned TypeAlias : 1;
2196 LLVM_PREFERRED_TYPE(TypeBitfields)
2210 unsigned NumExpansions;
2216 LLVM_PREFERRED_TYPE(TypeBitfields)
2219 static constexpr unsigned NumCoupledDeclsBits = 4;
2220 unsigned NumCoupledDecls : NumCoupledDeclsBits;
2221 LLVM_PREFERRED_TYPE(
bool)
2222 unsigned CountInBytes : 1;
2223 LLVM_PREFERRED_TYPE(
bool)
2224 unsigned OrNull : 1;
2257 void setFromAST(
bool V =
true)
const {
2258 TypeBits.FromAST =
V;
2266 canon.isNull() ?
QualType(this_(), 0) : canon) {
2267 static_assert(
sizeof(*this) <=
2269 "changing bitfields changed sizeof(Type)!");
2270 static_assert(
alignof(
decltype(*this)) %
TypeAlignment == 0,
2271 "Insufficient alignment!");
2273 TypeBits.Dependence =
static_cast<unsigned>(
Dependence);
2274 TypeBits.CacheValid =
false;
2275 TypeBits.CachedLocalOrUnnamed =
false;
2276 TypeBits.CachedLinkage = llvm::to_underlying(Linkage::Invalid);
2277 TypeBits.FromAST =
false;
2284 TypeBits.Dependence =
static_cast<unsigned>(D);
2321 return getDependence() & TypeDependence::UnexpandedPack;
2327 return CanonicalType ==
QualType(
this, 0);
2333 QualType getLocallyUnqualifiedSingleStepDesugaredType()
const;
2341 bool isSizelessType()
const;
2342 bool isSizelessBuiltinType()
const;
2345 bool isSizelessVectorType()
const;
2348 bool isSVESizelessBuiltinType()
const;
2351 bool isRVVSizelessBuiltinType()
const;
2354 bool isWebAssemblyExternrefType()
const;
2359 bool isWebAssemblyTableType()
const;
2364 bool isSveVLSBuiltinType()
const;
2374 bool isRVVVLSBuiltinType()
const;
2392 bool isIncompleteType(
NamedDecl **Def =
nullptr)
const;
2397 return !isFunctionType();
2405 return !isReferenceType() && !isFunctionType() && !isVoidType();
2410 bool isLiteralType(
const ASTContext &Ctx)
const;
2413 bool isStructuralType()
const;
2417 bool isStandardLayoutType()
const;
2423 bool isBuiltinType()
const;
2426 bool isSpecificBuiltinType(
unsigned K)
const;
2431 bool isPlaceholderType()
const;
2435 bool isSpecificPlaceholderType(
unsigned K)
const;
2439 bool isNonOverloadPlaceholderType()
const;
2443 bool isIntegerType()
const;
2444 bool isEnumeralType()
const;
2447 bool isScopedEnumeralType()
const;
2449 bool isCharType()
const;
2450 bool isWideCharType()
const;
2451 bool isChar8Type()
const;
2452 bool isChar16Type()
const;
2453 bool isChar32Type()
const;
2454 bool isAnyCharacterType()
const;
2455 bool isIntegralType(
const ASTContext &Ctx)
const;
2458 bool isIntegralOrEnumerationType()
const;
2461 bool isIntegralOrUnscopedEnumerationType()
const;
2462 bool isUnscopedEnumerationType()
const;
2465 bool isRealFloatingType()
const;
2468 bool isComplexType()
const;
2469 bool isAnyComplexType()
const;
2470 bool isFloatingType()
const;
2471 bool isHalfType()
const;
2472 bool isFloat16Type()
const;
2473 bool isFloat32Type()
const;
2474 bool isDoubleType()
const;
2475 bool isBFloat16Type()
const;
2476 bool isFloat128Type()
const;
2477 bool isIbm128Type()
const;
2478 bool isRealType()
const;
2479 bool isArithmeticType()
const;
2480 bool isVoidType()
const;
2481 bool isScalarType()
const;
2482 bool isAggregateType()
const;
2483 bool isFundamentalType()
const;
2484 bool isCompoundType()
const;
2488 bool isFunctionType()
const;
2491 bool isPointerType()
const;
2492 bool isAnyPointerType()
const;
2493 bool isCountAttributedType()
const;
2494 bool isBlockPointerType()
const;
2495 bool isVoidPointerType()
const;
2496 bool isReferenceType()
const;
2497 bool isLValueReferenceType()
const;
2498 bool isRValueReferenceType()
const;
2499 bool isObjectPointerType()
const;
2500 bool isFunctionPointerType()
const;
2501 bool isFunctionReferenceType()
const;
2502 bool isMemberPointerType()
const;
2503 bool isMemberFunctionPointerType()
const;
2504 bool isMemberDataPointerType()
const;
2505 bool isArrayType()
const;
2506 bool isConstantArrayType()
const;
2507 bool isIncompleteArrayType()
const;
2508 bool isVariableArrayType()
const;
2509 bool isArrayParameterType()
const;
2510 bool isDependentSizedArrayType()
const;
2512 bool isClassType()
const;
2513 bool isStructureType()
const;
2514 bool isObjCBoxableRecordType()
const;
2515 bool isInterfaceType()
const;
2516 bool isStructureOrClassType()
const;
2517 bool isUnionType()
const;
2518 bool isComplexIntegerType()
const;
2519 bool isVectorType()
const;
2520 bool isExtVectorType()
const;
2521 bool isExtVectorBoolType()
const;
2522 bool isMatrixType()
const;
2523 bool isConstantMatrixType()
const;
2524 bool isDependentAddressSpaceType()
const;
2525 bool isObjCObjectPointerType()
const;
2526 bool isObjCRetainableType()
const;
2527 bool isObjCLifetimeType()
const;
2528 bool isObjCIndirectLifetimeType()
const;
2529 bool isObjCNSObjectType()
const;
2530 bool isObjCIndependentClassType()
const;
2533 bool isObjCObjectType()
const;
2534 bool isObjCQualifiedInterfaceType()
const;
2535 bool isObjCQualifiedIdType()
const;
2536 bool isObjCQualifiedClassType()
const;
2537 bool isObjCObjectOrInterfaceType()
const;
2538 bool isObjCIdType()
const;
2539 bool isDecltypeType()
const;
2547 return hasAttr(attr::ObjCInertUnsafeUnretained);
2557 bool isObjCIdOrObjectKindOfType(
const ASTContext &ctx,
2560 bool isObjCClassType()
const;
2568 bool isObjCClassOrClassKindOfType()
const;
2570 bool isBlockCompatibleObjCPointerType(
ASTContext &ctx)
const;
2571 bool isObjCSelType()
const;
2572 bool isObjCBuiltinType()
const;
2573 bool isObjCARCBridgableType()
const;
2574 bool isCARCBridgableType()
const;
2575 bool isTemplateTypeParmType()
const;
2576 bool isNullPtrType()
const;
2578 bool isNothrowT()
const;
2579 bool isAlignValT()
const;
2580 bool isStdByteType()
const;
2581 bool isAtomicType()
const;
2582 bool isUndeducedAutoType()
const;
2584 bool isTypedefNameType()
const;
2586#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
2587 bool is##Id##Type() const;
2588#include "clang/Basic/OpenCLImageTypes.def"
2590 bool isImageType()
const;
2592 bool isSamplerT()
const;
2593 bool isEventT()
const;
2594 bool isClkEventT()
const;
2595 bool isQueueT()
const;
2596 bool isReserveIDT()
const;
2598#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
2599 bool is##Id##Type() const;
2600#include "clang/Basic/OpenCLExtensionTypes.def"
2602 bool isOCLIntelSubgroupAVCType()
const;
2603 bool isOCLExtOpaqueType()
const;
2605 bool isPipeType()
const;
2606 bool isBitIntType()
const;
2607 bool isOpenCLSpecificType()
const;
2612 bool isObjCARCImplicitlyUnretainedType()
const;
2615 bool isCUDADeviceBuiltinSurfaceType()
const;
2617 bool isCUDADeviceBuiltinTextureType()
const;
2636 ScalarTypeKind getScalarTypeKind()
const;
2644 return getDependence() & TypeDependence::Error;
2650 return getDependence() & TypeDependence::Dependent;
2658 return getDependence() & TypeDependence::Instantiation;
2664 bool isUndeducedType()
const;
2668 return getDependence() & TypeDependence::VariablyModified;
2673 bool hasSizedVLAType()
const;
2676 bool hasUnnamedOrLocalType()
const;
2678 bool isOverloadableType()
const;
2681 bool isElaboratedTypeSpecifier()
const;
2683 bool canDecayToPointerType()
const;
2688 bool hasPointerRepresentation()
const;
2692 bool hasObjCPointerRepresentation()
const;
2696 bool hasIntegerRepresentation()
const;
2700 bool hasSignedIntegerRepresentation()
const;
2704 bool hasUnsignedIntegerRepresentation()
const;
2708 bool hasFloatingRepresentation()
const;
2713 const RecordType *getAsStructureType()
const;
2716 const ComplexType *getAsComplexIntegerType()
const;
2737 TagDecl *getAsTagDecl()
const;
2755 return dyn_cast_or_null<AutoType>(getContainedDeducedType());
2761 bool hasAutoForTrailingReturnType()
const;
2769 template <
typename T>
const T *getAs()
const;
2776 template <
typename T>
const T *getAsAdjusted()
const;
2780 const ArrayType *getAsArrayTypeUnsafe()
const;
2788 template <
typename T>
const T *castAs()
const;
2792 const ArrayType *castAsArrayTypeUnsafe()
const;
2801 const Type *getBaseElementTypeUnsafe()
const;
2806 const Type *getArrayElementTypeNoTypeQual()
const;
2811 const Type *getPointeeOrArrayElementType()
const;
2819 const Type *getUnqualifiedDesugaredType()
const;
2824 bool isSignedIntegerType()
const;
2829 bool isUnsignedIntegerType()
const;
2833 bool isSignedIntegerOrEnumerationType()
const;
2837 bool isUnsignedIntegerOrEnumerationType()
const;
2841 bool isFixedPointType()
const;
2844 bool isFixedPointOrIntegerType()
const;
2847 bool isConvertibleToFixedPointType()
const;
2851 bool isSaturatedFixedPointType()
const;
2855 bool isUnsaturatedFixedPointType()
const;
2859 bool isSignedFixedPointType()
const;
2863 bool isUnsignedFixedPointType()
const;
2868 bool isConstantSizeType()
const;
2872 bool isSpecifierType()
const;
2879 return getLinkageAndVisibility().getVisibility();
2884 return getLinkageAndVisibility().isVisibilityExplicit();
2892 bool isLinkageValid()
const;
2899 std::optional<NullabilityKind> getNullability()
const;
2906 bool canHaveNullability(
bool ResultIfUnknown =
true)
const;
2923 std::optional<ArrayRef<QualType>>
2924 getObjCSubstitutions(
const DeclContext *dc)
const;
2928 bool acceptsObjCTypeParams()
const;
2930 const char *getTypeClassName()
const;
2933 return CanonicalType;
2938 void dump(llvm::raw_ostream &OS,
const ASTContext &Context)
const;
2943template <>
const TypedefType *Type::getAs()
const;
2944template <>
const UsingType *Type::getAs()
const;
2949template <>
const TemplateSpecializationType *Type::getAs()
const;
2953template <>
const AttributedType *Type::getAs()
const;
2957template <>
const BoundsAttributedType *Type::getAs()
const;
2961template <>
const CountAttributedType *Type::getAs()
const;
2965#define TYPE(Class, Base)
2966#define LEAF_TYPE(Class) \
2967template <> inline const Class##Type *Type::getAs() const { \
2968 return dyn_cast<Class##Type>(CanonicalType); \
2970template <> inline const Class##Type *Type::castAs() const { \
2971 return cast<Class##Type>(CanonicalType); \
2973#include "clang/AST/TypeNodes.inc"
2981#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) Id,
2982#include "clang/Basic/OpenCLImageTypes.def"
2984#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) Id,
2985#include "clang/Basic/OpenCLExtensionTypes.def"
2987#define SVE_TYPE(Name, Id, SingletonId) Id,
2988#include "clang/Basic/AArch64SVEACLETypes.def"
2990#define PPC_VECTOR_TYPE(Name, Id, Size) Id,
2991#include "clang/Basic/PPCTypes.def"
2993#define RVV_TYPE(Name, Id, SingletonId) Id,
2994#include "clang/Basic/RISCVVTypes.def"
2996#define WASM_TYPE(Name, Id, SingletonId) Id,
2997#include "clang/Basic/WebAssemblyReferenceTypes.def"
2999#define BUILTIN_TYPE(Id, SingletonId) Id,
3000#define LAST_BUILTIN_TYPE(Id) LastKind = Id
3001#include "clang/AST/BuiltinTypes.def"
3011 static_assert(Kind::LastKind <
3012 (1 << BuiltinTypeBitfields::NumOfBuiltinTypeBits) &&
3013 "Defined builtin type exceeds the allocated space for serial "
3015 BuiltinTypeBits.Kind = K;
3024 StringRef str =
getName(Policy);
3025 assert(!str.empty() && str.data()[str.size()] ==
'\0');
3054 return K >= Overload;
3061 return isPlaceholderTypeKind(
getKind());
3088 :
Type(
Complex, CanonicalPtr, Element->getDependence()),
3089 ElementType(Element) {}
3098 Profile(
ID, getElementType());
3102 ID.AddPointer(Element.getAsOpaquePtr());
3115 :
Type(
Paren, CanonType, InnerType->getDependence()), Inner(InnerType) {}
3124 Profile(
ID, getInnerType());
3141 :
Type(
Pointer, CanonicalPtr, Pointee->getDependence()),
3142 PointeeType(Pointee) {}
3151 Profile(
ID, getPointeeType());
3165 using BaseTy = llvm::PointerIntPair<ValueDecl *, 1, unsigned>;
3180 bool isDeref()
const;
3182 unsigned getInt()
const;
3183 void *getOpaqueValue()
const;
3185 void setFromOpaqueValue(
void *
V);
3216 return decl_range(dependent_decl_begin(), dependent_decl_end());
3220 return {dependent_decl_begin(), dependent_decl_end()};
3223 bool referencesFieldDecls()
const;
3230 case CountAttributed:
3242 public llvm::TrailingObjects<CountAttributedType,
3243 TypeCoupledDeclRefInfo> {
3254 bool CountInBytes,
bool OrNull,
3257 unsigned numTrailingObjects(OverloadToken<TypeCoupledDeclRefInfo>)
const {
3258 return CountAttributedTypeBits.NumCoupledDecls;
3271 bool isOrNull()
const {
return CountAttributedTypeBits.OrNull; }
3275 return isCountInBytes() ? SizedByOrNull : CountedByOrNull;
3276 return isCountInBytes() ? SizedBy : CountedBy;
3280 Profile(
ID, desugar(), CountExpr, isCountInBytes(), isOrNull());
3283 static void Profile(llvm::FoldingSetNodeID &
ID,
QualType WrappedTy,
3284 Expr *CountExpr,
bool CountInBytes,
bool Nullable);
3303 :
Type(TC, CanonicalPtr, OriginalTy->getDependence()),
3304 OriginalTy(OriginalTy), AdjustedTy(AdjustedTy) {}
3314 Profile(
ID, OriginalTy, AdjustedTy);
3337 inline QualType getPointeeType()
const;
3352 :
Type(BlockPointer, CanonicalCls, Pointee->getDependence()),
3353 PointeeType(Pointee) {}
3363 Profile(
ID, getPointeeType());
3381 bool SpelledAsLValue)
3382 :
Type(tc, CanonicalRef, Referencee->getDependence()),
3383 PointeeType(Referencee) {
3384 ReferenceTypeBits.SpelledAsLValue = SpelledAsLValue;
3397 while (
T->isInnerRef())
3399 return T->PointeeType;
3403 Profile(
ID, PointeeType, isSpelledAsLValue());
3408 bool SpelledAsLValue) {
3410 ID.AddBoolean(SpelledAsLValue);
3424 bool SpelledAsLValue)
3466 :
Type(MemberPointer, CanonicalPtr,
3468 Pointee->getDependence()),
3469 PointeeType(Pointee),
Class(Cls) {}
3493 Profile(
ID, getPointeeType(), getClass());
3497 const Type *Class) {
3523 unsigned tq,
const Expr *sz =
nullptr);
3533 return Qualifiers::fromCVRMask(getIndexTypeCVRQualifiers());
3537 return ArrayTypeBits.IndexTypeQuals;
3555 struct ExternalSize {
3556 ExternalSize(
const llvm::APInt &Sz,
const Expr *SE)
3557 : Size(Sz), SizeExpr(SE) {}
3559 const Expr *SizeExpr;
3569 :
ArrayType(ConstantArray, Et, Can,
SM, TQ, nullptr), Size(Sz) {
3570 ConstantArrayTypeBits.HasExternalSize =
false;
3571 ConstantArrayTypeBits.SizeWidth = Width / 8;
3574 assert(Width < 0xFF &&
"Type width in bits must be less than 8 bits");
3577 ConstantArrayType(QualType Et, QualType Can, ExternalSize *SzPtr,
3578 ArraySizeModifier
SM,
unsigned TQ)
3579 : ArrayType(ConstantArray, Et, Can,
SM, TQ, SzPtr->SizeExpr),
3581 ConstantArrayTypeBits.HasExternalSize =
true;
3582 ConstantArrayTypeBits.SizeWidth = 0;
3584 assert((SzPtr->SizeExpr ==
nullptr || !Can.isNull()) &&
3585 "canonical constant array should not have size expression");
3588 static ConstantArrayType *
Create(
const ASTContext &Ctx, QualType ET,
3589 QualType Can,
const llvm::APInt &Sz,
3590 const Expr *SzExpr, ArraySizeModifier SzMod,
3595 :
ArrayType(Tc, ATy->getElementType(), Can, ATy->getSizeModifier(),
3596 ATy->getIndexTypeQualifiers().getAsOpaqueValue(), nullptr) {
3597 ConstantArrayTypeBits.HasExternalSize =
3599 if (!ConstantArrayTypeBits.HasExternalSize) {
3609 return ConstantArrayTypeBits.HasExternalSize
3611 : llvm::APInt(ConstantArrayTypeBits.SizeWidth * 8, Size);
3616 return ConstantArrayTypeBits.HasExternalSize
3617 ? SizePtr->Size.getBitWidth()
3618 :
static_cast<unsigned>(ConstantArrayTypeBits.SizeWidth * 8);
3623 return ConstantArrayTypeBits.HasExternalSize ? SizePtr->Size.isZero()
3629 return ConstantArrayTypeBits.HasExternalSize ? SizePtr->Size.getZExtValue()
3635 return ConstantArrayTypeBits.HasExternalSize ? SizePtr->Size.getSExtValue()
3636 :
static_cast<int64_t
>(Size);
3642 return ConstantArrayTypeBits.HasExternalSize
3643 ? SizePtr->Size.getLimitedValue()
3649 return ConstantArrayTypeBits.HasExternalSize ? SizePtr->SizeExpr :
nullptr;
3657 static unsigned getNumAddressingBits(
const ASTContext &Context,
3659 const llvm::APInt &NumElements);
3661 unsigned getNumAddressingBits(
const ASTContext &Context)
const;
3665 static unsigned getMaxSizeBits(
const ASTContext &Context);
3668 Profile(
ID, Ctx, getElementType(), getZExtSize(), getSizeExpr(),
3669 getSizeModifier(), getIndexTypeCVRQualifiers());
3672 static void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Ctx,
3704 :
ArrayType(IncompleteArray, et, can, sm, tq) {}
3717 Profile(
ID, getElementType(), getSizeModifier(),
3718 getIndexTypeCVRQualifiers());
3724 ID.AddInteger(llvm::to_underlying(SizeMod));
3725 ID.AddInteger(TypeQuals);
3756 :
ArrayType(VariableArray, et, can, sm, tq, e),
3757 SizeExpr((
Stmt*) e), Brackets(brackets) {}
3765 return (
Expr*) SizeExpr;
3780 llvm_unreachable(
"Cannot unique VariableArrayTypes.");
3820 return (
Expr*) SizeExpr;
3835 Profile(
ID, Context, getElementType(),
3836 getSizeModifier(), getIndexTypeCVRQualifiers(), getSizeExpr());
3839 static void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
3841 unsigned TypeQuals,
Expr *E);
3858 Expr *AddrSpaceExpr;
3878 Profile(
ID, Context, getPointeeType(), getAddrSpaceExpr());
3881 static void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
3921 Profile(
ID, Context, getElementType(), getSizeExpr());
3924 static void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
3990 Profile(
ID, getElementType(), getNumElements(),
3991 getTypeClass(), getVectorKind());
3998 ID.AddInteger(NumElements);
4000 ID.AddInteger(llvm::to_underlying(VecKind));
4043 Profile(
ID, Context, getElementType(), getSizeExpr(), getVectorKind());
4046 static void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
4061 :
VectorType(ExtVector, vecType, nElements, canonType,
4068 case 'x':
case 'r':
return 0;
4069 case 'y':
case 'g':
return 1;
4070 case 'z':
case 'b':
return 2;
4071 case 'w':
case 'a':
return 3;
4089 case 'a':
return 10;
4091 case 'b':
return 11;
4093 case 'c':
return 12;
4095 case 'd':
return 13;
4097 case 'e':
return 14;
4099 case 'f':
return 15;
4104 if (isNumericAccessor)
4105 return getNumericAccessorIdx(
c);
4107 return getPointAccessorIdx(
c);
4111 if (
int idx = getAccessorIdx(
c, isNumericAccessor)+1)
4112 return unsigned(idx-1) < getNumElements();
4137 const Expr *RowExpr =
nullptr,
const Expr *ColumnExpr =
nullptr);
4171 static constexpr unsigned MaxElementsPerDimension = (1 << 20) - 1;
4174 unsigned NColumns,
QualType CanonElementType);
4177 unsigned NColumns,
QualType CanonElementType);
4188 return getNumRows() * getNumColumns();
4193 return NumElements > 0 && NumElements <= MaxElementsPerDimension;
4198 return MaxElementsPerDimension;
4202 Profile(
ID, getElementType(), getNumRows(), getNumColumns(),
4207 unsigned NumRows,
unsigned NumColumns,
4210 ID.AddInteger(NumRows);
4211 ID.AddInteger(NumColumns);
4243 Profile(
ID, Context, getElementType(), getRowExpr(), getColumnExpr());
4246 static void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
4282 HasPassObjSize = 0x20,
4285 unsigned char Data = 0;
4294 copy.Data = (copy.Data & ~ABIMask) |
unsigned(kind);
4304 copy.Data |= IsConsumed;
4306 copy.Data &= ~IsConsumed;
4313 Copy.Data |= HasPassObjSize;
4321 Copy.Data |= IsNoEscape;
4323 Copy.Data &= ~IsNoEscape;
4335 return lhs.Data == rhs.Data;
4339 return lhs.Data != rhs.Data;
4374 enum { CallConvMask = 0x1F };
4375 enum { NoReturnMask = 0x20 };
4376 enum { ProducesResultMask = 0x40 };
4377 enum { NoCallerSavedRegsMask = 0x80 };
4379 RegParmMask = 0x700,
4382 enum { NoCfCheckMask = 0x800 };
4383 enum { CmseNSCallMask = 0x1000 };
4384 uint16_t Bits =
CC_C;
4386 ExtInfo(
unsigned Bits) : Bits(static_cast<uint16_t>(Bits)) {}
4392 bool producesResult,
bool noCallerSavedRegs,
bool NoCfCheck,
4394 assert((!hasRegParm || regParm < 7) &&
"Invalid regparm value");
4395 Bits = ((
unsigned)cc) | (noReturn ? NoReturnMask : 0) |
4396 (producesResult ? ProducesResultMask : 0) |
4397 (noCallerSavedRegs ? NoCallerSavedRegsMask : 0) |
4398 (hasRegParm ? ((regParm + 1) << RegParmOffset) : 0) |
4399 (NoCfCheck ? NoCfCheckMask : 0) |
4400 (cmseNSCall ? CmseNSCallMask : 0);
4416 bool getHasRegParm()
const {
return ((Bits & RegParmMask) >> RegParmOffset) != 0; }
4419 unsigned RegParm = (Bits & RegParmMask) >> RegParmOffset;
4428 return Bits ==
Other.Bits;
4431 return Bits !=
Other.Bits;
4439 return ExtInfo(Bits | NoReturnMask);
4441 return ExtInfo(Bits & ~NoReturnMask);
4446 return ExtInfo(Bits | ProducesResultMask);
4448 return ExtInfo(Bits & ~ProducesResultMask);
4453 return ExtInfo(Bits | CmseNSCallMask);
4455 return ExtInfo(Bits & ~CmseNSCallMask);
4459 if (noCallerSavedRegs)
4460 return ExtInfo(Bits | NoCallerSavedRegsMask);
4462 return ExtInfo(Bits & ~NoCallerSavedRegsMask);
4467 return ExtInfo(Bits | NoCfCheckMask);
4469 return ExtInfo(Bits & ~NoCfCheckMask);
4473 assert(RegParm < 7 &&
"Invalid regparm value");
4474 return ExtInfo((Bits & ~RegParmMask) |
4475 ((RegParm + 1) << RegParmOffset));
4479 return ExtInfo((Bits & ~CallConvMask) | (
unsigned) cc);
4483 ID.AddInteger(Bits);
4501 LLVM_PREFERRED_TYPE(
bool)
4505 : NumExceptionType(0), HasArmTypeAttributes(
false) {}
4512 SME_NormalFunction = 0,
4513 SME_PStateSMEnabledMask = 1 << 0,
4514 SME_PStateSMCompatibleMask = 1 << 1,
4518 SME_ZAMask = 0b111 << SME_ZAShift,
4520 SME_ZT0Mask = 0b111 << SME_ZT0Shift,
4536 return (
ArmStateValue)((AttrBits & SME_ZAMask) >> SME_ZAShift);
4540 return (
ArmStateValue)((AttrBits & SME_ZT0Mask) >> SME_ZT0Shift);
4558 FunctionTypeBits.ExtInfo = Info.Bits;
4562 if (isFunctionProtoType())
4563 return Qualifiers::fromFastMask(FunctionTypeBits.FastTypeQuals);
4583 static_assert((
~Qualifiers::FastMask & Qualifiers::CVRMask) == 0,
4584 "Const, volatile and restrict are assumed to be a subset of "
4585 "the fast qualifiers.");
4587 bool isConst()
const {
return getFastTypeQuals().hasConst(); }
4588 bool isVolatile()
const {
return getFastTypeQuals().hasVolatile(); }
4589 bool isRestrict()
const {
return getFastTypeQuals().hasRestrict(); }
4597 static StringRef getNameForCallConv(
CallingConv CC);
4612 Result->getDependence() &
4624 Profile(
ID, getReturnType(), getExtInfo());
4647 public llvm::FoldingSetNode,
4648 private llvm::TrailingObjects<
4649 FunctionProtoType, QualType, SourceLocation,
4650 FunctionType::FunctionTypeExtraBitfields,
4651 FunctionType::FunctionTypeArmAttributes, FunctionType::ExceptionType,
4652 Expr *, FunctionDecl *, FunctionType::ExtParameterInfo, Qualifiers> {
4654 friend TrailingObjects;
4744 AArch64SMEAttributes(SME_NormalFunction) {}
4748 AArch64SMEAttributes(SME_NormalFunction) {}
4752 Result.ExceptionSpec = ESI;
4758 requiresFunctionProtoTypeArmAttributes();
4762 return AArch64SMEAttributes != SME_NormalFunction;
4767 AArch64SMEAttributes |= Kind;
4769 AArch64SMEAttributes &= ~Kind;
4774 unsigned numTrailingObjects(OverloadToken<QualType>)
const {
4775 return getNumParams();
4778 unsigned numTrailingObjects(OverloadToken<SourceLocation>)
const {
4779 return isVariadic();
4782 unsigned numTrailingObjects(OverloadToken<FunctionTypeArmAttributes>)
const {
4783 return hasArmTypeAttributes();
4786 unsigned numTrailingObjects(OverloadToken<FunctionTypeExtraBitfields>)
const {
4787 return hasExtraBitfields();
4790 unsigned numTrailingObjects(OverloadToken<ExceptionType>)
const {
4791 return getExceptionSpecSize().NumExceptionType;
4794 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
4795 return getExceptionSpecSize().NumExprPtr;
4798 unsigned numTrailingObjects(OverloadToken<FunctionDecl *>)
const {
4799 return getExceptionSpecSize().NumFunctionDeclPtr;
4802 unsigned numTrailingObjects(OverloadToken<ExtParameterInfo>)
const {
4803 return hasExtParameterInfos() ? getNumParams() : 0;
4808 static bool containsAnyUnexpandedParameterPack(
const QualType *ArgArray,
4810 for (
unsigned Idx = 0; Idx < numArgs; ++Idx)
4811 if (ArgArray[Idx]->containsUnexpandedParameterPack())
4817 FunctionProtoType(QualType result, ArrayRef<QualType> params,
4818 QualType canonical,
const ExtProtoInfo &epi);
4823 struct ExceptionSpecSizeHolder {
4824 unsigned NumExceptionType;
4825 unsigned NumExprPtr;
4826 unsigned NumFunctionDeclPtr;
4831 static ExceptionSpecSizeHolder
4832 getExceptionSpecSize(ExceptionSpecificationType EST,
unsigned NumExceptions) {
4843 return {NumExceptions, 0, 0};
4856 llvm_unreachable(
"bad exception specification kind");
4861 ExceptionSpecSizeHolder getExceptionSpecSize()
const {
4862 return getExceptionSpecSize(getExceptionSpecType(), getNumExceptions());
4866 bool hasExtraBitfields()
const {
4867 assert((getExceptionSpecType() != EST_Dynamic ||
4868 FunctionTypeBits.HasExtraBitfields) &&
4869 "ExtraBitfields are required for given ExceptionSpecType");
4870 return FunctionTypeBits.HasExtraBitfields;
4874 bool hasArmTypeAttributes()
const {
4875 return FunctionTypeBits.HasExtraBitfields &&
4876 getTrailingObjects<FunctionTypeExtraBitfields>()
4877 ->HasArmTypeAttributes;
4880 bool hasExtQualifiers()
const {
4881 return FunctionTypeBits.HasExtQuals;
4888 assert(i < getNumParams() &&
"invalid parameter index");
4889 return param_type_begin()[i];
4913 FunctionTypeBits.ExceptionSpecType);
4930 bool hasDependentExceptionSpec()
const;
4934 bool hasInstantiationDependentExceptionSpec()
const;
4939 Result.Type = getExceptionSpecType();
4941 Result.Exceptions = exceptions();
4943 Result.NoexceptExpr = getNoexceptExpr();
4945 Result.SourceDecl = getExceptionSpecDecl();
4946 Result.SourceTemplate = getExceptionSpecTemplate();
4948 Result.SourceDecl = getExceptionSpecDecl();
4956 ? getTrailingObjects<FunctionTypeExtraBitfields>()
4963 assert(i < getNumExceptions() &&
"Invalid exception number!");
4964 return exception_begin()[i];
4972 return *getTrailingObjects<Expr *>();
4983 return getTrailingObjects<FunctionDecl *>()[0];
4993 return getTrailingObjects<FunctionDecl *>()[1];
5004 return ResultIfDependent ? canThrow() !=
CT_Can : canThrow() ==
CT_Cannot;
5011 return isVariadic() ? *getTrailingObjects<SourceLocation>()
5021 bool isTemplateVariadic()
const;
5027 if (hasExtQualifiers())
5028 return *getTrailingObjects<Qualifiers>();
5030 return getFastTypeQuals();
5045 return getTrailingObjects<QualType>();
5049 return param_type_begin() + getNumParams();
5060 getTrailingObjects<ExceptionType>());
5064 return exception_begin() + getNumExceptions();
5070 return FunctionTypeBits.HasExtParameterInfos;
5074 assert(hasExtParameterInfos());
5083 if (!hasExtParameterInfos())
5085 return getTrailingObjects<ExtParameterInfo>();
5091 if (!hasArmTypeAttributes())
5092 return SME_NormalFunction;
5093 return getTrailingObjects<FunctionTypeArmAttributes>()
5094 ->AArch64SMEAttributes;
5098 assert(I < getNumParams() &&
"parameter index out of range");
5099 if (hasExtParameterInfos())
5100 return getTrailingObjects<ExtParameterInfo>()[I];
5105 assert(I < getNumParams() &&
"parameter index out of range");
5106 if (hasExtParameterInfos())
5107 return getTrailingObjects<ExtParameterInfo>()[I].getABI();
5108 return ParameterABI::Ordinary;
5112 assert(I < getNumParams() &&
"parameter index out of range");
5113 if (hasExtParameterInfos())
5114 return getTrailingObjects<ExtParameterInfo>()[I].isConsumed();
5121 void printExceptionSpecification(raw_ostream &OS,
5128 void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Ctx);
5161 return Profile(
ID,
Decl);
5171 public llvm::FoldingSetNode,
5172 private llvm::TrailingObjects<UsingType, QualType> {
5175 friend TrailingObjects;
5196 ID.AddPointer(Found);
5203 public llvm::FoldingSetNode,
5204 private llvm::TrailingObjects<TypedefType, QualType> {
5207 friend TrailingObjects;
5229 if (!Underlying.
isNull())
5246 :
Type(MacroQualified, CanonTy, UnderlyingTy->getDependence()),
5247 UnderlyingTy(UnderlyingTy), MacroII(MacroII) {
5248 assert(isa<AttributedType>(UnderlyingTy) &&
5249 "Expected a macro qualified type to only wrap attributed types.");
5283 return TypeOfBits.IsUnqual ? TypeOfKind::Unqualified
5284 : TypeOfKind::Qualified;
5291 bool isSugared()
const;
5303 public llvm::FoldingSetNode {
5308 Profile(
ID, Context, getUnderlyingExpr(),
5309 getKind() == TypeOfKind::Unqualified);
5312 static void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
5313 Expr *E,
bool IsUnqual);
5327 T->getDependence()),
5329 TypeOfBits.IsUnqual = Kind == TypeOfKind::Unqualified;
5346 return TypeOfBits.IsUnqual ? TypeOfKind::Unqualified
5347 : TypeOfKind::Qualified;
5371 bool isSugared()
const;
5387 Profile(
ID, Context, getUnderlyingExpr());
5390 static void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
5396 public llvm::FoldingSetNode,
5397 private llvm::TrailingObjects<PackIndexingType, QualType> {
5398 friend TrailingObjects;
5419 if (hasSelectedType())
5420 return getSelectedType();
5425 assert(hasSelectedType() &&
"Type is dependant");
5426 return *(getExpansionsPtr() + *getSelectedIndex());
5429 std::optional<unsigned> getSelectedIndex()
const;
5434 return {getExpansionsPtr(), Size};
5442 if (hasSelectedType())
5443 getSelectedType().Profile(
ID);
5445 Profile(
ID, Context, getPattern(), getIndexExpr());
5447 static void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
5451 const QualType *getExpansionsPtr()
const {
5452 return getTrailingObjects<QualType>();
5455 static TypeDependence computeDependence(QualType Pattern, Expr *IndexExpr,
5456 ArrayRef<QualType> Expansions = {});
5458 unsigned numTrailingObjects(OverloadToken<QualType>)
const {
return Size; }
5465#define TRANSFORM_TYPE_TRAIT_DEF(Enum, _) Enum,
5466#include "clang/Basic/TransformTypeTraits.def"
5474 QualType UnderlyingType;
5505 public llvm::FoldingSetNode {
5511 Profile(
ID, getBaseType(), getUTTKind());
5517 ID.AddInteger((
unsigned)UKind);
5536 bool isBeingDefined()
const;
5556 return reinterpret_cast<RecordDecl*
>(TagType::getDecl());
5561 bool hasConstFields()
const;
5579 return reinterpret_cast<EnumDecl*
>(TagType::getDecl());
5612 :
Type(Attributed, canon, equivalent->getDependence()),
5613 ModifiedType(modified), EquivalentType(equivalent) {
5614 AttributedTypeBits.AttrKind = attrKind;
5619 return static_cast<Kind>(AttributedTypeBits.AttrKind);
5643 bool isQualifier()
const;
5645 bool isMSTypeSpec()
const;
5647 bool isWebAssemblyFuncrefSpec()
const;
5649 bool isCallingConv()
const;
5651 std::optional<NullabilityKind> getImmediateNullability()
const;
5657 case NullabilityKind::NonNull:
5658 return attr::TypeNonNull;
5660 case NullabilityKind::Nullable:
5661 return attr::TypeNullable;
5663 case NullabilityKind::NullableResult:
5664 return attr::TypeNullableResult;
5666 case NullabilityKind::Unspecified:
5667 return attr::TypeNullUnspecified;
5669 llvm_unreachable(
"Unknown nullability kind.");
5681 static std::optional<NullabilityKind> stripOuterNullability(
QualType &T);
5684 Profile(
ID, getAttrKind(), ModifiedType, EquivalentType);
5689 ID.AddInteger(attrKind);
5704 const BTFTypeTagAttr *BTFAttr;
5707 const BTFTypeTagAttr *BTFAttr)
5708 :
Type(BTFTagAttributed, Canon, Wrapped->getDependence()),
5709 WrappedType(Wrapped), BTFAttr(BTFAttr) {}
5713 const BTFTypeTagAttr *
getAttr()
const {
return BTFAttr; }
5719 Profile(
ID, WrappedType, BTFAttr);
5723 const BTFTypeTagAttr *BTFAttr) {
5725 ID.AddPointer(BTFAttr);
5737 struct CanonicalTTPTInfo {
5738 unsigned Depth : 15;
5739 unsigned ParameterPack : 1;
5740 unsigned Index : 16;
5753 :
Type(TemplateTypeParm, Canon,
5759 TemplateTypeParmType(
unsigned D,
unsigned I,
bool PP)
5760 :
Type(TemplateTypeParm, QualType(this, 0),
5761 TypeDependence::DependentInstantiation |
5762 (PP ? TypeDependence::UnexpandedPack : TypeDependence::
None)) {
5763 CanTTPTInfo.Depth = D;
5764 CanTTPTInfo.Index = I;
5765 CanTTPTInfo.ParameterPack = PP;
5768 const CanonicalTTPTInfo& getCanTTPTInfo()
const {
5769 QualType Can = getCanonicalTypeInternal();
5770 return Can->castAs<TemplateTypeParmType>()->CanTTPTInfo;
5774 unsigned getDepth()
const {
return getCanTTPTInfo().Depth; }
5775 unsigned getIndex()
const {
return getCanTTPTInfo().Index; }
5779 return isCanonicalUnqualified() ? nullptr : TTPDecl;
5791 static void Profile(llvm::FoldingSetNodeID &
ID,
unsigned Depth,
5792 unsigned Index,
bool ParameterPack,
5794 ID.AddInteger(Depth);
5795 ID.AddInteger(Index);
5796 ID.AddBoolean(ParameterPack);
5797 ID.AddPointer(TTPDecl);
5814 public llvm::FoldingSetNode,
5815 private llvm::TrailingObjects<SubstTemplateTypeParmType, QualType> {
5819 Decl *AssociatedDecl;
5822 unsigned Index, std::optional<unsigned> PackIndex);
5828 return SubstTemplateTypeParmTypeBits.HasNonCanonicalUnderlyingType
5829 ? *getTrailingObjects<QualType>()
5830 : getCanonicalTypeInternal();
5843 unsigned getIndex()
const {
return SubstTemplateTypeParmTypeBits.Index; }
5846 if (SubstTemplateTypeParmTypeBits.PackIndex == 0)
5847 return std::nullopt;
5848 return SubstTemplateTypeParmTypeBits.PackIndex - 1;
5855 Profile(
ID, getReplacementType(), getAssociatedDecl(), getIndex(),
5860 const Decl *AssociatedDecl,
unsigned Index,
5861 std::optional<unsigned> PackIndex) {
5862 Replacement.Profile(
ID);
5863 ID.AddPointer(AssociatedDecl);
5864 ID.AddInteger(Index);
5865 ID.AddInteger(PackIndex ? *PackIndex - 1 : 0);
5892 llvm::PointerIntPair<Decl *, 1, bool> AssociatedDeclAndFinal;
5895 unsigned Index,
bool Final,
5904 Decl *getAssociatedDecl()
const;
5911 unsigned getIndex()
const {
return SubstTemplateTypeParmPackTypeBits.Index; }
5914 bool getFinal()
const;
5917 return SubstTemplateTypeParmPackTypeBits.NumArgs;
5925 void Profile(llvm::FoldingSetNodeID &
ID);
5926 static void Profile(llvm::FoldingSetNodeID &
ID,
const Decl *AssociatedDecl,
5927 unsigned Index,
bool Final,
5950 ExtraDependence | (DeducedAsType.isNull()
5952 : DeducedAsType->getDependence() &
5954 DeducedAsType(DeducedAsType) {}
5959 return isSugared() ? DeducedAsType :
QualType(
this, 0);
5966 return !DeducedAsType.
isNull() || isDependentType();
5989 AutoTypeBits.NumArgs};
5993 return TypeConstraintConcept;
5997 return TypeConstraintConcept !=
nullptr;
6001 return getKeyword() == AutoTypeKeyword::DecltypeAuto;
6005 return getKeyword() == AutoTypeKeyword::GNUAutoType;
6012 void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context);
6013 static void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
6025 public llvm::FoldingSetNode {
6033 bool IsDeducedAsDependent)
6034 :
DeducedType(DeducedTemplateSpecialization, DeducedAsType,
6036 (IsDeducedAsDependent
6039 DeducedAsType.isNull() ?
QualType(this, 0)
6040 : DeducedAsType.getCanonicalType()),
6041 Template(Template) {}
6048 Profile(
ID, getTemplateName(), getDeducedType(), isDependentType());
6052 QualType Deduced,
bool IsDependent) {
6120 static bool anyInstantiationDependentTemplateArguments(
6126 return isa<InjectedClassNameType>(getCanonicalTypeInternal());
6144 bool isTypeAlias()
const {
return TemplateSpecializationTypeBits.TypeAlias; }
6155 TemplateSpecializationTypeBits.NumArgs};
6159 return !isDependentType() || isCurrentInstantiation() || isTypeAlias();
6163 return isTypeAlias() ? getAliasedType() : getCanonicalTypeInternal();
6166 void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Ctx);
6178void printTemplateArgumentList(raw_ostream &OS,
6179 ArrayRef<TemplateArgument> Args,
6180 const PrintingPolicy &Policy,
6181 const TemplateParameterList *TPL =
nullptr);
6183void printTemplateArgumentList(raw_ostream &OS,
6184 ArrayRef<TemplateArgumentLoc> Args,
6185 const PrintingPolicy &Policy,
6186 const TemplateParameterList *TPL =
nullptr);
6188void printTemplateArgumentList(raw_ostream &OS,
6189 const TemplateArgumentListInfo &Args,
6190 const PrintingPolicy &Policy,
6191 const TemplateParameterList *TPL =
nullptr);
6195bool isSubstitutedDefaultArgument(ASTContext &Ctx, TemplateArgument Arg,
6196 const NamedDecl *Param,
6197 ArrayRef<TemplateArgument> Args,
6241 Decl(D), InjectedType(TST) {
6242 assert(isa<TemplateSpecializationType>(TST));
6251 return cast<TemplateSpecializationType>(InjectedType.
getTypePtr());
6255 return getInjectedTST()->getTemplateName();
6321 TypeWithKeywordBits.Keyword = llvm::to_underlying(Keyword);
6334 static TagTypeKind getTagTypeKindForTypeSpec(
unsigned TypeSpec);
6349 return getKeywordName(getKeywordForTagTypeKind(Kind));
6366 public llvm::FoldingSetNode,
6367 private llvm::TrailingObjects<ElaboratedType, TagDecl *> {
6369 friend TrailingObjects;
6388 NamedType->getDependence() |
6392 NNS(NNS), NamedType(NamedType) {
6393 ElaboratedTypeBits.HasOwnedTagDecl =
false;
6395 ElaboratedTypeBits.HasOwnedTagDecl =
true;
6396 *getTrailingObjects<TagDecl *>() = OwnedTagDecl;
6416 return ElaboratedTypeBits.HasOwnedTagDecl ? *getTrailingObjects<TagDecl *>()
6421 Profile(
ID, getKeyword(), NNS, NamedType, getOwnedTagDecl());
6427 ID.AddInteger(llvm::to_underlying(Keyword));
6430 ID.AddPointer(OwnedTagDecl);
6462 NNS(NNS), Name(Name) {}
6481 Profile(
ID, getKeyword(), NNS, Name);
6486 ID.AddInteger(llvm::to_underlying(Keyword));
6488 ID.AddPointer(Name);
6500 public llvm::FoldingSetNode {
6521 DependentTemplateSpecializationTypeBits.NumArgs};
6528 Profile(
ID, Context, getKeyword(), NNS, Name, template_arguments());
6531 static void Profile(llvm::FoldingSetNodeID &
ID,
6539 return T->
getTypeClass() == DependentTemplateSpecialization;
6572 std::optional<unsigned> NumExpansions)
6573 :
Type(PackExpansion, Canon,
6578 PackExpansionTypeBits.NumExpansions =
6579 NumExpansions ? *NumExpansions + 1 : 0;
6591 if (PackExpansionTypeBits.NumExpansions)
6592 return PackExpansionTypeBits.NumExpansions - 1;
6593 return std::nullopt;
6600 Profile(
ID, getPattern(), getNumExpansions());
6604 std::optional<unsigned> NumExpansions) {
6606 ID.AddBoolean(NumExpansions.has_value());
6608 ID.AddInteger(*NumExpansions);
6628 return static_cast<T*
>(
this)->getProtocolStorageImpl();
6632 static_cast<T*
>(
this)->setNumProtocolsImpl(N);
6636 setNumProtocols(protocols.size());
6637 assert(getNumProtocols() == protocols.size() &&
6638 "bitfield overflow in protocol count");
6639 if (!protocols.empty())
6640 memcpy(getProtocolStorage(), protocols.data(),
6657 return static_cast<const T*
>(
this)->getNumProtocolsImpl();
6662 assert(I < getNumProtocols() &&
"Out-of-range protocol access");
6663 return qual_begin()[I];
6676 public llvm::FoldingSetNode {
6681 unsigned NumProtocols : 6;
6692 unsigned getNumProtocolsImpl()
const {
6693 return NumProtocols;
6696 void setNumProtocolsImpl(
unsigned N) {
6700 ObjCTypeParamType(
const ObjCTypeParamDecl *D,
6702 ArrayRef<ObjCProtocolDecl *> protocols);
6712 void Profile(llvm::FoldingSetNodeID &
ID);
6713 static void Profile(llvm::FoldingSetNodeID &
ID,
6769 mutable llvm::PointerIntPair<const ObjCObjectType *, 1, bool>
6770 CachedSuperClassType;
6773 const QualType *getTypeArgStorage()
const {
6780 unsigned getNumProtocolsImpl()
const {
6781 return ObjCObjectTypeBits.NumProtocols;
6783 void setNumProtocolsImpl(
unsigned N) {
6784 ObjCObjectTypeBits.NumProtocols = N;
6798 ObjCObjectTypeBits.NumProtocols = 0;
6799 ObjCObjectTypeBits.NumTypeArgs = 0;
6800 ObjCObjectTypeBits.IsKindOf = 0;
6803 void computeSuperClassTypeSlow()
const;
6815 return getBaseType()->isSpecificBuiltinType(BuiltinType::ObjCId);
6819 return getBaseType()->isSpecificBuiltinType(BuiltinType::ObjCClass);
6825 if (!qual_empty())
return false;
6826 if (
const BuiltinType *
T = getBaseType()->getAs<BuiltinType>())
6827 return T->getKind() == BuiltinType::ObjCId ||
6828 T->getKind() == BuiltinType::ObjCClass;
6840 bool isSpecialized()
const;
6844 return ObjCObjectTypeBits.NumTypeArgs > 0;
6861 return llvm::ArrayRef(getTypeArgStorage(), ObjCObjectTypeBits.NumTypeArgs);
6868 bool isKindOfType()
const;
6877 if (!CachedSuperClassType.getInt())
6878 computeSuperClassTypeSlow();
6880 assert(CachedSuperClassType.getInt() &&
"Superclass not set?");
6881 return QualType(CachedSuperClassType.getPointer(), 0);
6914 void Profile(llvm::FoldingSetNodeID &
ID);
6915 static void Profile(llvm::FoldingSetNodeID &
ID,
6922inline QualType *ObjCObjectType::getTypeArgStorage() {
6923 return reinterpret_cast<QualType *
>(
static_cast<ObjCObjectTypeImpl*
>(
this)+1);
6926inline ObjCProtocolDecl **ObjCObjectType::getProtocolStorageImpl() {
6927 return reinterpret_cast<ObjCProtocolDecl**
>(
6928 getTypeArgStorage() + ObjCObjectTypeBits.NumTypeArgs);
6931inline ObjCProtocolDecl **ObjCTypeParamType::getProtocolStorageImpl() {
6932 return reinterpret_cast<ObjCProtocolDecl**
>(
6933 static_cast<ObjCTypeParamType*
>(
this)+1);
6986 if (
const auto *
T = dyn_cast<ObjCInterfaceType>(ObjT))
6987 return T->getDecl();
6989 baseType = ObjT->getBaseType();
7010 :
Type(ObjCObjectPointer, Canonical, Pointee->getDependence()),
7011 PointeeType(Pointee) {}
7154 QualType getSuperClassType()
const;
7162 Profile(
ID, getPointeeType());
7166 ID.AddPointer(
T.getAsOpaquePtr());
7180 :
Type(
Atomic, Canonical, ValTy->getDependence()), ValueType(ValTy) {}
7191 Profile(
ID, getValueType());
7195 ID.AddPointer(
T.getAsOpaquePtr());
7211 :
Type(
Pipe, CanonicalPtr, elemType->getDependence()),
7222 Profile(
ID, getElementType(), isReadOnly());
7226 ID.AddPointer(
T.getAsOpaquePtr());
7240 LLVM_PREFERRED_TYPE(
bool)
7241 unsigned IsUnsigned : 1;
7242 unsigned NumBits : 24;
7259 static void Profile(llvm::FoldingSetNodeID &
ID,
bool IsUnsigned,
7261 ID.AddBoolean(IsUnsigned);
7262 ID.AddInteger(NumBits);
7270 llvm::PointerIntPair<Expr*, 1, bool> ExprAndUnsigned;
7278 Expr *getNumBitsExpr()
const;
7286 static void Profile(llvm::FoldingSetNodeID &
ID,
const ASTContext &Context,
7287 bool IsUnsigned,
Expr *NumBitsExpr);
7303 addFastQualifiers(
type.getLocalFastQualifiers());
7304 if (!
type.hasLocalNonFastQualifiers())
7305 return type.getTypePtrUnsafe();
7350 Ty->getLocallyUnqualifiedSingleStepDesugaredType().split();
7355inline const Type *QualType::getTypePtr()
const {
7356 return getCommonPtr()->BaseType;
7359inline const Type *QualType::getTypePtrOrNull()
const {
7360 return (isNull() ?
nullptr : getCommonPtr()->BaseType);
7363inline bool QualType::isReferenceable()
const {
7367 const Type &Self = **
this;
7368 if (Self.isObjectType() || Self.isReferenceType())
7371 return F->getMethodQuals().empty() && F->getRefQualifier() ==
RQ_None;
7377 if (!hasLocalNonFastQualifiers())
7379 Qualifiers::fromFastMask(getLocalFastQualifiers()));
7381 const ExtQuals *eq = getExtQualsUnsafe();
7389 if (hasLocalNonFastQualifiers())
7390 Quals = getExtQualsUnsafe()->getQualifiers();
7396 Qualifiers quals = getCommonPtr()->CanonicalType.getLocalQualifiers();
7401inline unsigned QualType::getCVRQualifiers()
const {
7402 unsigned cvr = getCommonPtr()->CanonicalType.getLocalCVRQualifiers();
7403 cvr |= getLocalCVRQualifiers();
7408 QualType canon = getCommonPtr()->CanonicalType;
7412inline bool QualType::isCanonical()
const {
7416inline bool QualType::isCanonicalAsParam()
const {
7417 if (!isCanonical())
return false;
7418 if (hasLocalQualifiers())
return false;
7420 const Type *
T = getTypePtr();
7424 return !isa<FunctionType>(
T) &&
7425 (!isa<ArrayType>(
T) || isa<ArrayParameterType>(
T));
7428inline bool QualType::isConstQualified()
const {
7429 return isLocalConstQualified() ||
7430 getCommonPtr()->CanonicalType.isLocalConstQualified();
7433inline bool QualType::isRestrictQualified()
const {
7434 return isLocalRestrictQualified() ||
7435 getCommonPtr()->CanonicalType.isLocalRestrictQualified();
7439inline bool QualType::isVolatileQualified()
const {
7440 return isLocalVolatileQualified() ||
7441 getCommonPtr()->CanonicalType.isLocalVolatileQualified();
7444inline bool QualType::hasQualifiers()
const {
7445 return hasLocalQualifiers() ||
7446 getCommonPtr()->CanonicalType.hasLocalQualifiers();
7450 if (!getTypePtr()->getCanonicalTypeInternal().hasLocalQualifiers())
7453 return QualType(getSplitUnqualifiedTypeImpl(*this).Ty, 0);
7457 if (!getTypePtr()->getCanonicalTypeInternal().hasLocalQualifiers())
7460 return getSplitUnqualifiedTypeImpl(*
this);
7463inline void QualType::removeLocalConst() {
7464 removeLocalFastQualifiers(Qualifiers::Const);
7467inline void QualType::removeLocalRestrict() {
7468 removeLocalFastQualifiers(Qualifiers::Restrict);
7471inline void QualType::removeLocalVolatile() {
7472 removeLocalFastQualifiers(Qualifiers::Volatile);
7476inline bool QualType::hasAddressSpace()
const {
7477 return getQualifiers().hasAddressSpace();
7481inline LangAS QualType::getAddressSpace()
const {
7482 return getQualifiers().getAddressSpace();
7487 return getQualifiers().getObjCGCAttr();
7490inline bool QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion()
const {
7491 if (
auto *RD = getTypePtr()->getBaseElementTypeUnsafe()->
getAsRecordDecl())
7492 return hasNonTrivialToPrimitiveDefaultInitializeCUnion(RD);
7496inline bool QualType::hasNonTrivialToPrimitiveDestructCUnion()
const {
7497 if (
auto *RD = getTypePtr()->getBaseElementTypeUnsafe()->
getAsRecordDecl())
7498 return hasNonTrivialToPrimitiveDestructCUnion(RD);
7502inline bool QualType::hasNonTrivialToPrimitiveCopyCUnion()
const {
7503 if (
auto *RD = getTypePtr()->getBaseElementTypeUnsafe()->
getAsRecordDecl())
7504 return hasNonTrivialToPrimitiveCopyCUnion(RD);
7510 if (
const auto *FT = PT->getPointeeType()->getAs<
FunctionType>())
7511 return FT->getExtInfo();
7513 return FT->getExtInfo();
7527inline bool QualType::isMoreQualifiedThan(
QualType other)
const {
7537inline bool QualType::isAtLeastAsQualifiedAs(
QualType other)
const {
7541 if (getUnqualifiedType()->isVoidType())
7544 return getQualifiers().compatiblyIncludes(OtherQuals);
7563inline bool QualType::isCForbiddenLValueType()
const {
7564 return ((getTypePtr()->isVoidType() && !hasQualifiers()) ||
7565 getTypePtr()->isFunctionType());
7571inline bool Type::isFundamentalType()
const {
7572 return isVoidType() ||
7576 (isArithmeticType() && !isEnumeralType());
7582inline bool Type::isCompoundType()
const {
7586 return isArrayType() ||
7592 isReferenceType() ||
7601 isMemberPointerType();
7604inline bool Type::isFunctionType()
const {
7605 return isa<FunctionType>(CanonicalType);
7608inline bool Type::isPointerType()
const {
7609 return isa<PointerType>(CanonicalType);
7612inline bool Type::isAnyPointerType()
const {
7613 return isPointerType() || isObjCObjectPointerType();
7616inline bool Type::isBlockPointerType()
const {
7617 return isa<BlockPointerType>(CanonicalType);
7620inline bool Type::isReferenceType()
const {
7621 return isa<ReferenceType>(CanonicalType);
7624inline bool Type::isLValueReferenceType()
const {
7625 return isa<LValueReferenceType>(CanonicalType);
7628inline bool Type::isRValueReferenceType()
const {
7629 return isa<RValueReferenceType>(CanonicalType);
7632inline bool Type::isObjectPointerType()
const {
7636 if (
const auto *
T = getAs<PointerType>())
7642inline bool Type::isFunctionPointerType()
const {
7643 if (
const auto *
T = getAs<PointerType>())
7649inline bool Type::isFunctionReferenceType()
const {
7650 if (
const auto *
T = getAs<ReferenceType>())
7656inline bool Type::isMemberPointerType()
const {
7657 return isa<MemberPointerType>(CanonicalType);
7660inline bool Type::isMemberFunctionPointerType()
const {
7661 if (
const auto *
T = getAs<MemberPointerType>())
7662 return T->isMemberFunctionPointer();
7667inline bool Type::isMemberDataPointerType()
const {
7668 if (
const auto *
T = getAs<MemberPointerType>())
7669 return T->isMemberDataPointer();
7674inline bool Type::isArrayType()
const {
7675 return isa<ArrayType>(CanonicalType);
7678inline bool Type::isConstantArrayType()
const {
7679 return isa<ConstantArrayType>(CanonicalType);
7682inline bool Type::isIncompleteArrayType()
const {
7683 return isa<IncompleteArrayType>(CanonicalType);
7686inline bool Type::isVariableArrayType()
const {
7687 return isa<VariableArrayType>(CanonicalType);
7690inline bool Type::isArrayParameterType()
const {
7691 return isa<ArrayParameterType>(CanonicalType);
7694inline bool Type::isDependentSizedArrayType()
const {
7695 return isa<DependentSizedArrayType>(CanonicalType);
7698inline bool Type::isBuiltinType()
const {
7699 return isa<BuiltinType>(CanonicalType);
7702inline bool Type::isRecordType()
const {
7703 return isa<RecordType>(CanonicalType);
7706inline bool Type::isEnumeralType()
const {
7707 return isa<EnumType>(CanonicalType);
7710inline bool Type::isAnyComplexType()
const {
7711 return isa<ComplexType>(CanonicalType);
7714inline bool Type::isVectorType()
const {
7715 return isa<VectorType>(CanonicalType);
7718inline bool Type::isExtVectorType()
const {
7719 return isa<ExtVectorType>(CanonicalType);
7722inline bool Type::isExtVectorBoolType()
const {
7723 if (!isExtVectorType())
7725 return cast<ExtVectorType>(CanonicalType)->getElementType()->isBooleanType();
7728inline bool Type::isMatrixType()
const {
7729 return isa<MatrixType>(CanonicalType);
7732inline bool Type::isConstantMatrixType()
const {
7733 return isa<ConstantMatrixType>(CanonicalType);
7736inline bool Type::isDependentAddressSpaceType()
const {
7737 return isa<DependentAddressSpaceType>(CanonicalType);
7740inline bool Type::isObjCObjectPointerType()
const {
7741 return isa<ObjCObjectPointerType>(CanonicalType);
7744inline bool Type::isObjCObjectType()
const {
7745 return isa<ObjCObjectType>(CanonicalType);
7748inline bool Type::isObjCObjectOrInterfaceType()
const {
7749 return isa<ObjCInterfaceType>(CanonicalType) ||
7750 isa<ObjCObjectType>(CanonicalType);
7753inline bool Type::isAtomicType()
const {
7754 return isa<AtomicType>(CanonicalType);
7757inline bool Type::isUndeducedAutoType()
const {
7758 return isa<AutoType>(CanonicalType);
7761inline bool Type::isObjCQualifiedIdType()
const {
7762 if (
const auto *OPT = getAs<ObjCObjectPointerType>())
7763 return OPT->isObjCQualifiedIdType();
7767inline bool Type::isObjCQualifiedClassType()
const {
7768 if (
const auto *OPT = getAs<ObjCObjectPointerType>())
7769 return OPT->isObjCQualifiedClassType();
7773inline bool Type::isObjCIdType()
const {
7774 if (
const auto *OPT = getAs<ObjCObjectPointerType>())
7775 return OPT->isObjCIdType();
7779inline bool Type::isObjCClassType()
const {
7780 if (
const auto *OPT = getAs<ObjCObjectPointerType>())
7781 return OPT->isObjCClassType();
7785inline bool Type::isObjCSelType()
const {
7786 if (
const auto *OPT = getAs<PointerType>())
7787 return OPT->getPointeeType()->isSpecificBuiltinType(BuiltinType::ObjCSel);
7791inline bool Type::isObjCBuiltinType()
const {
7792 return isObjCIdType() || isObjCClassType() || isObjCSelType();
7795inline bool Type::isDecltypeType()
const {
7796 return isa<DecltypeType>(
this);
7799#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
7800 inline bool Type::is##Id##Type() const { \
7801 return isSpecificBuiltinType(BuiltinType::Id); \
7803#include "clang/Basic/OpenCLImageTypes.def"
7805inline bool Type::isSamplerT()
const {
7806 return isSpecificBuiltinType(BuiltinType::OCLSampler);
7809inline bool Type::isEventT()
const {
7810 return isSpecificBuiltinType(BuiltinType::OCLEvent);
7813inline bool Type::isClkEventT()
const {
7814 return isSpecificBuiltinType(BuiltinType::OCLClkEvent);
7817inline bool Type::isQueueT()
const {
7818 return isSpecificBuiltinType(BuiltinType::OCLQueue);
7821inline bool Type::isReserveIDT()
const {
7822 return isSpecificBuiltinType(BuiltinType::OCLReserveID);
7825inline bool Type::isImageType()
const {
7826#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) is##Id##Type() ||
7828#include "clang/Basic/OpenCLImageTypes.def"
7832inline bool Type::isPipeType()
const {
7833 return isa<PipeType>(CanonicalType);
7836inline bool Type::isBitIntType()
const {
7837 return isa<BitIntType>(CanonicalType);
7840#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
7841 inline bool Type::is##Id##Type() const { \
7842 return isSpecificBuiltinType(BuiltinType::Id); \
7844#include "clang/Basic/OpenCLExtensionTypes.def"
7846inline bool Type::isOCLIntelSubgroupAVCType()
const {
7847#define INTEL_SUBGROUP_AVC_TYPE(ExtType, Id) \
7848 isOCLIntelSubgroupAVC##Id##Type() ||
7850#include "clang/Basic/OpenCLExtensionTypes.def"
7854inline bool Type::isOCLExtOpaqueType()
const {
7855#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) is##Id##Type() ||
7857#include "clang/Basic/OpenCLExtensionTypes.def"
7861inline bool Type::isOpenCLSpecificType()
const {
7862 return isSamplerT() || isEventT() || isImageType() || isClkEventT() ||
7863 isQueueT() || isReserveIDT() || isPipeType() || isOCLExtOpaqueType();
7866inline bool Type::isTemplateTypeParmType()
const {
7867 return isa<TemplateTypeParmType>(CanonicalType);
7870inline bool Type::isSpecificBuiltinType(
unsigned K)
const {
7871 if (
const BuiltinType *BT = getAs<BuiltinType>()) {
7877inline bool Type::isPlaceholderType()
const {
7878 if (
const auto *BT = dyn_cast<BuiltinType>(
this))
7879 return BT->isPlaceholderType();
7884 if (
const auto *BT = dyn_cast<BuiltinType>(
this))
7885 if (BT->isPlaceholderType())
7890inline bool Type::isSpecificPlaceholderType(
unsigned K)
const {
7892 return isSpecificBuiltinType(K);
7895inline bool Type::isNonOverloadPlaceholderType()
const {
7896 if (
const auto *BT = dyn_cast<BuiltinType>(
this))
7897 return BT->isNonOverloadPlaceholderType();
7901inline bool Type::isVoidType()
const {
7902 return isSpecificBuiltinType(BuiltinType::Void);
7905inline bool Type::isHalfType()
const {
7907 return isSpecificBuiltinType(BuiltinType::Half);
7910inline bool Type::isFloat16Type()
const {
7911 return isSpecificBuiltinType(BuiltinType::Float16);
7914inline bool Type::isFloat32Type()
const {
7915 return isSpecificBuiltinType(BuiltinType::Float);
7918inline bool Type::isDoubleType()
const {
7919 return isSpecificBuiltinType(BuiltinType::Double);
7922inline bool Type::isBFloat16Type()
const {
7923 return isSpecificBuiltinType(BuiltinType::BFloat16);
7926inline bool Type::isFloat128Type()
const {
7927 return isSpecificBuiltinType(BuiltinType::Float128);
7930inline bool Type::isIbm128Type()
const {
7931 return isSpecificBuiltinType(BuiltinType::Ibm128);
7934inline bool Type::isNullPtrType()
const {
7935 return isSpecificBuiltinType(BuiltinType::NullPtr);
7941inline bool Type::isIntegerType()
const {
7942 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType))
7943 return BT->getKind() >= BuiltinType::Bool &&
7944 BT->getKind() <= BuiltinType::Int128;
7945 if (
const EnumType *ET = dyn_cast<EnumType>(CanonicalType)) {
7951 return isBitIntType();
7954inline bool Type::isFixedPointType()
const {
7955 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType)) {
7956 return BT->getKind() >= BuiltinType::ShortAccum &&
7957 BT->getKind() <= BuiltinType::SatULongFract;
7962inline bool Type::isFixedPointOrIntegerType()
const {
7963 return isFixedPointType() || isIntegerType();
7966inline bool Type::isConvertibleToFixedPointType()
const {
7967 return isRealFloatingType() || isFixedPointOrIntegerType();
7970inline bool Type::isSaturatedFixedPointType()
const {
7971 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType)) {
7972 return BT->getKind() >= BuiltinType::SatShortAccum &&
7973 BT->getKind() <= BuiltinType::SatULongFract;
7978inline bool Type::isUnsaturatedFixedPointType()
const {
7979 return isFixedPointType() && !isSaturatedFixedPointType();
7982inline bool Type::isSignedFixedPointType()
const {
7983 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType)) {
7984 return ((BT->getKind() >= BuiltinType::ShortAccum &&
7985 BT->getKind() <= BuiltinType::LongAccum) ||
7986 (BT->getKind() >= BuiltinType::ShortFract &&
7987 BT->getKind() <= BuiltinType::LongFract) ||
7988 (BT->getKind() >= BuiltinType::SatShortAccum &&
7989 BT->getKind() <= BuiltinType::SatLongAccum) ||
7990 (BT->getKind() >= BuiltinType::SatShortFract &&
7991 BT->getKind() <= BuiltinType::SatLongFract));
7996inline bool Type::isUnsignedFixedPointType()
const {
7997 return isFixedPointType() && !isSignedFixedPointType();
8000inline bool Type::isScalarType()
const {
8001 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType))
8002 return BT->getKind() > BuiltinType::Void &&
8003 BT->getKind() <= BuiltinType::NullPtr;
8004 if (
const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
8008 return isa<PointerType>(CanonicalType) ||
8009 isa<BlockPointerType>(CanonicalType) ||
8010 isa<MemberPointerType>(CanonicalType) ||
8011 isa<ComplexType>(CanonicalType) ||
8012 isa<ObjCObjectPointerType>(CanonicalType) ||
8016inline bool Type::isIntegralOrEnumerationType()
const {
8017 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType))
8018 return BT->getKind() >= BuiltinType::Bool &&
8019 BT->getKind() <= BuiltinType::Int128;
8023 if (
const auto *ET = dyn_cast<EnumType>(CanonicalType))
8026 return isBitIntType();
8029inline bool Type::isBooleanType()
const {
8030 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType))
8031 return BT->getKind() == BuiltinType::Bool;
8035inline bool Type::isUndeducedType()
const {
8036 auto *DT = getContainedDeducedType();
8037 return DT && !DT->isDeduced();
8042inline bool Type::isOverloadableType()
const {
8043 return isDependentType() ||
isRecordType() || isEnumeralType();
8047inline bool Type::isTypedefNameType()
const {
8048 if (getAs<TypedefType>())
8050 if (
auto *TST = getAs<TemplateSpecializationType>())
8051 return TST->isTypeAlias();
8056inline bool Type::canDecayToPointerType()
const {
8057 return isFunctionType() || (isArrayType() && !isArrayParameterType());
8060inline bool Type::hasPointerRepresentation()
const {
8061 return (isPointerType() || isReferenceType() || isBlockPointerType() ||
8062 isObjCObjectPointerType() || isNullPtrType());
8065inline bool Type::hasObjCPointerRepresentation()
const {
8066 return isObjCObjectPointerType();
8069inline const Type *Type::getBaseElementTypeUnsafe()
const {
8076inline const Type *Type::getPointeeOrArrayElementType()
const {
8078 if (
type->isAnyPointerType())
8079 return type->getPointeeType().getTypePtr();
8080 else if (
type->isArrayType())
8081 return type->getBaseElementTypeUnsafe();
8089 DiagnosticsEngine::ArgumentKind::ak_addrspace);
8098 DiagnosticsEngine::ArgumentKind::ak_qual);
8106 PD.
AddTaggedVal(
reinterpret_cast<uint64_t
>(
T.getAsOpaquePtr()),
8107 DiagnosticsEngine::ak_qualtype);
8113template <
typename T>
8115 std::integral_constant<bool, std::is_same<T, ArrayType>::value ||
8116 std::is_base_of<ArrayType, T>::value>;
8119template <
typename T>
const T *Type::getAs()
const {
8121 "ArrayType cannot be used with getAs!");
8124 if (
const auto *Ty = dyn_cast<T>(
this))
8128 if (!isa<T>(CanonicalType))
8133 return cast<T>(getUnqualifiedDesugaredType());
8136template <
typename T>
const T *Type::getAsAdjusted()
const {
8140 if (
const auto *Ty = dyn_cast<T>(
this))
8144 if (!isa<T>(CanonicalType))
8149 const Type *Ty =
this;
8151 if (
const auto *A = dyn_cast<AttributedType>(Ty))
8152 Ty = A->getModifiedType().getTypePtr();
8153 else if (
const auto *A = dyn_cast<BTFTagAttributedType>(Ty))
8154 Ty = A->getWrappedType().getTypePtr();
8155 else if (
const auto *E = dyn_cast<ElaboratedType>(Ty))
8156 Ty = E->desugar().getTypePtr();
8157 else if (
const auto *
P = dyn_cast<ParenType>(Ty))
8158 Ty =
P->desugar().getTypePtr();
8159 else if (
const auto *A = dyn_cast<AdjustedType>(Ty))
8160 Ty = A->desugar().getTypePtr();
8161 else if (
const auto *M = dyn_cast<MacroQualifiedType>(Ty))
8162 Ty = M->desugar().getTypePtr();
8169 return dyn_cast<T>(Ty);
8174 if (
const auto *arr = dyn_cast<ArrayType>(
this))
8178 if (!isa<ArrayType>(CanonicalType))
8183 return cast<ArrayType>(getUnqualifiedDesugaredType());
8186template <
typename T>
const T *Type::castAs()
const {
8188 "ArrayType cannot be used with castAs!");
8190 if (
const auto *ty = dyn_cast<T>(
this))
return ty;
8191 assert(isa<T>(CanonicalType));
8192 return cast<T>(getUnqualifiedDesugaredType());
8195inline const ArrayType *Type::castAsArrayTypeUnsafe()
const {
8196 assert(isa<ArrayType>(CanonicalType));
8197 if (
const auto *arr = dyn_cast<ArrayType>(
this))
return arr;
8198 return cast<ArrayType>(getUnqualifiedDesugaredType());
8203 :
AdjustedType(Decayed, OriginalType, DecayedPtr, CanonicalPtr) {
8205 QualType Adjusted = getAdjustedType();
8207 assert(isa<PointerType>(Adjusted));
8214 return cast<PointerType>(Decayed)->getPointeeType();
Provides definitions for the various language-specific address spaces.
static bool isUnsigned(SValBuilder &SVB, NonLoc Value)
Defines the clang::attr::Kind enum.
Defines the Diagnostic-related interfaces.
static bool isBooleanType(QualType Ty)
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
static Decl::Kind getKind(const Decl *D)
Defines the ExceptionSpecificationType enumeration and various utility functions.
static bool isRead(AccessKinds AK)
static QualType getObjectType(APValue::LValueBase B)
Retrieves the "underlying object type" of the given expression, as used by __builtin_object_size.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
llvm::MachO::Record Record
static StringRef getIdentifier(const Token &Tok)
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream.
static QualType getUnderlyingType(const SubRegion *R)
static std::string getName(const CallEvent &Call)
static bool hasAttr(const Decl *D, bool IgnoreImplicitAttr)
static RecordDecl * getAsRecordDecl(QualType BaseType)
static bool isRecordType(QualType T)
static bool isParameterPack(Expr *PackExpression)
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
static const TemplateTypeParmDecl * getReplacedParameter(Decl *D, unsigned Index)
Defines the clang::Visibility enumeration and various utility functions.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
__device__ __2f16 float __ockl_bool s
__device__ __2f16 float c
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Reads an AST files chain containing the contents of a translation unit.
Writes an AST file containing the contents of a translation unit.
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons.
static bool classof(const Type *T)
static void Profile(llvm::FoldingSetNodeID &ID, QualType Orig, QualType New)
AdjustedType(TypeClass TC, QualType OriginalTy, QualType AdjustedTy, QualType CanonicalPtr)
QualType getAdjustedType() const
void Profile(llvm::FoldingSetNodeID &ID)
QualType getOriginalType() const
Represents a constant array type that does not decay to a pointer when used as a function parameter.
static bool classof(const Type *T)
Represents an array type, per C99 6.7.5.2 - Array Declarators.
ArraySizeModifier getSizeModifier() const
Qualifiers getIndexTypeQualifiers() const
static bool classof(const Type *T)
QualType getElementType() const
unsigned getIndexTypeCVRQualifiers() const
static void Profile(llvm::FoldingSetNodeID &ID, QualType T)
QualType getValueType() const
Gets the type contained by this atomic type, i.e.
void Profile(llvm::FoldingSetNodeID &ID)
static bool classof(const Type *T)
An attributed type is a type to which a type attribute has been applied.
QualType getModifiedType() const
static bool classof(const Type *T)
static Kind getNullabilityAttrKind(NullabilityKind kind)
Retrieve the attribute kind corresponding to the given nullability kind.
static std::optional< NullabilityKind > stripOuterNullability(QualType &T)
Strip off the top-level nullability annotation on the given type, if it's there.
static void Profile(llvm::FoldingSetNodeID &ID, Kind attrKind, QualType modified, QualType equivalent)
QualType getEquivalentType() const
void Profile(llvm::FoldingSetNodeID &ID)
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
static bool classof(const Type *T)
bool isDecltypeAuto() const
ConceptDecl * getTypeConstraintConcept() const
AutoTypeKeyword getKeyword() const
bool isGNUAutoType() const
bool isConstrained() const
static bool classof(const Type *T)
const BTFTypeTagAttr * getAttr() const
QualType getWrappedType() const
void Profile(llvm::FoldingSetNodeID &ID)
static void Profile(llvm::FoldingSetNodeID &ID, QualType Wrapped, const BTFTypeTagAttr *BTFAttr)
A fixed int type of a specified bitwidth.
static bool classof(const Type *T)
static void Profile(llvm::FoldingSetNodeID &ID, bool IsUnsigned, unsigned NumBits)
void Profile(llvm::FoldingSetNodeID &ID) const
unsigned getNumBits() const
void Profile(llvm::FoldingSetNodeID &ID)
QualType getPointeeType() const
static bool classof(const Type *T)
static void Profile(llvm::FoldingSetNodeID &ID, QualType Pointee)
[BoundsSafety] Represents a parent type class for CountAttributedType and similar sugar types that wi...
decl_iterator dependent_decl_begin() const
decl_iterator dependent_decl_end() const
unsigned getNumCoupledDecls() const
decl_range dependent_decls() const
ArrayRef< TypeCoupledDeclRefInfo > getCoupledDecls() const
llvm::iterator_range< decl_iterator > decl_range
static bool classof(const Type *T)
ArrayRef< TypeCoupledDeclRefInfo > Decls
This class is used for builtin types like 'int'.
bool isPlaceholderType() const
Determines whether this type is a placeholder type, i.e.
bool isNonOverloadPlaceholderType() const
Determines whether this type is a placeholder type other than Overload.
bool isFloatingPoint() const
static bool classof(const Type *T)
bool isSignedInteger() const
bool isUnsignedInteger() const
static bool isPlaceholderTypeKind(Kind K)
Determines whether the given kind corresponds to a placeholder type.
const char * getNameAsCString(const PrintingPolicy &Policy) const
Represents a C++ struct/union/class.
Complex values, per C99 6.2.5p11.
QualType getElementType() const
static void Profile(llvm::FoldingSetNodeID &ID, QualType Element)
static bool classof(const Type *T)
void Profile(llvm::FoldingSetNodeID &ID)
Declaration of a C++20 concept.
Represents the canonical version of C arrays with a specified constant size.
unsigned getSizeBitWidth() const
Return the bit width of the size type.
ConstantArrayType(TypeClass Tc, const ConstantArrayType *ATy, QualType Can)
uint64_t getLimitedSize() const
Return the size zero-extended to uint64_t or UINT64_MAX if the value is larger than UINT64_MAX.
bool isZeroSize() const
Return true if the size is zero.
int64_t getSExtSize() const
Return the size sign-extended as a uint64_t.
const Expr * getSizeExpr() const
Return a pointer to the size expression.
static bool classof(const Type *T)
llvm::APInt getSize() const
Return the constant array size as an APInt.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
uint64_t getZExtSize() const
Return the size zero-extended as a uint64_t.
Represents a concrete matrix type with constant number of rows and columns.
unsigned getNumColumns() const
Returns the number of columns in the matrix.
static void Profile(llvm::FoldingSetNodeID &ID, QualType ElementType, unsigned NumRows, unsigned NumColumns, TypeClass TypeClass)
void Profile(llvm::FoldingSetNodeID &ID)
static constexpr unsigned getMaxElementsPerDimension()
Returns the maximum number of elements per dimension.
unsigned getNumRows() const
Returns the number of rows in the matrix.
unsigned getNumElementsFlattened() const
Returns the number of elements required to embed the matrix into a vector.
static constexpr bool isDimensionValid(size_t NumElements)
Returns true if NumElements is a valid matrix dimension.
unsigned NumRows
Number of rows and columns.
static bool classof(const Type *T)
Represents a sugar type with __counted_by or __sized_by annotations, including their _or_null variant...
void Profile(llvm::FoldingSetNodeID &ID)
static bool classof(const Type *T)
bool isCountInBytes() const
Expr * getCountExpr() const
DynamicCountPointerKind getKind() const
Represents a pointer type decayed from an array or function type.
QualType getPointeeType() const
static bool classof(const Type *T)
QualType getDecayedType() const
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Decl - This represents one declaration (or definition), e.g.
Represents the type decltype(expr) (C++11).
static bool classof(const Type *T)
Expr * getUnderlyingExpr() const
QualType getUnderlyingType() const
Represents a C++17 deduced template specialization type.
TemplateName getTemplateName() const
Retrieve the name of the template that we are deducing.
static bool classof(const Type *T)
void Profile(llvm::FoldingSetNodeID &ID)
static void Profile(llvm::FoldingSetNodeID &ID, TemplateName Template, QualType Deduced, bool IsDependent)
Common base class for placeholders for types that get replaced by placeholder type deduction: C++11 a...
static bool classof(const Type *T)
QualType getDeducedType() const
Get the type deduced for this placeholder type, or null if it has not been deduced.
DeducedType(TypeClass TC, QualType DeducedAsType, TypeDependence ExtraDependence, QualType Canon)
Represents an extended address space qualifier where the input address space value is dependent.
Expr * getAddrSpaceExpr() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
QualType getPointeeType() const
static bool classof(const Type *T)
SourceLocation getAttributeLoc() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
static bool classof(const Type *T)
Internal representation of canonical, dependent decltype(expr) types.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
Represents a qualified type name for which the type name is dependent.
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
static bool classof(const Type *T)
const IdentifierInfo * getIdentifier() const
Retrieve the type named by the typename specifier as an identifier.
void Profile(llvm::FoldingSetNodeID &ID)
static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name)
Represents an array type in C++ whose size is a value-dependent expression.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
static bool classof(const Type *T)
SourceRange getBracketsRange() const
Expr * getSizeExpr() const
SourceLocation getLBracketLoc() const
SourceLocation getRBracketLoc() const
Represents an extended vector type where either the type or size is dependent.
Expr * getSizeExpr() const
static bool classof(const Type *T)
SourceLocation getAttributeLoc() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
QualType getElementType() const
Represents a matrix type where the type and the number of rows and columns is dependent on a template...
Expr * getColumnExpr() const
Expr * getRowExpr() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
SourceLocation getAttributeLoc() const
static bool classof(const Type *T)
Represents a template specialization type whose template cannot be resolved, e.g.
const IdentifierInfo * getIdentifier() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
ArrayRef< TemplateArgument > template_arguments() const
NestedNameSpecifier * getQualifier() const
static bool classof(const Type *T)
Internal representation of canonical, dependent typeof(expr) types.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
DependentTypeOfExprType(Expr *E, TypeOfKind Kind)
Represents a vector type where either the type or size is dependent.
Expr * getSizeExpr() const
VectorKind getVectorKind() const
SourceLocation getAttributeLoc() const
QualType getElementType() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
static bool classof(const Type *T)
Represents a type that was referred to using an elaborated type keyword, e.g., struct S,...
static bool classof(const Type *T)
TagDecl * getOwnedTagDecl() const
Return the (re)declaration of this type owned by this occurrence of this type, or nullptr if there is...
QualType desugar() const
Remove a single level of sugar.
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType, TagDecl *OwnedTagDecl)
bool isSugared() const
Returns whether this type directly provides sugar.
void Profile(llvm::FoldingSetNodeID &ID)
QualType getNamedType() const
Retrieve the type named by the qualified-id.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
EnumDecl * getDecl() const
static bool classof(const Type *T)
This represents one expression.
Base class that is common to both the ExtQuals and Type classes, which allows QualType to access the ...
We can encode up to four bits in the low bits of a type pointer, but there are many more type qualifi...
Qualifiers::ObjCLifetime getObjCLifetime() const
static void Profile(llvm::FoldingSetNodeID &ID, const Type *BaseType, Qualifiers Quals)
void Profile(llvm::FoldingSetNodeID &ID) const
ExtQuals(const Type *baseType, QualType canon, Qualifiers quals)
bool hasObjCGCAttr() const
Qualifiers::GC getObjCGCAttr() const
bool hasAddressSpace() const
const Type * getBaseType() const
Qualifiers getQualifiers() const
LangAS getAddressSpace() const
bool hasObjCLifetime() const
ExtVectorType - Extended vector type.
bool isAccessorWithinNumElements(char c, bool isNumericAccessor) const
static int getNumericAccessorIdx(char c)
static bool classof(const Type *T)
static int getPointAccessorIdx(char c)
static int getAccessorIdx(char c, bool isNumericAccessor)
Represents a function declaration or definition.
Represents a K&R-style 'int foo()' function, which has no information available about its arguments.
static void Profile(llvm::FoldingSetNodeID &ID, QualType ResultType, ExtInfo Info)
static bool classof(const Type *T)
void Profile(llvm::FoldingSetNodeID &ID)
Represents a prototype with parameter type info, e.g.
param_type_iterator param_type_begin() const
ExtParameterInfo getExtParameterInfo(unsigned I) const
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
bool isParamConsumed(unsigned I) const
exception_iterator exception_end() const
const ExtParameterInfo * getExtParameterInfosOrNull() const
Return a pointer to the beginning of the array of extra parameter information, if present,...
unsigned getNumParams() const
bool hasTrailingReturn() const
Whether this function prototype has a trailing return type.
ExceptionSpecInfo getExceptionSpecInfo() const
Return all the available information about this type's exception spec.
Qualifiers getMethodQuals() const
static bool classof(const Type *T)
QualType getParamType(unsigned i) const
unsigned getAArch64SMEAttributes() const
Return a bitmask describing the SME attributes on the function type, see AArch64SMETypeAttributes for...
QualType getExceptionType(unsigned i) const
Return the ith exception type, where 0 <= i < getNumExceptions().
static void Profile(llvm::FoldingSetNodeID &ID, QualType Result, param_type_iterator ArgTys, unsigned NumArgs, const ExtProtoInfo &EPI, const ASTContext &Context, bool Canonical)
SourceLocation getEllipsisLoc() const
unsigned getNumExceptions() const
Return the number of types in the exception specification.
bool hasExceptionSpec() const
Return whether this function has any kind of exception spec.
bool hasDynamicExceptionSpec() const
Return whether this function has a dynamic (throw) exception spec.
bool hasNoexceptExceptionSpec() const
Return whether this function has a noexcept exception spec.
bool isVariadic() const
Whether this function prototype is variadic.
ExtProtoInfo getExtProtoInfo() const
Expr * getNoexceptExpr() const
Return the expression inside noexcept(expression), or a null pointer if there is none (because the ex...
param_type_iterator param_type_end() const
FunctionDecl * getExceptionSpecTemplate() const
If this function type has an uninstantiated exception specification, this is the function whose excep...
bool isNothrow(bool ResultIfDependent=false) const
Determine whether this function type has a non-throwing exception specification.
ArrayRef< QualType > getParamTypes() const
ArrayRef< QualType > exceptions() const
ParameterABI getParameterABI(unsigned I) const
ArrayRef< QualType > param_types() const
exception_iterator exception_begin() const
ArrayRef< ExtParameterInfo > getExtParameterInfos() const
bool hasExtParameterInfos() const
Is there any interesting extra information for any of the parameters of this function type?
RefQualifierKind getRefQualifier() const
Retrieve the ref-qualifier associated with this function type.
FunctionDecl * getExceptionSpecDecl() const
If this function type has an exception specification which hasn't been determined yet (either because...
A class which abstracts out some details necessary for making a call.
ExtInfo withNoCfCheck(bool noCfCheck) const
ExtInfo withCallingConv(CallingConv cc) const
CallingConv getCC() const
ExtInfo withProducesResult(bool producesResult) const
ExtInfo(bool noReturn, bool hasRegParm, unsigned regParm, CallingConv cc, bool producesResult, bool noCallerSavedRegs, bool NoCfCheck, bool cmseNSCall)
bool getCmseNSCall() const
bool getNoCfCheck() const
unsigned getRegParm() const
void Profile(llvm::FoldingSetNodeID &ID) const
bool getNoCallerSavedRegs() const
ExtInfo withNoReturn(bool noReturn) const
bool getHasRegParm() const
bool operator==(ExtInfo Other) const
bool getProducesResult() const
ExtInfo withNoCallerSavedRegs(bool noCallerSavedRegs) const
ExtInfo withCmseNSCall(bool cmseNSCall) const
ExtInfo withRegParm(unsigned RegParm) const
bool operator!=(ExtInfo Other) const
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
friend bool operator==(ExtParameterInfo lhs, ExtParameterInfo rhs)
friend bool operator!=(ExtParameterInfo lhs, ExtParameterInfo rhs)
ExtParameterInfo()=default
bool hasPassObjectSize() const
ExtParameterInfo withHasPassObjectSize() const
unsigned char getOpaqueValue() const
bool isConsumed() const
Is this parameter considered "consumed" by Objective-C ARC? Consumed parameters must have retainable ...
ParameterABI getABI() const
Return the ABI treatment of this parameter.
ExtParameterInfo withIsConsumed(bool consumed) const
ExtParameterInfo withIsNoEscape(bool NoEscape) const
ExtParameterInfo withABI(ParameterABI kind) const
static ExtParameterInfo getFromOpaqueValue(unsigned char data)
FunctionType - C99 6.7.5.3 - Function Declarators.
ExtInfo getExtInfo() const
static ArmStateValue getArmZT0State(unsigned AttrBits)
bool getNoReturnAttr() const
Determine whether this function type includes the GNU noreturn attribute.
static ArmStateValue getArmZAState(unsigned AttrBits)
unsigned getRegParmType() const
CallingConv getCallConv() const
QualType getReturnType() const
FunctionType(TypeClass tc, QualType res, QualType Canonical, TypeDependence Dependence, ExtInfo Info)
static bool classof(const Type *T)
bool getCmseNSCallAttr() const
bool getHasRegParm() const
Qualifiers getFastTypeQuals() const
QualType getCallResultType(const ASTContext &Context) const
Determine the type of an expression that calls a function of this type.
AArch64SMETypeAttributes
The AArch64 SME ACLE (Arm C/C++ Language Extensions) define a number of function type attributes that...
One of these records is kept for each identifier that is lexed.
Represents a C array with an unspecified size.
void Profile(llvm::FoldingSetNodeID &ID)
static void Profile(llvm::FoldingSetNodeID &ID, QualType ET, ArraySizeModifier SizeMod, unsigned TypeQuals)
static bool classof(const Type *T)
The injected class name of a C++ class template or class template partial specialization.
static bool classof(const Type *T)
const TemplateSpecializationType * getInjectedTST() const
TemplateName getTemplateName() const
QualType getInjectedSpecializationType() const
An lvalue reference type, per C++11 [dcl.ref].
static bool classof(const Type *T)
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
static bool classof(const Type *T)
QualType getUnderlyingType() const
const IdentifierInfo * getMacroIdentifier() const
Represents a matrix type, as defined in the Matrix Types clang extensions.
QualType getElementType() const
Returns type of the elements being stored in the matrix.
MatrixType(QualType ElementTy, QualType CanonElementTy)
static bool isValidElementType(QualType T)
Valid elements types are the following:
QualType ElementType
The element type of the matrix.
static bool classof(const Type *T)
A pointer to member type per C++ 8.3.3 - Pointers to members.
void Profile(llvm::FoldingSetNodeID &ID)
QualType getPointeeType() const
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
bool isMemberDataPointer() const
Returns true if the member type (i.e.
static void Profile(llvm::FoldingSetNodeID &ID, QualType Pointee, const Type *Class)
static bool classof(const Type *T)
const Type * getClass() const
This represents a decl that may have a name.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Represents an ObjC class declaration.
Interfaces are the core concept in Objective-C for object oriented design.
static bool classof(const Type *T)
Represents a pointer to an Objective C object.
unsigned getNumProtocols() const
Return the number of qualifying protocols on the object type.
bool isSpecialized() const
Whether this type is specialized, meaning that it has type arguments.
qual_iterator qual_end() const
bool isObjCQualifiedClassType() const
True if this is equivalent to 'Class.
static void Profile(llvm::FoldingSetNodeID &ID, QualType T)
bool isObjCQualifiedIdType() const
True if this is equivalent to 'id.
bool isSpecializedAsWritten() const
Whether this type is specialized, meaning that it has type arguments.
bool isUnspecializedAsWritten() const
Determine whether this object type is "unspecialized" as written, meaning that it has no type argumen...
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments for this type.
void Profile(llvm::FoldingSetNodeID &ID)
const ObjCObjectType * getObjectType() const
Gets the type pointed to by this ObjC pointer.
ObjCObjectType::qual_iterator qual_iterator
An iterator over the qualifiers on the object type.
llvm::iterator_range< qual_iterator > qual_range
static bool classof(const Type *T)
bool isUnspecialized() const
Whether this type is unspecialized, meaning that is has no type arguments.
bool isObjCIdType() const
True if this is equivalent to the 'id' type, i.e.
ObjCProtocolDecl * getProtocol(unsigned I) const
Retrieve a qualifying protocol by index on the object type.
QualType getPointeeType() const
Gets the type pointed to by this ObjC pointer.
ObjCInterfaceDecl * getInterfaceDecl() const
If this pointer points to an Objective @interface type, gets the declaration for that interface.
bool isObjCClassType() const
True if this is equivalent to the 'Class' type, i.e.
bool isObjCIdOrClassType() const
True if this is equivalent to the 'id' or 'Class' type,.
ArrayRef< QualType > getTypeArgs() const
Retrieve the type arguments for this type.
qual_iterator qual_begin() const
bool isKindOfType() const
Whether this is a "__kindof" type.
A class providing a concrete implementation of ObjCObjectType, so as to not increase the footprint of...
Represents a class type in Objective C.
bool isKindOfTypeAsWritten() const
Whether this is a "__kindof" type as written.
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments of this object type as they were written.
bool isUnspecializedAsWritten() const
Determine whether this object type is "unspecialized" as written, meaning that it has no type argumen...
bool isObjCQualifiedClass() const
ObjCObjectType(enum Nonce_ObjCInterface)
bool isObjCUnqualifiedIdOrClass() const
QualType getBaseType() const
Gets the base type of this object type.
bool isObjCQualifiedId() const
bool isSpecializedAsWritten() const
Determine whether this object type was written with type arguments.
bool isObjCUnqualifiedId() const
bool isUnspecialized() const
Determine whether this object type is "unspecialized", meaning that it has no type arguments.
bool isObjCUnqualifiedClass() const
static bool classof(const Type *T)
QualType getSuperClassType() const
Retrieve the type of the superclass of this object type.
Represents an Objective-C protocol declaration.
This class wraps the list of protocol qualifiers.
llvm::iterator_range< qual_iterator > qual_range
void initialize(ArrayRef< ObjCProtocolDecl * > protocols)
ObjCProtocolDecl ** getProtocolStorage()
ArrayRef< ObjCProtocolDecl * > getProtocols() const
Retrieve all of the protocol qualifiers.
unsigned getNumProtocols() const
Return the number of qualifying protocols in this type, or 0 if there are none.
void setNumProtocols(unsigned N)
qual_iterator qual_end() const
ObjCProtocolDecl *const * getProtocolStorage() const
ObjCProtocolDecl * getProtocol(unsigned I) const
Fetch a protocol by index.
qual_iterator qual_begin() const
ObjCProtocolQualifiers()=default
ObjCProtocolDecl *const * qual_iterator
Represents the declaration of an Objective-C type parameter.
Represents a type parameter type in Objective C.
static bool classof(const Type *T)
ObjCTypeParamDecl * getDecl() const
Represents a pack expansion of types.
void Profile(llvm::FoldingSetNodeID &ID)
static bool classof(const Type *T)
static void Profile(llvm::FoldingSetNodeID &ID, QualType Pattern, std::optional< unsigned > NumExpansions)
QualType getPattern() const
Retrieve the pattern of this pack expansion, which is the type that will be repeatedly instantiated w...
std::optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
bool hasSelectedType() const
QualType getPattern() const
void Profile(llvm::FoldingSetNodeID &ID)
QualType getSelectedType() const
ArrayRef< QualType > getExpansions() const
Expr * getIndexExpr() const
static bool classof(const Type *T)
Sugar for parentheses used when specifying types.
void Profile(llvm::FoldingSetNodeID &ID)
static bool classof(const Type *T)
static void Profile(llvm::FoldingSetNodeID &ID, QualType Inner)
QualType getInnerType() const
static void Profile(llvm::FoldingSetNodeID &ID, QualType T, bool isRead)
QualType getElementType() const
void Profile(llvm::FoldingSetNodeID &ID)
static bool classof(const Type *T)
Pointer-authentication qualifiers.
static PointerAuthQualifier fromOpaqueValue(uint32_t Opaque)
friend bool operator==(PointerAuthQualifier Lhs, PointerAuthQualifier Rhs)
bool isIsaPointer() const
static PointerAuthQualifier Create(unsigned Key, bool IsAddressDiscriminated, unsigned ExtraDiscriminator, PointerAuthenticationMode AuthenticationMode, bool IsIsaPointer, bool AuthenticatesNullValues)
friend bool operator!=(PointerAuthQualifier Lhs, PointerAuthQualifier Rhs)
bool authenticatesNullValues() const
bool isEquivalent(PointerAuthQualifier Other) const
void Profile(llvm::FoldingSetNodeID &ID) const
@ MaxDiscriminator
The maximum supported pointer-authentication discriminator.
@ MaxKey
The maximum supported pointer-authentication key.
bool isAddressDiscriminated() const
PointerAuthQualifier withoutKeyNone() const
unsigned getExtraDiscriminator() const
PointerAuthenticationMode getAuthenticationMode() const
uint32_t getAsOpaqueValue() const
PointerAuthQualifier()=default
PointerType - C99 6.7.5.1 - Pointer Declarators.
QualType getPointeeType() const
static bool classof(const Type *T)
void Profile(llvm::FoldingSetNodeID &ID)
static void Profile(llvm::FoldingSetNodeID &ID, QualType Pointee)
StreamedQualTypeHelper(const QualType &T, const PrintingPolicy &Policy, const Twine &PlaceHolder, unsigned Indentation)
friend raw_ostream & operator<<(raw_ostream &OS, const StreamedQualTypeHelper &SQT)
A (possibly-)qualified type.
void addRestrict()
Add the restrict qualifier to this QualType.
QualType(const ExtQuals *Ptr, unsigned Quals)
bool isLocalConstQualified() const
Determine whether this particular QualType instance has the "const" qualifier set,...
bool isLocalRestrictQualified() const
Determine whether this particular QualType instance has the "restrict" qualifier set,...
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
bool isRestrictQualified() const
Determine whether this type is restrict-qualified.
bool isTriviallyCopyableType(const ASTContext &Context) const
Return true if this is a trivially copyable type (C++0x [basic.types]p9)
QualType IgnoreParens() const
Returns the specified type after dropping any outer-level parentheses.
Qualifiers::GC getObjCGCAttr() const
Returns gc attribute of this type.
friend bool operator==(const QualType &LHS, const QualType &RHS)
Indicate whether the specified types and qualifiers are identical.
bool hasQualifiers() const
Determine whether this type has any qualifiers.
QualType withFastQualifiers(unsigned TQs) const
QualType withRestrict() const
bool hasNonTrivialToPrimitiveCopyCUnion() const
Check if this is or contains a C union that is non-trivial to copy, which is a union that has a membe...
PointerAuthQualifier getPointerAuth() const
void addFastQualifiers(unsigned TQs)
bool isWebAssemblyFuncrefType() const
Returns true if it is a WebAssembly Funcref Type.
QualType getNonLValueExprType(const ASTContext &Context) const
Determine the type of a (typically non-lvalue) expression with the specified result type.
@ DK_objc_strong_lifetime
PrimitiveDefaultInitializeKind
@ PDIK_ARCWeak
The type is an Objective-C retainable pointer type that is qualified with the ARC __weak qualifier.
@ PDIK_Trivial
The type does not fall into any of the following categories.
@ PDIK_ARCStrong
The type is an Objective-C retainable pointer type that is qualified with the ARC __strong qualifier.
@ PDIK_Struct
The type is a struct containing a field whose type is not PCK_Trivial.
bool mayBeDynamicClass() const
Returns true if it is a class and it might be dynamic.
bool hasLocalNonFastQualifiers() const
Determine whether this particular QualType instance has any "non-fast" qualifiers,...
bool isNonWeakInMRRWithObjCWeak(const ASTContext &Context) const
const IdentifierInfo * getBaseTypeIdentifier() const
Retrieves a pointer to the name of the base type.
QualType withoutLocalFastQualifiers() const
void Profile(llvm::FoldingSetNodeID &ID) const
QualType getDesugaredType(const ASTContext &Context) const
Return the specified type with any "sugar" removed from the type.
void removeLocalFastQualifiers(unsigned Mask)
QualType withConst() const
QualType getLocalUnqualifiedType() const
Return this type with all of the instance-specific qualifiers removed, but without removing any quali...
void addConst()
Add the const type qualifier to this QualType.
bool isAtLeastAsQualifiedAs(QualType Other) const
Determine whether this type is at least as qualified as the other given type, requiring exact equalit...
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
bool isTriviallyCopyConstructibleType(const ASTContext &Context) const
Return true if this is a trivially copyable type.
bool isTrivialType(const ASTContext &Context) const
Return true if this is a trivial type per (C++0x [basic.types]p9)
bool isNull() const
Return true if this QualType doesn't point to a type yet.
PrimitiveCopyKind isNonTrivialToPrimitiveCopy() const
Check if this is a non-trivial type that would cause a C struct transitively containing this type to ...
bool isTriviallyRelocatableType(const ASTContext &Context) const
Return true if this is a trivially relocatable type.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
LangAS getAddressSpace() const
Return the address space of this type.
bool isConstant(const ASTContext &Ctx) const
static QualType getFromOpaquePtr(const void *Ptr)
QualType withVolatile() const
bool hasNonTrivialToPrimitiveDestructCUnion() const
Check if this is or contains a C union that is non-trivial to destruct, which is a union that has a m...
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
const Type * operator->() const
void setLocalFastQualifiers(unsigned Quals)
bool isAddressSpaceOverlapping(QualType T) const
Returns true if address space qualifiers overlap with T address space qualifiers.
bool isCXX98PODType(const ASTContext &Context) const
Return true if this is a POD type according to the rules of the C++98 standard, regardless of the cur...
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
QualType stripObjCKindOfType(const ASTContext &ctx) const
Strip Objective-C "__kindof" types from the given type.
void print(raw_ostream &OS, const PrintingPolicy &Policy, const Twine &PlaceHolder=Twine(), unsigned Indentation=0) const
void getAsStringInternal(std::string &Str, const PrintingPolicy &Policy) const
bool isReferenceable() const
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
QualType getCanonicalType() const
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
bool isTriviallyEqualityComparableType(const ASTContext &Context) const
Return true if this is a trivially equality comparable type.
void removeLocalVolatile()
QualType substObjCMemberType(QualType objectType, const DeclContext *dc, ObjCSubstitutionContext context) const
Substitute type arguments from an object type for the Objective-C type parameters used in the subject...
bool isWebAssemblyReferenceType() const
Returns true if it is a WebAssembly Reference Type.
SplitQualType getSplitDesugaredType() const
std::optional< NonConstantStorageReason > isNonConstantStorage(const ASTContext &Ctx, bool ExcludeCtor, bool ExcludeDtor)
Determine whether instances of this type can be placed in immutable storage.
QualType withCVRQualifiers(unsigned CVR) const
unsigned getLocalCVRQualifiers() const
Retrieve the set of CVR (const-volatile-restrict) qualifiers local to this particular QualType instan...
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
bool UseExcessPrecision(const ASTContext &Ctx)
void addVolatile()
Add the volatile type qualifier to this QualType.
bool isCForbiddenLValueType() const
Determine whether expressions of the given type are forbidden from being lvalues in C.
PrimitiveDefaultInitializeKind isNonTrivialToPrimitiveDefaultInitialize() const
Functions to query basic properties of non-trivial C struct types.
bool isObjCGCStrong() const
true when Type is objc's strong.
std::string getAsString() const
void * getAsOpaquePtr() const
static void print(SplitQualType split, raw_ostream &OS, const PrintingPolicy &policy, const Twine &PlaceHolder, unsigned Indentation=0)
bool isCanonicalAsParam() const
void removeLocalRestrict()
bool isWebAssemblyExternrefType() const
Returns true if it is a WebAssembly Externref Type.
QualType(const Type *Ptr, unsigned Quals)
QualType getNonPackExpansionType() const
Remove an outer pack expansion type (if any) from this type.
bool isMoreQualifiedThan(QualType Other) const
Determine whether this type is more qualified than the other given type, requiring exact equality for...
SplitQualType getSplitUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
bool isCXX11PODType(const ASTContext &Context) const
Return true if this is a POD type according to the more relaxed rules of the C++11 standard,...
bool mayBeNotDynamicClass() const
Returns true if it is not a class or if the class might not be dynamic.
bool isConstQualified() const
Determine whether this type is const-qualified.
bool hasAddressSpace() const
Check if this type has any address space qualifier.
bool isObjCGCWeak() const
true when Type is objc's weak.
QualType substObjCTypeArgs(ASTContext &ctx, ArrayRef< QualType > typeArgs, ObjCSubstitutionContext context) const
Substitute type arguments for the Objective-C type parameters used in the subject type.
unsigned getLocalFastQualifiers() const
void removeLocalFastQualifiers()
QualType getAtomicUnqualifiedType() const
Remove all qualifiers including _Atomic.
DestructionKind isDestructedType() const
Returns a nonzero value if objects of this type require non-trivial work to clean up after.
friend bool operator<(const QualType &LHS, const QualType &RHS)
friend bool operator!=(const QualType &LHS, const QualType &RHS)
StreamedQualTypeHelper stream(const PrintingPolicy &Policy, const Twine &PlaceHolder=Twine(), unsigned Indentation=0) const
bool isLocalVolatileQualified() const
Determine whether this particular QualType instance has the "volatile" qualifier set,...
bool isConstantStorage(const ASTContext &Ctx, bool ExcludeCtor, bool ExcludeDtor)
unsigned getCVRQualifiers() const
Retrieve the set of CVR (const-volatile-restrict) qualifiers applied to this type.
static void getAsStringInternal(SplitQualType split, std::string &out, const PrintingPolicy &policy)
QualType getSingleStepDesugaredType(const ASTContext &Context) const
Return the specified type with one level of "sugar" removed from the type.
const Type * getTypePtrOrNull() const
static std::string getAsString(SplitQualType split, const PrintingPolicy &Policy)
bool hasNonTrivialObjCLifetime() const
bool isPODType(const ASTContext &Context) const
Determine whether this is a Plain Old Data (POD) type (C++ 3.9p10).
bool hasStrongOrWeakObjCLifetime() const
PrimitiveCopyKind isNonTrivialToPrimitiveDestructiveMove() const
Check if this is a non-trivial type that would cause a C struct transitively containing this type to ...
QualType withExactLocalFastQualifiers(unsigned TQs) const
@ NonConstNonReferenceType
@ PCK_Struct
The type is a struct containing a field whose type is neither PCK_Trivial nor PCK_VolatileTrivial.
@ PCK_Trivial
The type does not fall into any of the following categories.
@ PCK_ARCStrong
The type is an Objective-C retainable pointer type that is qualified with the ARC __strong qualifier.
@ PCK_VolatileTrivial
The type would be trivial except that it is volatile-qualified.
@ PCK_ARCWeak
The type is an Objective-C retainable pointer type that is qualified with the ARC __weak qualifier.
const Type & operator*() const
Qualifiers getLocalQualifiers() const
Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifie...
bool hasNonTrivialToPrimitiveDefaultInitializeCUnion() const
Check if this is or contains a C union that is non-trivial to default-initialize, which is a union th...
A qualifier set is used to build a set of qualifiers.
const Type * strip(QualType type)
Collect any qualifiers on the given type and return an unqualified type.
QualifierCollector(Qualifiers Qs=Qualifiers())
QualifiersAndAtomic & operator+=(Qualifiers RHS)
QualifiersAndAtomic withVolatile()
QualifiersAndAtomic withAtomic()
QualifiersAndAtomic withConst()
QualifiersAndAtomic(Qualifiers Quals, bool HasAtomic)
QualifiersAndAtomic withRestrict()
The collection of all-type qualifiers we support.
unsigned getCVRQualifiers() const
void removeCVRQualifiers(unsigned mask)
friend Qualifiers operator-(Qualifiers L, Qualifiers R)
Compute the difference between two qualifier sets.
static Qualifiers fromFastMask(unsigned Mask)
void setFastQualifiers(unsigned mask)
void addAddressSpace(LangAS space)
static Qualifiers removeCommonQualifiers(Qualifiers &L, Qualifiers &R)
Returns the common set of qualifiers while removing them from the given sets.
bool hasOnlyConst() const
@ OCL_Strong
Assigning into this object requires the old value to be released and the new value to be retained.
@ OCL_ExplicitNone
This object can be modified without requiring retains or releases.
@ OCL_None
There is no lifetime qualification on this type.
@ OCL_Weak
Reading or writing from this object requires a barrier call.
@ OCL_Autoreleasing
Assigning into this object requires a lifetime extension.
void removeObjCLifetime()
bool hasTargetSpecificAddressSpace() const
bool isStrictSupersetOf(Qualifiers Other) const
Determine whether this set of qualifiers is a strict superset of another set of qualifiers,...
bool hasNonFastQualifiers() const
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated.
void Profile(llvm::FoldingSetNodeID &ID) const
bool isAddressSpaceSupersetOf(Qualifiers other) const
Returns true if the address space in these qualifiers is equal to or a superset of the address space ...
bool operator!=(Qualifiers Other) const
bool hasNonTrivialObjCLifetime() const
True if the lifetime is neither None or ExplicitNone.
void addCVRQualifiers(unsigned mask)
bool hasCVRQualifiers() const
void addConsistentQualifiers(Qualifiers qs)
Add the qualifiers from the given set to this set, given that they don't conflict.
void removeFastQualifiers(unsigned mask)
Qualifiers & operator+=(Qualifiers R)
void removeFastQualifiers()
bool hasQualifiers() const
Return true if the set contains any qualifiers.
void removeCVRQualifiers()
Qualifiers withVolatile() const
void addCVRUQualifiers(unsigned mask)
Qualifiers & operator-=(Qualifiers R)
bool hasUnaligned() const
unsigned getAddressSpaceAttributePrintValue() const
Get the address space attribute value to be printed by diagnostics.
bool hasAddressSpace() const
Qualifiers withoutAddressSpace() const
unsigned getFastQualifiers() const
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool appendSpaceIfNonEmpty=false) const
void removeAddressSpace()
@ FastWidth
The width of the "fast" qualifier mask.
@ MaxAddressSpace
The maximum supported address space number.
@ FastMask
The fast qualifier mask.
void addQualifiers(Qualifiers Q)
Add the qualifiers from the given set to this set.
static Qualifiers fromCVRMask(unsigned CVR)
void setAddressSpace(LangAS space)
static bool isAddressSpaceSupersetOf(LangAS A, LangAS B)
Returns true if address space A is equal to or a superset of B.
unsigned getCVRUQualifiers() const
bool isEmptyWhenPrinted(const PrintingPolicy &Policy) const
PointerAuthQualifier getPointerAuth() const
void setObjCGCAttr(GC type)
Qualifiers withConst() const
bool hasObjCGCAttr() const
uint64_t getAsOpaqueValue() const
void setCVRQualifiers(unsigned mask)
bool hasObjCLifetime() const
ObjCLifetime getObjCLifetime() const
Qualifiers withoutObjCLifetime() const
Qualifiers withoutObjCGCAttr() const
static Qualifiers fromCVRUMask(unsigned CVRU)
friend Qualifiers operator+(Qualifiers L, Qualifiers R)
void setUnaligned(bool flag)
void addFastQualifiers(unsigned mask)
std::string getAsString() const
Qualifiers withRestrict() const
void addPointerAuth(PointerAuthQualifier Q)
void addObjCGCAttr(GC type)
bool hasPointerAuth() const
bool operator==(Qualifiers Other) const
bool compatiblyIncludes(Qualifiers other) const
Determines if these qualifiers compatibly include another set.
void removeQualifiers(Qualifiers Q)
Remove the qualifiers from the given set from this set.
LangAS getAddressSpace() const
bool hasOnlyVolatile() const
void setPointerAuth(PointerAuthQualifier Q)
bool compatiblyIncludesObjCLifetime(Qualifiers other) const
Determines if these qualifiers compatibly include another set of qualifiers from the narrow perspecti...
Qualifiers getNonFastQualifiers() const
static Qualifiers fromOpaqueValue(uint64_t opaque)
bool hasStrongOrWeakObjCLifetime() const
True if the lifetime is either strong or weak.
static std::string getAddrSpaceAsString(LangAS AS)
bool hasFastQualifiers() const
bool hasOnlyRestrict() const
void addObjCLifetime(ObjCLifetime type)
void setObjCLifetime(ObjCLifetime type)
An rvalue reference type, per C++11 [dcl.ref].
static bool classof(const Type *T)
Represents a struct/union/class.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
RecordType(const RecordDecl *D)
RecordDecl * getDecl() const
RecordType(TypeClass TC, RecordDecl *D)
static bool classof(const Type *T)
Base for LValueReferenceType and RValueReferenceType.
QualType getPointeeType() const
ReferenceType(TypeClass tc, QualType Referencee, QualType CanonicalRef, bool SpelledAsLValue)
static bool classof(const Type *T)
QualType getPointeeTypeAsWritten() const
bool isSpelledAsLValue() const
void Profile(llvm::FoldingSetNodeID &ID)
static void Profile(llvm::FoldingSetNodeID &ID, QualType Referencee, bool SpelledAsLValue)
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
Stmt - This represents one statement.
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
void AddTaggedVal(uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const
Represents the result of substituting a set of types for a template type parameter pack.
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
static bool classof(const Type *T)
unsigned getNumArgs() const
Represents the result of substituting a type for a template type parameter.
void Profile(llvm::FoldingSetNodeID &ID)
static bool classof(const Type *T)
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
std::optional< unsigned > getPackIndex() const
QualType getReplacementType() const
Gets the type that was substituted for the template parameter.
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
static void Profile(llvm::FoldingSetNodeID &ID, QualType Replacement, const Decl *AssociatedDecl, unsigned Index, std::optional< unsigned > PackIndex)
Represents the declaration of a struct/union/class/enum.
static bool classof(const Type *T)
A convenient class for passing around template argument information.
Represents a template argument.
Represents a C++ template name within the type system.
void Profile(llvm::FoldingSetNodeID &ID)
bool isDependent() const
Determines whether this is a dependent template name.
Represents a type template specialization; the template must be a class template, a type alias templa...
ArrayRef< TemplateArgument > template_arguments() const
static bool classof(const Type *T)
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
bool isCurrentInstantiation() const
True if this template specialization type matches a current instantiation in the context in which it ...
Declaration of a template type parameter.
TemplateTypeParmDecl * getDecl() const
bool isParameterPack() const
void Profile(llvm::FoldingSetNodeID &ID)
unsigned getIndex() const
static bool classof(const Type *T)
static void Profile(llvm::FoldingSetNodeID &ID, unsigned Depth, unsigned Index, bool ParameterPack, TemplateTypeParmDecl *TTPDecl)
CanonicalTTPTInfo CanTTPTInfo
TemplateTypeParmDecl * TTPDecl
unsigned getDepth() const
[BoundsSafety] Represents information of declarations referenced by the arguments of the counted_by a...
llvm::PointerIntPair< ValueDecl *, 1, unsigned > BaseTy
Base wrapper for a particular "section" of type source info.
Represents a typeof (or typeof) expression (a C23 feature and GCC extension) or a typeof_unqual expre...
static bool classof(const Type *T)
TypeOfKind getKind() const
Returns the kind of 'typeof' type this is.
Expr * getUnderlyingExpr() const
Represents typeof(type), a C23 feature and GCC extension, or `typeof_unqual(type),...
static bool classof(const Type *T)
TypeOfKind getKind() const
Returns the kind of 'typeof' type this is.
bool isSugared() const
Returns whether this type directly provides sugar.
QualType desugar() const
Remove a single level of sugar.
QualType getUnmodifiedType() const
A container of type source information.
QualType getType() const
Return the type wrapped by this type source info.
void overrideType(QualType T)
Override the type stored in this TypeSourceInfo. Use with caution!
A helper class for Type nodes having an ElaboratedTypeKeyword.
TypeWithKeyword(ElaboratedTypeKeyword Keyword, TypeClass tc, QualType Canonical, TypeDependence Dependence)
static CannotCastToThisType classof(const Type *)
static StringRef getTagTypeKindName(TagTypeKind Kind)
ElaboratedTypeKeyword getKeyword() const
FunctionTypeBitfields store various bits belonging to FunctionProtoType.
The base class of the type hierarchy.
bool isIncompleteOrObjectType() const
Return true if this is an incomplete or object type, in other words, not a function type.
TypedefBitfields TypedefBits
bool isBooleanType() const
Type(const Type &)=delete
ReferenceTypeBitfields ReferenceTypeBits
ElaboratedTypeBitfields ElaboratedTypeBits
ArrayTypeBitfields ArrayTypeBits
VectorTypeBitfields VectorTypeBits
TypeWithKeywordBitfields TypeWithKeywordBits
TypeOfBitfields TypeOfBits
const T * castAs() const
Member-template castAs<specific type>.
BuiltinTypeBitfields BuiltinTypeBits
bool isReferenceType() const
bool isEnumeralType() const
bool isVisibilityExplicit() const
Return true if the visibility was explicitly set is the code.
void addDependence(TypeDependence D)
ConstantArrayTypeBitfields ConstantArrayTypeBits
Type(TypeClass tc, QualType canon, TypeDependence Dependence)
CountAttributedTypeBitfields CountAttributedTypeBits
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
Type & operator=(const Type &)=delete
AutoType * getContainedAutoType() const
Get the AutoType whose type will be deduced for a variable with an initializer of this type.
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
DependentTemplateSpecializationTypeBitfields DependentTemplateSpecializationTypeBits
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
QualType getCanonicalTypeInternal() const
bool containsErrors() const
Whether this type is an error type.
AttributedTypeBitfields AttributedTypeBits
bool isFunctionProtoType() const
PackExpansionTypeBitfields PackExpansionTypeBits
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
bool isFromAST() const
Whether this type comes from an AST file.
bool isObjectType() const
Determine whether this type is an object type.
FunctionTypeBitfields FunctionTypeBits
void setDependence(TypeDependence D)
bool isFunctionType() const
SubstTemplateTypeParmTypeBitfields SubstTemplateTypeParmTypeBits
TypeDependence getDependence() const
Visibility getVisibility() const
Determine the visibility of this type.
bool isObjCInertUnsafeUnretainedType() const
Was this type written with the special inert-in-ARC __unsafe_unretained qualifier?
ObjCObjectTypeBitfields ObjCObjectTypeBits
bool hasSizedVLAType() const
Whether this type involves a variable-length array type with a definite size.
TypeClass getTypeClass() const
bool isCanonicalUnqualified() const
Determines if this type would be canonical if it had no further qualification.
const T * getAs() const
Member-template getAs<specific type>'.
SubstTemplateTypeParmPackTypeBitfields SubstTemplateTypeParmPackTypeBits
TemplateSpecializationTypeBitfields TemplateSpecializationTypeBits
bool isFunctionNoProtoType() const
AutoTypeBitfields AutoTypeBits
Type & operator=(Type &&)=delete
Base class for declarations which introduce a typedef-name.
TypedefNameDecl * getDecl() const
void Profile(llvm::FoldingSetNodeID &ID)
static bool classof(const Type *T)
bool typeMatchesDecl() const
static void Profile(llvm::FoldingSetNodeID &ID, const TypedefNameDecl *Decl, QualType Underlying)
Represents the dependent type named by a dependently-scoped typename using declaration,...
void Profile(llvm::FoldingSetNodeID &ID)
static void Profile(llvm::FoldingSetNodeID &ID, UnresolvedUsingTypenameDecl *D)
UnresolvedUsingTypenameDecl * getDecl() const
static bool classof(const Type *T)
Represents a dependent using declaration which was marked with typename.
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
void Profile(llvm::FoldingSetNodeID &ID)
static void Profile(llvm::FoldingSetNodeID &ID, const UsingShadowDecl *Found, QualType Underlying)
static bool classof(const Type *T)
UsingShadowDecl * getFoundDecl() const
bool typeMatchesDecl() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a C array with a specified size that is not an integer-constant-expression.
SourceRange getBracketsRange() const
SourceLocation getLBracketLoc() const
static bool classof(const Type *T)
void Profile(llvm::FoldingSetNodeID &ID)
Expr * getSizeExpr() const
SourceLocation getRBracketLoc() const
Represents a GCC generic vector type.
unsigned getNumElements() const
void Profile(llvm::FoldingSetNodeID &ID)
static void Profile(llvm::FoldingSetNodeID &ID, QualType ElementType, unsigned NumElements, TypeClass TypeClass, VectorKind VecKind)
VectorKind getVectorKind() const
QualType ElementType
The element type of the vector.
QualType getElementType() const
static bool classof(const Type *T)
Defines the Linkage enumeration and various utility functions.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const AstTypeMatcher< ArrayType > arrayType
Matches all kinds of arrays.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
The JSON file list parser is used to communicate input to InstallAPI.
@ Create
'copyin' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
TypeDependenceScope::TypeDependence TypeDependence
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
@ GNUAutoType
__auto_type (GNU extension)
@ DecltypeAuto
decltype(auto)
bool isTargetAddressSpace(LangAS AS)
CanThrowResult
Possible results from evaluation of a noexcept expression.
FunctionType::ExtInfo getFunctionExtInfo(const Type &t)
bool isDynamicExceptionSpec(ExceptionSpecificationType ESpecType)
NullabilityKind
Describes the nullability of a particular type.
RefQualifierKind
The kind of C++11 ref-qualifier associated with a function type.
@ RQ_None
No ref-qualifier was provided.
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
bool IsEnumDeclComplete(EnumDecl *ED)
Check if the given decl is complete.
TypeOfKind
The kind of 'typeof' expression we're after.
bool operator==(const CallGraphNode::CallRecord &LHS, const CallGraphNode::CallRecord &RHS)
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
TypeDependence toTypeDependence(ExprDependence D)
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
unsigned toTargetAddressSpace(LangAS AS)
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
ObjCSubstitutionContext
The kind of type we are substituting Objective-C type arguments into.
@ Superclass
The superclass of a type.
@ Property
The type of a property.
@ Parameter
The parameter type of a method or function.
@ Result
The result type of a method or function.
ArraySizeModifier
Capture whether this is a normal array (e.g.
ParameterABI
Kinds of parameter ABI.
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
bool isNoexceptExceptionSpec(ExceptionSpecificationType ESpecType)
TagTypeKind
The kind of a tag type.
constexpr unsigned PointerAuthKeyNone
bool IsEnumDeclScoped(EnumDecl *ED)
Check if the given decl is scoped.
LangAS
Defines the address space values used by the address space qualifier of QualType.
void FixedPointValueToString(SmallVectorImpl< char > &Str, llvm::APSInt Val, unsigned Scale)
std::integral_constant< bool, std::is_same< T, ArrayType >::value||std::is_base_of< ArrayType, T >::value > TypeIsArrayType
bool isPtrSizeAddressSpace(LangAS AS)
const FunctionProtoType * T
PointerAuthenticationMode
CallingConv
CallingConv - Specifies the calling convention that a function uses.
@ AltiVecBool
is AltiVec 'vector bool ...'
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
@ AltiVecVector
is AltiVec vector
@ AltiVecPixel
is AltiVec 'vector Pixel'
@ Generic
not a target-specific vector type
@ RVVFixedLengthData
is RISC-V RVV fixed-length data vector
@ RVVFixedLengthMask
is RISC-V RVV fixed-length mask vector
@ NeonPoly
is ARM Neon polynomial vector
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
@ Interface
The "__interface" keyword introduces the elaborated-type-specifier.
@ Class
The "class" keyword introduces the elaborated-type-specifier.
@ Typename
The "typename" keyword precedes the qualified type name, e.g., typename T::type.
TypeDependence toSyntacticDependence(TypeDependence D)
@ Other
Other implicit parameter.
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
@ EST_DependentNoexcept
noexcept(expression), value-dependent
@ EST_Uninstantiated
not instantiated yet
@ EST_Unparsed
not parsed yet
@ EST_NoThrow
Microsoft __declspec(nothrow) extension.
@ EST_None
no exception specification
@ EST_MSAny
Microsoft throw(...) extension.
@ EST_BasicNoexcept
noexcept
@ EST_NoexceptFalse
noexcept(expression), evals to 'false'
@ EST_Unevaluated
not evaluated yet, for special member function
@ EST_NoexceptTrue
noexcept(expression), evals to 'true'
@ EST_Dynamic
throw(T1, T2)
Visibility
Describes the different kinds of visibility that a declaration may have.
Diagnostic wrappers for TextAPI types for error reporting.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Holds information about the various types of exception specification.
ExceptionSpecInfo(ExceptionSpecificationType EST)
ExceptionSpecificationType Type
The kind of exception specification this is.
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
ExceptionSpecInfo()=default
Extra information about a function prototype.
ExceptionSpecInfo ExceptionSpec
bool requiresFunctionProtoTypeArmAttributes() const
unsigned AArch64SMEAttributes
SourceLocation EllipsisLoc
const ExtParameterInfo * ExtParameterInfos
RefQualifierKind RefQualifier
ExtProtoInfo(CallingConv CC)
unsigned HasTrailingReturn
bool requiresFunctionProtoTypeExtraBitfields() const
void setArmSMEAttribute(AArch64SMETypeAttributes Kind, bool Enable=true)
ExtProtoInfo withExceptionSpec(const ExceptionSpecInfo &ESI)
FunctionType::ExtInfo ExtInfo
A simple holder for a QualType representing a type in an exception specification.
A holder for Arm type attributes as described in the Arm C/C++ Language extensions which are not part...
FunctionTypeArmAttributes()
unsigned AArch64SMEAttributes
Any AArch64 SME ACLE type attributes that need to be propagated on declarations and function pointers...
Describes how types, statements, expressions, and declarations should be printed.
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
SplitQualType(const Type *ty, Qualifiers qs)
SplitQualType getSingleStepDesugaredType() const
friend bool operator==(SplitQualType a, SplitQualType b)
const Type * Ty
The locally-unqualified type.
friend bool operator!=(SplitQualType a, SplitQualType b)
std::pair< const Type *, Qualifiers > asPair() const
Qualifiers Quals
The local qualifiers.
static inline ::clang::ExtQuals * getFromVoidPointer(void *P)
static void * getAsVoidPointer(::clang::ExtQuals *P)
static void * getAsVoidPointer(::clang::Type *P)
static inline ::clang::Type * getFromVoidPointer(void *P)
static void * getAsVoidPointer(clang::QualType P)
static clang::QualType getFromVoidPointer(void *P)
static SimpleType getSimplifiedValue(::clang::QualType Val)