17#ifndef LLVM_CLANG_AST_TYPE_BASE_H
18#define LLVM_CLANG_AST_TYPE_BASE_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/DXILABI.h"
48#include "llvm/Support/ErrorHandling.h"
49#include "llvm/Support/PointerLikeTypeTraits.h"
50#include "llvm/Support/TrailingObjects.h"
51#include "llvm/Support/type_traits.h"
79namespace serialization {
80 template <
class T>
class AbstractTypeReader;
117template <
typename>
class CanQual;
122class ExtQualsTypeCommonBase;
124class FunctionEffectsRef;
125class FunctionEffectKindSet;
126class FunctionEffectSet;
129class ObjCInterfaceDecl;
130class ObjCProtocolDecl;
131class ObjCTypeParamDecl;
132struct PrintingPolicy;
136class ClassTemplateDecl;
137class TemplateArgument;
138class TemplateArgumentListInfo;
139class TemplateArgumentLoc;
140class TemplateTypeParmDecl;
141class TypedefNameDecl;
142class UnresolvedUsingTypenameDecl;
143class UsingShadowDecl;
148#define TYPE(Class, Base) class Class##Type;
149#include "clang/AST/TypeNodes.inc"
152class PointerAuthQualifier {
156 EnabledMask = 1 << EnabledShift,
157 AddressDiscriminatedShift = EnabledShift + EnabledBits,
158 AddressDiscriminatedBits = 1,
159 AddressDiscriminatedMask = 1 << AddressDiscriminatedShift,
160 AuthenticationModeShift =
161 AddressDiscriminatedShift + AddressDiscriminatedBits,
162 AuthenticationModeBits = 2,
163 AuthenticationModeMask = ((1 << AuthenticationModeBits) - 1)
164 << AuthenticationModeShift,
165 IsaPointerShift = AuthenticationModeShift + AuthenticationModeBits,
167 IsaPointerMask = ((1 << IsaPointerBits) - 1) << IsaPointerShift,
168 AuthenticatesNullValuesShift = IsaPointerShift + IsaPointerBits,
169 AuthenticatesNullValuesBits = 1,
170 AuthenticatesNullValuesMask = ((1 << AuthenticatesNullValuesBits) - 1)
171 << AuthenticatesNullValuesShift,
172 KeyShift = AuthenticatesNullValuesShift + AuthenticatesNullValuesBits,
174 KeyMask = ((1 << KeyBits) - 1) << KeyShift,
175 DiscriminatorShift = KeyShift + KeyBits,
176 DiscriminatorBits = 16,
177 DiscriminatorMask = ((1u << DiscriminatorBits) - 1) << DiscriminatorShift,
188 static_assert((EnabledBits + AddressDiscriminatedBits +
189 AuthenticationModeBits + IsaPointerBits +
190 AuthenticatesNullValuesBits + KeyBits + DiscriminatorBits) ==
192 "PointerAuthQualifier should be exactly 32 bits");
193 static_assert((EnabledMask + AddressDiscriminatedMask +
194 AuthenticationModeMask + IsaPointerMask +
195 AuthenticatesNullValuesMask + KeyMask + DiscriminatorMask) ==
197 "All masks should cover the entire bits");
198 static_assert((EnabledMask ^ AddressDiscriminatedMask ^
199 AuthenticationModeMask ^ IsaPointerMask ^
200 AuthenticatesNullValuesMask ^ KeyMask ^ DiscriminatorMask) ==
202 "All masks should cover the entire bits");
205 unsigned ExtraDiscriminator,
207 bool IsIsaPointer,
bool AuthenticatesNullValues)
209 (IsAddressDiscriminated
210 ? llvm::to_underlying(AddressDiscriminatedMask)
213 (llvm::to_underlying(AuthenticationMode)
214 << AuthenticationModeShift) |
215 (ExtraDiscriminator << DiscriminatorShift) |
216 (IsIsaPointer << IsaPointerShift) |
217 (AuthenticatesNullValues << AuthenticatesNullValuesShift)) {
220 assert((Data == 0) ==
238 static PointerAuthQualifier
239 Create(
unsigned Key,
bool IsAddressDiscriminated,
unsigned ExtraDiscriminator,
241 bool AuthenticatesNullValues) {
246 AuthenticationMode, IsIsaPointer,
247 AuthenticatesNullValues);
251 assert((Data == 0) ==
260 return (Data & KeyMask) >> KeyShift;
267 return (Data & AddressDiscriminatedMask) >> AddressDiscriminatedShift;
272 return (Data >> DiscriminatorShift);
277 AuthenticationModeShift);
282 return (Data & IsaPointerMask) >> IsaPointerShift;
287 return (Data & AuthenticatesNullValuesMask) >> AuthenticatesNullValuesShift;
294 friend bool operator==(PointerAuthQualifier Lhs, PointerAuthQualifier Rhs) {
295 return Lhs.Data == Rhs.Data;
297 friend bool operator!=(PointerAuthQualifier Lhs, PointerAuthQualifier Rhs) {
298 return Lhs.Data != Rhs.Data;
309 PointerAuthQualifier
Result;
311 assert((
Result.Data == 0) ==
322 void Profile(llvm::FoldingSetNodeID &ID)
const { ID.AddInteger(Data); }
389 LPtrAuth == R.getPointerAuth()) {
393 R.setPointerAuth(
Empty);
398 Q.Mask = L.Mask & R.Mask;
407 R.removeCVRQualifiers(CommonCRV);
412 R.removeObjCGCAttr();
418 R.removeObjCLifetime();
424 R.removeAddressSpace();
492 assert(!(mask & ~
CVRMask) &&
"bitmask contains non-CVR bits");
496 assert(!(mask & ~
CVRMask) &&
"bitmask contains non-CVR bits");
497 Mask &= ~static_cast<uint64_t>(mask);
503 assert(!(mask & ~
CVRMask) &&
"bitmask contains non-CVR bits");
507 assert(!(mask & ~
CVRMask & ~UMask) &&
"bitmask contains non-CVRU bits");
513 Mask = (Mask & ~UMask) | (flag ? UMask : 0);
521 Mask = (Mask & ~GCAttrMask) | (
type << GCAttrShift);
546 return ObjCLifetime((Mask & LifetimeMask) >> LifetimeShift);
549 Mask = (Mask & ~LifetimeMask) | (
type << LifetimeShift);
555 Mask |= (
type << LifetimeShift);
572 return static_cast<LangAS>((Mask & AddressSpaceMask) >> AddressSpaceShift);
593 Mask = (Mask & ~AddressSpaceMask)
594 | (((uint32_t) space) << AddressSpaceShift);
607 Mask = (Mask & ~PtrAuthMask) |
621 assert(!(mask & ~
FastMask) &&
"bitmask contains non-fast qualifier bits");
625 assert(!(mask & ~
FastMask) &&
"bitmask contains non-fast qualifier bits");
626 Mask &= ~static_cast<uint64_t>(mask);
632 assert(!(mask & ~
FastMask) &&
"bitmask contains non-fast qualifier bits");
647 bool empty()
const {
return !Mask; }
802 bool appendSpaceIfNonEmpty =
false)
const;
804 void Profile(llvm::FoldingSetNodeID &ID)
const { ID.AddInteger(Mask); }
811 "PointerAuthQualifier must be 32 bits");
813 static constexpr uint64_t PtrAuthShift = 32;
814 static constexpr uint64_t PtrAuthMask = UINT64_C(0xffffffff) << PtrAuthShift;
816 static constexpr uint64_t UMask = 0x8;
817 static constexpr uint64_t UShift = 3;
818 static constexpr uint64_t GCAttrMask = 0x30;
819 static constexpr uint64_t GCAttrShift = 4;
820 static constexpr uint64_t LifetimeMask = 0x1C0;
821 static constexpr uint64_t LifetimeShift = 6;
822 static constexpr uint64_t AddressSpaceMask =
823 ~(
CVRMask | UMask | GCAttrMask | LifetimeMask | PtrAuthMask);
824 static constexpr uint64_t AddressSpaceShift = 9;
834 : Quals(Quals), HasAtomic(HasAtomic) {}
854 return {Quals.withVolatile(), HasAtomic};
858 return {Quals.withRestrict(), HasAtomic};
883 std::pair<const Type *,Qualifiers>
asPair()
const {
884 return std::pair<const Type *, Qualifiers>(
Ty,
Quals);
888 return a.
Ty ==
b.Ty && a.
Quals ==
b.Quals;
891 return a.
Ty !=
b.Ty || a.
Quals !=
b.Quals;
941 llvm::PointerIntPair<llvm::PointerUnion<const Type *, const ExtQuals *>,
944 const ExtQuals *getExtQualsUnsafe()
const {
948 const Type *getTypePtrUnsafe()
const {
952 const ExtQualsTypeCommonBase *getCommonPtr()
const {
953 assert(!
isNull() &&
"Cannot retrieve a NULL type pointer");
954 auto CommonPtrVal =
reinterpret_cast<uintptr_t>(
Value.getOpaqueValue());
956 return reinterpret_cast<ExtQualsTypeCommonBase*
>(CommonPtrVal);
988 T.Value.setFromOpaqueValue(
const_cast<void*
>(Ptr));
1005 return Value.getPointer().isNull();
1032 std::optional<NonConstantStorageReason>
1200 &&
"non-fast qualifier bits set in mask!");
1201 Value.setInt(Value.getInt() | TQs);
1211 Value.setInt(Value.getInt() & ~Mask);
1218 T.addFastQualifiers(TQs);
1231 T.removeLocalFastQualifiers();
1325 return getSingleStepDesugaredTypeImpl(*
this, Context);
1338 return LHS.Value == RHS.Value;
1341 return LHS.Value != RHS.Value;
1344 return LHS.Value < RHS.Value;
1358 const Twine &PlaceHolder = Twine(),
1359 unsigned Indentation = 0)
const;
1363 unsigned Indentation = 0) {
1364 return print(
split.Ty,
split.Quals, OS, policy, PlaceHolder, Indentation);
1369 const Twine &PlaceHolder,
1370 unsigned Indentation = 0);
1387 const Twine &PlaceHolder;
1388 unsigned Indentation;
1392 const Twine &PlaceHolder,
unsigned Indentation)
1393 : T(T), Policy(Policy), PlaceHolder(PlaceHolder),
1394 Indentation(Indentation) {}
1398 SQT.T.
print(OS, SQT.Policy, SQT.PlaceHolder, SQT.Indentation);
1404 const Twine &PlaceHolder = Twine(),
1405 unsigned Indentation = 0)
const {
1409 void dump(
const char *
s)
const;
1411 void dump(llvm::raw_ostream &OS,
const ASTContext &Context)
const;
1474 return PtrAuth.isAddressDiscriminated();
1561 return isDestructedTypeImpl(*
this);
1663raw_ostream &
operator<<(raw_ostream &OS, QualType QT);
1701class ExtQualsTypeCommonBase {
1712 const Type *
const BaseType;
1717 ExtQualsTypeCommonBase(
const Type *baseType,
QualType canon)
1718 : BaseType(baseType), CanonicalType(canon) {}
1731class alignas(TypeAlignment)
ExtQuals :
public ExtQualsTypeCommonBase,
1732 public llvm::FoldingSetNode {
1754 : ExtQualsTypeCommonBase(baseType,
1755 canon.isNull() ?
QualType(this_(), 0) : canon),
1757 assert(Quals.hasNonFastQualifiers()
1758 &&
"ExtQuals created with no fast qualifiers");
1759 assert(!Quals.hasFastQualifiers()
1760 &&
"ExtQuals created with fast qualifiers");
1770 return Quals.getObjCLifetime();
1784 const Type *BaseType,
1786 assert(!Quals.hasFastQualifiers() &&
"fast qualifiers in ExtQuals hash!");
1787 ID.AddPointer(BaseType);
1845enum class ArraySizeModifier;
1846enum class ElaboratedTypeKeyword;
1847enum class VectorKind;
1875class alignas(TypeAlignment)
Type :
public ExtQualsTypeCommonBase {
1878#define TYPE(Class, Base) Class,
1879#define LAST_TYPE(Class) TypeLast = Class
1880#define ABSTRACT_TYPE(Class, Base)
1881#include "clang/AST/TypeNodes.inc"
1886 class TypeBitfields {
1888 template <
class T>
friend class TypePropertyCache;
1891 LLVM_PREFERRED_TYPE(TypeClass)
1896 unsigned Dependence : llvm::BitWidth<TypeDependence>;
1900 LLVM_PREFERRED_TYPE(
bool)
1901 mutable unsigned CacheValid : 1;
1905 mutable unsigned CachedLinkage : 3;
1908 LLVM_PREFERRED_TYPE(
bool)
1909 mutable unsigned CachedLocalOrUnnamed : 1;
1912 LLVM_PREFERRED_TYPE(
bool)
1913 mutable unsigned FromAST : 1;
1915 bool isCacheValid()
const {
1920 assert(isCacheValid() &&
"getting linkage from invalid cache");
1921 return static_cast<Linkage>(CachedLinkage);
1924 bool hasLocalOrUnnamedType()
const {
1925 assert(isCacheValid() &&
"getting linkage from invalid cache");
1926 return CachedLocalOrUnnamed;
1929 enum { NumTypeBits = 8 + llvm::BitWidth<TypeDependence> + 6 };
1938 LLVM_PREFERRED_TYPE(TypeBitfields)
1944 unsigned IndexTypeQuals : 3;
1949 unsigned SizeModifier : 3;
1960 LLVM_PREFERRED_TYPE(
bool)
1961 unsigned HasExternalSize : 1;
1963 LLVM_PREFERRED_TYPE(
unsigned)
1964 unsigned SizeWidth : 5;
1970 LLVM_PREFERRED_TYPE(TypeBitfields)
1974 static constexpr unsigned NumOfBuiltinTypeBits = 10;
1975 unsigned Kind : NumOfBuiltinTypeBits;
1990 LLVM_PREFERRED_TYPE(TypeBitfields)
1997 unsigned RefQualifier : 2;
2008 LLVM_PREFERRED_TYPE(
bool)
2009 unsigned HasExtQuals : 1;
2013 unsigned ExceptionSpecType : 4;
2016 LLVM_PREFERRED_TYPE(
bool)
2017 unsigned HasExtParameterInfos : 1;
2020 LLVM_PREFERRED_TYPE(
bool)
2021 unsigned HasExtraBitfields : 1;
2024 LLVM_PREFERRED_TYPE(
bool)
2025 unsigned Variadic : 1;
2028 LLVM_PREFERRED_TYPE(
bool)
2029 unsigned HasTrailingReturn : 1;
2032 LLVM_PREFERRED_TYPE(
bool)
2033 unsigned CFIUncheckedCallee : 1;
2038 unsigned ExtInfo : 14;
2050 LLVM_PREFERRED_TYPE(TypeBitfields)
2054 unsigned NumTypeArgs : 7;
2057 unsigned NumProtocols : 6;
2060 LLVM_PREFERRED_TYPE(
bool)
2061 unsigned IsKindOf : 1;
2067 LLVM_PREFERRED_TYPE(TypeBitfields)
2081 LLVM_PREFERRED_TYPE(
bool)
2082 unsigned SpelledAsLValue : 1;
2086 LLVM_PREFERRED_TYPE(
bool)
2087 unsigned InnerRef : 1;
2093 LLVM_PREFERRED_TYPE(TypeBitfields)
2098 unsigned Keyword : 8;
2110 LLVM_PREFERRED_TYPE(
bool)
2111 unsigned HasQualifier : 1;
2114 LLVM_PREFERRED_TYPE(
bool)
2115 unsigned OwnsTag : 1;
2118 LLVM_PREFERRED_TYPE(
bool)
2119 unsigned IsInjected : 1;
2126 LLVM_PREFERRED_TYPE(TypeBitfields)
2132 unsigned VecKind : 4;
2134 uint32_t NumElements;
2140 LLVM_PREFERRED_TYPE(TypeBitfields)
2144 unsigned AttrKind : 32 - NumTypeBits;
2170 unsigned Keyword : 2;
2186 LLVM_PREFERRED_TYPE(TypeBitfields)
2199 LLVM_PREFERRED_TYPE(
bool)
2200 unsigned hasQualifier : 1;
2210 LLVM_PREFERRED_TYPE(
bool)
2211 unsigned hasQualifier : 1;
2221 LLVM_PREFERRED_TYPE(
bool)
2222 unsigned hasQualifier : 1;
2225 LLVM_PREFERRED_TYPE(
bool)
2226 unsigned hasTypeDifferentFromDecl : 1;
2235 LLVM_PREFERRED_TYPE(TypeBitfields)
2242 LLVM_PREFERRED_TYPE(
bool)
2243 unsigned ParameterPack : 1;
2252 LLVM_PREFERRED_TYPE(TypeBitfields)
2255 LLVM_PREFERRED_TYPE(
bool)
2256 unsigned HasNonCanonicalUnderlyingType : 1;
2259 unsigned Index : 15;
2261 LLVM_PREFERRED_TYPE(
bool)
2269 unsigned PackIndex : 15;
2276 LLVM_PREFERRED_TYPE(TypeBitfields)
2283 unsigned NumArgs : 16;
2289 unsigned SubstTemplTypeParmPackIndex : 16;
2299 LLVM_PREFERRED_TYPE(
bool)
2300 unsigned TypeAlias : 1;
2315 LLVM_PREFERRED_TYPE(TypeBitfields)
2329 unsigned NumExpansions;
2349 LLVM_PREFERRED_TYPE(TypeBitfields)
2359 LLVM_PREFERRED_TYPE(TypeBitfields)
2362 static constexpr unsigned NumCoupledDeclsBits = 4;
2363 unsigned NumCoupledDecls : NumCoupledDeclsBits;
2364 LLVM_PREFERRED_TYPE(
bool)
2365 unsigned CountInBytes : 1;
2366 LLVM_PREFERRED_TYPE(
bool)
2367 unsigned OrNull : 1;
2402 void setFromAST(
bool V =
true)
const {
2410 : ExtQualsTypeCommonBase(this,
2412 static_assert(
sizeof(*this) <=
2413 alignof(
decltype(*this)) +
sizeof(ExtQualsTypeCommonBase),
2414 "changing bitfields changed sizeof(Type)!");
2415 static_assert(
alignof(
decltype(*this)) %
TypeAlignment == 0,
2416 "Insufficient alignment!");
2420 TypeBits.CachedLocalOrUnnamed =
false;
2429 TypeBits.Dependence =
static_cast<unsigned>(D);
2472 return CanonicalType ==
QualType(
this, 0);
2478 QualType getLocallyUnqualifiedSingleStepDesugaredType()
const;
2486 bool isSizelessType()
const;
2487 bool isSizelessBuiltinType()
const;
2490 bool isSizelessVectorType()
const;
2493 bool isSVESizelessBuiltinType()
const;
2496 bool isRVVSizelessBuiltinType()
const;
2499 bool isWebAssemblyExternrefType()
const;
2504 bool isWebAssemblyTableType()
const;
2509 bool isSveVLSBuiltinType()
const;
2519 bool isRVVVLSBuiltinType()
const;
2541 bool isIncompleteType(
NamedDecl **Def =
nullptr)
const;
2567 bool isAlwaysIncompleteType()
const;
2579 bool isLiteralType(
const ASTContext &Ctx)
const;
2582 bool isStructuralType()
const;
2586 bool isStandardLayoutType()
const;
2592 bool isBuiltinType()
const;
2595 bool isSpecificBuiltinType(
unsigned K)
const;
2600 bool isPlaceholderType()
const;
2604 bool isSpecificPlaceholderType(
unsigned K)
const;
2608 bool isNonOverloadPlaceholderType()
const;
2612 bool isIntegerType()
const;
2613 bool isEnumeralType()
const;
2616 bool isScopedEnumeralType()
const;
2618 bool isCharType()
const;
2619 bool isWideCharType()
const;
2620 bool isChar8Type()
const;
2621 bool isChar16Type()
const;
2622 bool isChar32Type()
const;
2623 bool isAnyCharacterType()
const;
2624 bool isUnicodeCharacterType()
const;
2625 bool isIntegralType(
const ASTContext &Ctx)
const;
2628 bool isIntegralOrEnumerationType()
const;
2631 bool isIntegralOrUnscopedEnumerationType()
const;
2632 bool isUnscopedEnumerationType()
const;
2635 bool isRealFloatingType()
const;
2638 bool isComplexType()
const;
2639 bool isAnyComplexType()
const;
2640 bool isFloatingType()
const;
2641 bool isHalfType()
const;
2642 bool isFloat16Type()
const;
2643 bool isFloat32Type()
const;
2644 bool isDoubleType()
const;
2645 bool isBFloat16Type()
const;
2646 bool isMFloat8Type()
const;
2647 bool isFloat128Type()
const;
2648 bool isIbm128Type()
const;
2649 bool isRealType()
const;
2650 bool isArithmeticType()
const;
2651 bool isVoidType()
const;
2652 bool isScalarType()
const;
2653 bool isAggregateType()
const;
2654 bool isFundamentalType()
const;
2655 bool isCompoundType()
const;
2659 bool isFunctionType()
const;
2662 bool isPointerType()
const;
2663 bool isPointerOrReferenceType()
const;
2664 bool isSignableType(
const ASTContext &Ctx)
const;
2665 bool isSignablePointerType()
const;
2666 bool isSignableIntegerType(
const ASTContext &Ctx)
const;
2667 bool isAnyPointerType()
const;
2668 bool isCountAttributedType()
const;
2669 bool isCFIUncheckedCalleeFunctionType()
const;
2670 bool hasPointeeToCFIUncheckedCalleeFunctionType()
const;
2671 bool isBlockPointerType()
const;
2672 bool isVoidPointerType()
const;
2673 bool isReferenceType()
const;
2674 bool isLValueReferenceType()
const;
2675 bool isRValueReferenceType()
const;
2676 bool isObjectPointerType()
const;
2677 bool isFunctionPointerType()
const;
2678 bool isFunctionReferenceType()
const;
2679 bool isMemberPointerType()
const;
2680 bool isMemberFunctionPointerType()
const;
2681 bool isMemberDataPointerType()
const;
2682 bool isArrayType()
const;
2683 bool isConstantArrayType()
const;
2684 bool isIncompleteArrayType()
const;
2685 bool isVariableArrayType()
const;
2686 bool isArrayParameterType()
const;
2687 bool isDependentSizedArrayType()
const;
2689 bool isClassType()
const;
2690 bool isStructureType()
const;
2691 bool isStructureTypeWithFlexibleArrayMember()
const;
2692 bool isObjCBoxableRecordType()
const;
2693 bool isInterfaceType()
const;
2694 bool isStructureOrClassType()
const;
2695 bool isUnionType()
const;
2696 bool isComplexIntegerType()
const;
2697 bool isVectorType()
const;
2698 bool isExtVectorType()
const;
2699 bool isExtVectorBoolType()
const;
2700 bool isConstantMatrixBoolType()
const;
2703 bool isPackedVectorBoolType(
const ASTContext &ctx)
const;
2704 bool isSubscriptableVectorType()
const;
2705 bool isMatrixType()
const;
2706 bool isConstantMatrixType()
const;
2707 bool isOverflowBehaviorType()
const;
2708 bool isDependentAddressSpaceType()
const;
2709 bool isObjCObjectPointerType()
const;
2710 bool isObjCRetainableType()
const;
2711 bool isObjCLifetimeType()
const;
2712 bool isObjCIndirectLifetimeType()
const;
2713 bool isObjCNSObjectType()
const;
2714 bool isObjCIndependentClassType()
const;
2717 bool isObjCObjectType()
const;
2718 bool isObjCQualifiedInterfaceType()
const;
2719 bool isObjCQualifiedIdType()
const;
2720 bool isObjCQualifiedClassType()
const;
2721 bool isObjCObjectOrInterfaceType()
const;
2722 bool isObjCIdType()
const;
2723 bool isDecltypeType()
const;
2731 return hasAttr(attr::ObjCInertUnsafeUnretained);
2741 bool isObjCIdOrObjectKindOfType(
const ASTContext &ctx,
2744 bool isObjCClassType()
const;
2752 bool isObjCClassOrClassKindOfType()
const;
2754 bool isBlockCompatibleObjCPointerType(
ASTContext &ctx)
const;
2755 bool isObjCSelType()
const;
2756 bool isObjCBuiltinType()
const;
2757 bool isObjCARCBridgableType()
const;
2758 bool isCARCBridgableType()
const;
2759 bool isTemplateTypeParmType()
const;
2760 bool isNullPtrType()
const;
2762 bool isNothrowT()
const;
2763 bool isAlignValT()
const;
2764 bool isStdByteType()
const;
2765 bool isAtomicType()
const;
2766 bool isUndeducedAutoType()
const;
2768 bool isTypedefNameType()
const;
2770#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
2771 bool is##Id##Type() const;
2772#include "clang/Basic/OpenCLImageTypes.def"
2774 bool isImageType()
const;
2776 bool isSamplerT()
const;
2777 bool isEventT()
const;
2778 bool isClkEventT()
const;
2779 bool isQueueT()
const;
2780 bool isReserveIDT()
const;
2782#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
2783 bool is##Id##Type() const;
2784#include "clang/Basic/OpenCLExtensionTypes.def"
2786 bool isOCLIntelSubgroupAVCType()
const;
2787 bool isOCLExtOpaqueType()
const;
2789 bool isPipeType()
const;
2790 bool isBitIntType()
const;
2791 bool isOpenCLSpecificType()
const;
2793#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) bool is##Id##Type() const;
2794#include "clang/Basic/HLSLIntangibleTypes.def"
2795 bool isHLSLSpecificType()
const;
2796 bool isHLSLBuiltinIntangibleType()
const;
2797 bool isHLSLAttributedResourceType()
const;
2798 bool isHLSLInlineSpirvType()
const;
2799 bool isHLSLResourceRecord()
const;
2800 bool isHLSLResourceRecordArray()
const;
2801 bool isHLSLIntangibleType()
2807 bool isObjCARCImplicitlyUnretainedType()
const;
2810 bool isCUDADeviceBuiltinSurfaceType()
const;
2812 bool isCUDADeviceBuiltinTextureType()
const;
2815 Qualifiers::ObjCLifetime getObjCARCImplicitLifetime()
const;
2831 ScalarTypeKind getScalarTypeKind()
const;
2859 bool isUndeducedType()
const;
2868 bool hasSizedVLAType()
const;
2871 bool hasUnnamedOrLocalType()
const;
2873 bool isOverloadableType()
const;
2876 bool isElaboratedTypeSpecifier()
const;
2878 bool canDecayToPointerType()
const;
2883 bool hasPointerRepresentation()
const;
2887 bool hasObjCPointerRepresentation()
const;
2891 bool hasIntegerRepresentation()
const;
2895 bool hasSignedIntegerRepresentation()
const;
2899 bool hasUnsignedIntegerRepresentation()
const;
2903 bool hasFloatingRepresentation()
const;
2908 bool hasBooleanRepresentation()
const;
2913 const RecordType *getAsStructureType()
const;
2915 const RecordType *getAsUnionType()
const;
2916 const ComplexType *getAsComplexIntegerType()
const;
2937 inline EnumDecl *getAsEnumDecl()
const;
2938 inline EnumDecl *castAsEnumDecl()
const;
2943 inline TagDecl *getAsTagDecl()
const;
2944 inline TagDecl *castAsTagDecl()
const;
2956 DeducedType *getContainedDeducedType()
const;
2968 bool hasAutoForTrailingReturnType()
const;
2979 template <
typename T>
const T *getAs()
const;
2984 return dyn_cast<T>(CanonicalType);
2991 return cast<T>(CanonicalType);
2995#define TYPE(Class, Base)
2996#define NEVER_CANONICAL_TYPE(Class) \
2997 template <> inline const Class##Type *Type::getAsCanonical() const = delete; \
2998 template <> inline const Class##Type *Type::castAsCanonical() const = delete;
2999#include "clang/AST/TypeNodes.inc"
3005 const TemplateSpecializationType *
3006 getAsNonAliasTemplateSpecializationType()
const;
3008 const TemplateSpecializationType *
3011 assert(TST &&
"not a TemplateSpecializationType");
3020 template <
typename T>
const T *getAsAdjusted()
const;
3024 const ArrayType *getAsArrayTypeUnsafe()
const;
3032 template <
typename T>
const T *castAs()
const;
3036 const ArrayType *castAsArrayTypeUnsafe()
const;
3050 const Type *getBaseElementTypeUnsafe()
const;
3055 const Type *getArrayElementTypeNoTypeQual()
const;
3060 const Type *getPointeeOrArrayElementType()
const;
3068 const Type *getUnqualifiedDesugaredType()
const;
3073 bool isSignedIntegerType()
const;
3078 bool isUnsignedIntegerType()
const;
3082 bool isSignedIntegerOrEnumerationType()
const;
3086 bool isUnsignedIntegerOrEnumerationType()
const;
3090 bool isFixedPointType()
const;
3093 bool isFixedPointOrIntegerType()
const;
3096 bool isConvertibleToFixedPointType()
const;
3100 bool isSaturatedFixedPointType()
const;
3104 bool isUnsaturatedFixedPointType()
const;
3108 bool isSignedFixedPointType()
const;
3112 bool isUnsignedFixedPointType()
const;
3117 bool isConstantSizeType()
const;
3121 bool isSpecifierType()
const;
3141 bool isLinkageValid()
const;
3155 bool canHaveNullability(
bool ResultIfUnknown =
true)
const;
3172 std::optional<ArrayRef<QualType>>
3173 getObjCSubstitutions(
const DeclContext *dc)
const;
3177 bool acceptsObjCTypeParams()
const;
3179 const char *getTypeClassName()
const;
3182 return CanonicalType;
3187 void dump(llvm::raw_ostream &OS,
const ASTContext &Context)
const;
3214#define TYPE(Class, Base)
3215#define ALWAYS_CANONICAL_TYPE(Class) \
3216 template <> inline const Class##Type *Type::getAs() const { \
3217 return dyn_cast<Class##Type>(CanonicalType); \
3219 template <> inline const Class##Type *Type::castAs() const { \
3220 return cast<Class##Type>(CanonicalType); \
3222#include "clang/AST/TypeNodes.inc"
3230#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) Id,
3231#include "clang/Basic/OpenCLImageTypes.def"
3233#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) Id,
3234#include "clang/Basic/OpenCLExtensionTypes.def"
3236#define SVE_TYPE(Name, Id, SingletonId) Id,
3237#include "clang/Basic/AArch64ACLETypes.def"
3239#define PPC_VECTOR_TYPE(Name, Id, Size) Id,
3240#include "clang/Basic/PPCTypes.def"
3242#define RVV_TYPE(Name, Id, SingletonId) Id,
3243#include "clang/Basic/RISCVVTypes.def"
3245#define WASM_TYPE(Name, Id, SingletonId) Id,
3246#include "clang/Basic/WebAssemblyReferenceTypes.def"
3248#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) Id,
3249#include "clang/Basic/AMDGPUTypes.def"
3251#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) Id,
3252#include "clang/Basic/HLSLIntangibleTypes.def"
3254#define BUILTIN_TYPE(Id, SingletonId) Id,
3255#define LAST_BUILTIN_TYPE(Id) LastKind = Id
3256#include "clang/AST/BuiltinTypes.def"
3266 static_assert(Kind::LastKind <
3267 (1 << BuiltinTypeBitfields::NumOfBuiltinTypeBits) &&
3268 "Defined builtin type exceeds the allocated space for serial "
3279 StringRef str =
getName(Policy);
3280 assert(!str.empty() && str.data()[str.size()] ==
'\0');
3337class ComplexType :
public Type,
public llvm::FoldingSetNode {
3344 ElementType(Element) {}
3364class ParenType :
public Type,
public llvm::FoldingSetNode {
3390class PointerType :
public Type,
public llvm::FoldingSetNode {
3397 PointeeType(Pointee) {}
3420 using BaseTy = llvm::PointerIntPair<ValueDecl *, 1, unsigned>;
3435 bool isDeref()
const;
3437 unsigned getInt()
const;
3438 void *getOpaqueValue()
const;
3440 void setFromOpaqueValue(
void *
V);
3478 bool referencesFieldDecls()
const;
3484 switch (T->getTypeClass()) {
3485 case CountAttributed:
3495class CountAttributedType final
3497 public llvm::TrailingObjects<CountAttributedType,
3498 TypeCoupledDeclRefInfo> {
3509 bool CountInBytes,
bool OrNull,
3512 unsigned numTrailingObjects(OverloadToken<TypeCoupledDeclRefInfo>)
const {
3538 static void Profile(llvm::FoldingSetNodeID &ID,
QualType WrappedTy,
3542 return T->getTypeClass() == CountAttributed;
3545 StringRef getAttributeName(
bool WithMacroPrefix)
const;
3560 :
Type(TC, CanonicalPtr,
3563 OriginalTy(OriginalTy), AdjustedTy(AdjustedTy) {}
3573 Profile(ID, OriginalTy, AdjustedTy);
3578 ID.AddPointer(
New.getAsOpaquePtr());
3582 return T->getTypeClass() == Adjusted || T->getTypeClass() == Decayed;
3598 static bool classof(
const Type *T) {
return T->getTypeClass() == Decayed; }
3604class BlockPointerType :
public Type,
public llvm::FoldingSetNode {
3612 PointeeType(Pointee) {}
3630 return T->getTypeClass() == BlockPointer;
3640 bool SpelledAsLValue)
3642 PointeeType(Referencee) {
3656 while (T->isInnerRef())
3658 return T->PointeeType;
3667 bool SpelledAsLValue) {
3669 ID.AddBoolean(SpelledAsLValue);
3673 return T->getTypeClass() == LValueReference ||
3674 T->getTypeClass() == RValueReference;
3683 bool SpelledAsLValue)
3692 return T->getTypeClass() == LValueReference;
3708 return T->getTypeClass() == RValueReference;
3715class MemberPointerType :
public Type,
public llvm::FoldingSetNode {
3726 :
Type(MemberPointer, CanonicalPtr,
3730 PointeeType(Pointee), Qualifier(Qualifier) {}
3738 return PointeeType->isFunctionProtoType();
3744 return !PointeeType->isFunctionProtoType();
3753 bool isSugared()
const;
3765 static void Profile(llvm::FoldingSetNodeID &ID,
QualType Pointee,
3770 return T->getTypeClass() == MemberPointer;
3793 unsigned tq,
const Expr *sz =
nullptr);
3811 return T->getTypeClass() == ConstantArray ||
3812 T->getTypeClass() == VariableArray ||
3813 T->getTypeClass() == IncompleteArray ||
3814 T->getTypeClass() == DependentSizedArray ||
3815 T->getTypeClass() == ArrayParameter;
3825 struct ExternalSize {
3826 ExternalSize(
const llvm::APInt &Sz,
const Expr *SE)
3827 :
Size(Sz), SizeExpr(SE) {}
3829 const Expr *SizeExpr;
3840 ConstantArrayTypeBits.HasExternalSize =
false;
3841 ConstantArrayTypeBits.SizeWidth = Width / 8;
3844 assert(Width < 0xFF &&
"Type width in bits must be less than 8 bits");
3847 ConstantArrayType(QualType Et, QualType Can, ExternalSize *SzPtr,
3848 ArraySizeModifier
SM,
unsigned TQ)
3849 : ArrayType(ConstantArray, Et, Can,
SM, TQ, SzPtr->SizeExpr),
3851 ConstantArrayTypeBits.HasExternalSize =
true;
3852 ConstantArrayTypeBits.SizeWidth = 0;
3854 assert((SzPtr->SizeExpr ==
nullptr || !Can.isNull()) &&
3855 "canonical constant array should not have size expression");
3858 static ConstantArrayType *
Create(
const ASTContext &Ctx, QualType ET,
3859 QualType Can,
const llvm::APInt &Sz,
3860 const Expr *SzExpr, ArraySizeModifier SzMod,
3870 ConstantArrayTypeBits.SizeWidth = ATy->ConstantArrayTypeBits.SizeWidth;
3906 :
static_cast<int64_t
>(
Size);
3913 ?
SizePtr->Size.getLimitedValue()
3927 static unsigned getNumAddressingBits(
const ASTContext &Context,
3929 const llvm::APInt &NumElements);
3931 unsigned getNumAddressingBits(
const ASTContext &Context)
const;
3935 static unsigned getMaxSizeBits(
const ASTContext &Context);
3942 static void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Ctx,
3947 return T->getTypeClass() == ConstantArray ||
3948 T->getTypeClass() == ArrayParameter;
3954class ArrayParameterType :
public ConstantArrayType {
3957 ArrayParameterType(
const ConstantArrayType *ATy,
QualType CanTy)
3958 : ConstantArrayType(ArrayParameter, ATy, CanTy) {}
3962 return T->getTypeClass() == ArrayParameter;
3976 :
ArrayType(IncompleteArray, et, can, sm, tq) {}
3985 return T->getTypeClass() == IncompleteArray;
3996 ID.AddInteger(llvm::to_underlying(SizeMod));
3997 ID.AddInteger(TypeQuals);
4037 :
ArrayType(VariableArray, et, can, sm, tq, e), SizeExpr((
Stmt *)e) {}
4045 return (
Expr*) SizeExpr;
4052 return T->getTypeClass() == VariableArray;
4056 llvm_unreachable(
"Cannot unique VariableArrayTypes.");
4092 return (
Expr*) SizeExpr;
4099 return T->getTypeClass() == DependentSizedArray;
4107 static void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context,
4109 unsigned TypeQuals,
Expr *E);
4123class DependentAddressSpaceType :
public Type,
public llvm::FoldingSetNode {
4126 Expr *AddrSpaceExpr;
4142 return T->getTypeClass() == DependentAddressSpace;
4149 static void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context,
4163class DependentSizedExtVectorType :
public Type,
public llvm::FoldingSetNode {
4185 return T->getTypeClass() == DependentSizedExtVector;
4192 static void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context,
4270 ID.AddInteger(NumElements);
4272 ID.AddInteger(llvm::to_underlying(VecKind));
4276 return T->getTypeClass() ==
Vector || T->getTypeClass() == ExtVector;
4289class DependentVectorType :
public Type,
public llvm::FoldingSetNode {
4311 return T->getTypeClass() == DependentVector;
4318 static void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context,
4333 :
VectorType(ExtVector, vecType, nElements, canonType,
4340 case 'x':
case 'r':
return 0;
4341 case 'y':
case 'g':
return 1;
4342 case 'z':
case 'b':
return 2;
4343 case 'w':
case 'a':
return 3;
4361 case 'a':
return 10;
4363 case 'b':
return 11;
4365 case 'c':
return 12;
4367 case 'd':
return 13;
4369 case 'e':
return 14;
4371 case 'f':
return 15;
4376 if (isNumericAccessor)
4392 return T->getTypeClass() == ExtVector;
4409 const Expr *RowExpr =
nullptr,
const Expr *ColumnExpr =
nullptr);
4422 if (T->isDependentType())
4426 if (T->isEnumeralType())
4432 return T->isRealType();
4436 return T->isRealType() && !T->isBooleanType();
4443 return T->getTypeClass() == ConstantMatrix ||
4444 T->getTypeClass() == DependentSizedMatrix;
4458 unsigned NColumns,
QualType CanonElementType);
4461 unsigned NColumns,
QualType CanonElementType);
4492 bool IsRowMajor =
false)
const {
4502 unsigned Row = ColumnMajorIdx %
NumRows;
4529 return T->getTypeClass() == ConstantMatrix;
4552 return T->getTypeClass() == DependentSizedMatrix;
4559 static void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context,
4595 HasPassObjSize = 0x20,
4598 unsigned char Data = 0;
4607 copy.Data = (copy.Data & ~ABIMask) |
unsigned(
kind);
4617 copy.Data |= IsConsumed;
4619 copy.Data &= ~IsConsumed;
4626 Copy.Data |= HasPassObjSize;
4634 Copy.Data |= IsNoEscape;
4636 Copy.Data &= ~IsNoEscape;
4648 return lhs.Data == rhs.Data;
4652 return lhs.Data != rhs.Data;
4687 enum { CallConvMask = 0x3F };
4688 enum { NoReturnMask = 0x40 };
4689 enum { ProducesResultMask = 0x80 };
4690 enum { NoCallerSavedRegsMask = 0x100 };
4691 enum { RegParmMask = 0xe00, RegParmOffset = 9 };
4692 enum { NoCfCheckMask = 0x1000 };
4693 enum { CmseNSCallMask = 0x2000 };
4694 uint16_t Bits =
CC_C;
4696 ExtInfo(
unsigned Bits) : Bits(static_cast<uint16_t>(Bits)) {}
4702 bool producesResult,
bool noCallerSavedRegs,
bool NoCfCheck,
4704 assert((!hasRegParm || regParm < 7) &&
"Invalid regparm value");
4705 Bits = ((
unsigned)cc) | (noReturn ? NoReturnMask : 0) |
4706 (producesResult ? ProducesResultMask : 0) |
4707 (noCallerSavedRegs ? NoCallerSavedRegsMask : 0) |
4708 (hasRegParm ? ((regParm + 1) << RegParmOffset) : 0) |
4709 (NoCfCheck ? NoCfCheckMask : 0) |
4710 (cmseNSCall ? CmseNSCallMask : 0);
4726 bool getHasRegParm()
const {
return ((Bits & RegParmMask) >> RegParmOffset) != 0; }
4729 unsigned RegParm = (Bits & RegParmMask) >> RegParmOffset;
4738 return Bits ==
Other.Bits;
4741 return Bits !=
Other.Bits;
4749 return ExtInfo(Bits | NoReturnMask);
4751 return ExtInfo(Bits & ~NoReturnMask);
4756 return ExtInfo(Bits | ProducesResultMask);
4758 return ExtInfo(Bits & ~ProducesResultMask);
4763 return ExtInfo(Bits | CmseNSCallMask);
4765 return ExtInfo(Bits & ~CmseNSCallMask);
4769 if (noCallerSavedRegs)
4770 return ExtInfo(Bits | NoCallerSavedRegsMask);
4772 return ExtInfo(Bits & ~NoCallerSavedRegsMask);
4777 return ExtInfo(Bits | NoCfCheckMask);
4779 return ExtInfo(Bits & ~NoCfCheckMask);
4783 assert(RegParm < 7 &&
"Invalid regparm value");
4784 return ExtInfo((Bits & ~RegParmMask) |
4785 ((RegParm + 1) << RegParmOffset));
4789 return ExtInfo((Bits & ~CallConvMask) | (
unsigned) cc);
4793 ID.AddInteger(Bits);
4811 LLVM_PREFERRED_TYPE(
bool)
4814 LLVM_PREFERRED_TYPE(
bool)
4817 LLVM_PREFERRED_TYPE(
bool)
4917 bool getCFIUncheckedCalleeAttr()
const;
4924 "Const, volatile and restrict are assumed to be a subset of "
4925 "the fast qualifiers.");
4937 static StringRef getNameForCallConv(
CallingConv CC);
4940 return T->getTypeClass() == FunctionNoProto ||
4941 T->getTypeClass() == FunctionProto;
4947class FunctionNoProtoType :
public FunctionType,
public llvm::FoldingSetNode {
4970 ID.AddPointer(ResultType.getAsOpaquePtr());
4974 return T->getTypeClass() == FunctionNoProto;
5024 Kind oppositeKind()
const;
5047 llvm_unreachable(
"unknown effect kind");
5051 StringRef name()
const;
5055 OS << Effect.
name();
5065 std::optional<FunctionEffect>
5066 effectProhibitingInference(
const Decl &Callee,
5073 bool shouldDiagnoseFunctionCall(
bool Direct,
5077 return LHS.FKind == RHS.FKind;
5080 return !(LHS == RHS);
5083 return LHS.FKind < RHS.FKind;
5090 Expr *Cond =
nullptr;
5099 return Cond == RHS.Cond;
5114 std::string description()
const;
5116 friend raw_ostream &
operator<<(raw_ostream &OS,
5125 const Container *Outer =
nullptr;
5132 return Idx ==
Other.Idx;
5135 return Idx !=
Other.Idx;
5144 assert(Outer !=
nullptr &&
"invalid FunctionEffectIterator");
5145 bool HasConds = !Outer->Conditions.empty();
5147 HasConds ? Outer->Conditions[Idx]
5169class FunctionEffectsRef {
5174 friend FunctionProtoType;
5175 friend FunctionEffectSet;
5186 : Effects(FX), Conditions(Conds) {}
5199 bool empty()
const {
return Effects.empty(); }
5200 size_t size()
const {
return Effects.size(); }
5211 const FunctionEffectsRef &RHS) {
5212 return LHS.Effects == RHS.Effects && LHS.Conditions == RHS.Conditions;
5215 const FunctionEffectsRef &RHS) {
5216 return !(LHS == RHS);
5219 void dump(llvm::raw_ostream &OS)
const;
5223class FunctionEffectKindSet {
5226 using KindBitsT = std::bitset<EndBitPos>;
5228 KindBitsT KindBits{};
5230 explicit FunctionEffectKindSet(KindBitsT KB) : KindBits(KB) {}
5236 return static_cast<size_t>(K);
5245 const FunctionEffectKindSet *Outer =
nullptr;
5250 void advanceToNextSetBit() {
5251 while (Idx < EndBitPos && !Outer->KindBits.test(Idx))
5257 iterator(
const FunctionEffectKindSet &O,
size_t I) : Outer(&O), Idx(I) {
5258 advanceToNextSetBit();
5263 iterator operator++() {
5265 advanceToNextSetBit();
5270 assert(Idx < EndBitPos &&
"Dereference of end iterator");
5279 iterator
begin()
const {
return iterator(*
this, 0); }
5280 iterator
end()
const {
return iterator(*
this, EndBitPos); }
5289 bool empty()
const {
return KindBits.none(); }
5291 return KindBits.test(kindToPos(EK));
5293 void dump(llvm::raw_ostream &OS)
const;
5295 static FunctionEffectKindSet
difference(FunctionEffectKindSet LHS,
5296 FunctionEffectKindSet RHS) {
5297 return FunctionEffectKindSet(LHS.KindBits & ~RHS.KindBits);
5313 : Effects(FX.effects()), Conditions(FX.conditions()) {}
5315 bool empty()
const {
return Effects.empty(); }
5316 size_t size()
const {
return Effects.size(); }
5325 void dump(llvm::raw_ostream &OS)
const;
5360class FunctionProtoType final
5362 public llvm::FoldingSetNode,
5363 private llvm::TrailingObjects<
5364 FunctionProtoType, QualType, SourceLocation,
5365 FunctionType::FunctionTypeExtraBitfields,
5366 FunctionType::FunctionTypeExtraAttributeInfo,
5367 FunctionType::FunctionTypeArmAttributes, FunctionType::ExceptionType,
5368 Expr *, FunctionDecl *, FunctionType::ExtParameterInfo, Qualifiers,
5369 FunctionEffect, EffectConditionExpr> {
5371 friend TrailingObjects;
5464 LLVM_PREFERRED_TYPE(
bool)
5466 LLVM_PREFERRED_TYPE(
bool)
5468 LLVM_PREFERRED_TYPE(
bool)
5483 Result.ExceptionSpec = ESI;
5517 unsigned numTrailingObjects(OverloadToken<QualType>)
const {
5518 return getNumParams();
5521 unsigned numTrailingObjects(OverloadToken<SourceLocation>)
const {
5522 return isVariadic();
5525 unsigned numTrailingObjects(OverloadToken<FunctionTypeArmAttributes>)
const {
5526 return hasArmTypeAttributes();
5529 unsigned numTrailingObjects(OverloadToken<FunctionTypeExtraBitfields>)
const {
5530 return hasExtraBitfields();
5534 numTrailingObjects(OverloadToken<FunctionTypeExtraAttributeInfo>)
const {
5535 return hasExtraAttributeInfo();
5538 unsigned numTrailingObjects(OverloadToken<ExceptionType>)
const {
5539 return getExceptionSpecSize().NumExceptionType;
5542 unsigned numTrailingObjects(OverloadToken<Expr *>)
const {
5543 return getExceptionSpecSize().NumExprPtr;
5546 unsigned numTrailingObjects(OverloadToken<FunctionDecl *>)
const {
5547 return getExceptionSpecSize().NumFunctionDeclPtr;
5550 unsigned numTrailingObjects(OverloadToken<ExtParameterInfo>)
const {
5551 return hasExtParameterInfos() ? getNumParams() : 0;
5554 unsigned numTrailingObjects(OverloadToken<Qualifiers>)
const {
5555 return hasExtQualifiers() ? 1 : 0;
5558 unsigned numTrailingObjects(OverloadToken<FunctionEffect>)
const {
5559 return getNumFunctionEffects();
5564 static bool containsAnyUnexpandedParameterPack(
const QualType *ArgArray,
5566 for (
unsigned Idx = 0; Idx < numArgs; ++Idx)
5567 if (ArgArray[Idx]->containsUnexpandedParameterPack())
5573 FunctionProtoType(QualType result, ArrayRef<QualType> params,
5574 QualType canonical,
const ExtProtoInfo &epi);
5579 struct ExceptionSpecSizeHolder {
5580 unsigned NumExceptionType;
5581 unsigned NumExprPtr;
5582 unsigned NumFunctionDeclPtr;
5587 static ExceptionSpecSizeHolder
5588 getExceptionSpecSize(ExceptionSpecificationType EST,
unsigned NumExceptions) {
5599 return {NumExceptions, 0, 0};
5612 llvm_unreachable(
"bad exception specification kind");
5617 ExceptionSpecSizeHolder getExceptionSpecSize()
const {
5618 return getExceptionSpecSize(getExceptionSpecType(), getNumExceptions());
5622 bool hasExtraBitfields()
const {
5623 assert((getExceptionSpecType() != EST_Dynamic ||
5624 FunctionTypeBits.HasExtraBitfields) &&
5625 "ExtraBitfields are required for given ExceptionSpecType");
5626 return FunctionTypeBits.HasExtraBitfields;
5630 bool hasExtraAttributeInfo()
const {
5631 return FunctionTypeBits.HasExtraBitfields &&
5632 getTrailingObjects<FunctionTypeExtraBitfields>()
5633 ->HasExtraAttributeInfo;
5636 bool hasArmTypeAttributes()
const {
5637 return FunctionTypeBits.HasExtraBitfields &&
5638 getTrailingObjects<FunctionTypeExtraBitfields>()
5639 ->HasArmTypeAttributes;
5642 bool hasExtQualifiers()
const {
5643 return FunctionTypeBits.HasExtQuals;
5650 assert(i <
getNumParams() &&
"invalid parameter index");
5695 bool hasDependentExceptionSpec()
const;
5699 bool hasInstantiationDependentExceptionSpec()
const;
5721 ? getTrailingObjects<FunctionTypeExtraBitfields>()
5737 return *getTrailingObjects<Expr *>();
5748 return getTrailingObjects<FunctionDecl *>()[0];
5758 return getTrailingObjects<FunctionDecl *>()[1];
5776 return isVariadic() ? *getTrailingObjects<SourceLocation>()
5786 bool isTemplateVariadic()
const;
5796 if (hasExtQualifiers())
5797 return *getTrailingObjects<Qualifiers>();
5814 return getTrailingObjects<QualType>();
5829 getTrailingObjects<ExceptionType>());
5854 return getTrailingObjects<ExtParameterInfo>();
5859 if (hasExtraAttributeInfo())
5860 return *getTrailingObjects<FunctionTypeExtraAttributeInfo>();
5867 if (!hasArmTypeAttributes())
5869 return getTrailingObjects<FunctionTypeArmAttributes>()
5870 ->AArch64SMEAttributes;
5874 assert(I <
getNumParams() &&
"parameter index out of range");
5876 return getTrailingObjects<ExtParameterInfo>()[I];
5881 assert(I <
getNumParams() &&
"parameter index out of range");
5883 return getTrailingObjects<ExtParameterInfo>()[I].getABI();
5888 assert(I <
getNumParams() &&
"parameter index out of range");
5890 return getTrailingObjects<ExtParameterInfo>()[I].isConsumed();
5895 return hasExtraBitfields()
5896 ? getTrailingObjects<FunctionTypeExtraBitfields>()
5897 ->NumFunctionEffects
5903 if (hasExtraBitfields()) {
5904 const auto *Bitfields = getTrailingObjects<FunctionTypeExtraBitfields>();
5905 if (Bitfields->NumFunctionEffects > 0)
5906 return getTrailingObjects<FunctionEffect>(
5907 Bitfields->NumFunctionEffects);
5913 if (hasExtraBitfields()) {
5914 const auto *Bitfields = getTrailingObjects<FunctionTypeExtraBitfields>();
5915 if (Bitfields->EffectsHaveConditions)
5916 return Bitfields->NumFunctionEffects;
5923 if (hasExtraBitfields()) {
5924 const auto *Bitfields = getTrailingObjects<FunctionTypeExtraBitfields>();
5925 if (Bitfields->EffectsHaveConditions)
5926 return getTrailingObjects<EffectConditionExpr>(
5927 Bitfields->NumFunctionEffects);
5934 if (hasExtraBitfields()) {
5935 const auto *Bitfields = getTrailingObjects<FunctionTypeExtraBitfields>();
5936 if (Bitfields->NumFunctionEffects > 0) {
5937 const size_t NumConds = Bitfields->EffectsHaveConditions
5938 ? Bitfields->NumFunctionEffects
5941 getTrailingObjects<FunctionEffect>(Bitfields->NumFunctionEffects),
5942 {NumConds ? getTrailingObjects<EffectConditionExpr>() : nullptr,
5952 void printExceptionSpecification(raw_ostream &OS,
5956 return T->getTypeClass() == FunctionProto;
5959 void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Ctx);
6039 template <
class... As>
6042 this->KeywordWrapperBits.Keyword = llvm::to_underlying(
Keyword);
6067 constexpr unsigned long Offset =
6069 const auto *
Addr =
reinterpret_cast<const T *
>(
6070 reinterpret_cast<const char *
>(
this) - Offset);
6071 assert(llvm::isAddrAligned(llvm::Align(
alignof(T)),
Addr));
6081class UnresolvedUsingType final
6083 private llvm::TrailingObjects<UnresolvedUsingType,
6084 FoldingSetPlaceholder<UnresolvedUsingType>,
6085 NestedNameSpecifier> {
6087 friend TrailingObjects;
6091 unsigned numTrailingObjects(
6099 assert(numTrailingObjects(
6102 return getTrailingObjects<FoldingSetPlaceholder<UnresolvedUsingType>>();
6105 UnresolvedUsingType(ElaboratedTypeKeyword Keyword,
6106 NestedNameSpecifier Qualifier,
6107 const UnresolvedUsingTypenameDecl *D,
6108 const Type *CanonicalType);
6113 ? *getTrailingObjects<NestedNameSpecifier>()
6128 Qualifier.Profile(ID);
6136 return T->getTypeClass() == UnresolvedUsing;
6141 public llvm::FoldingSetNode,
6142 llvm::TrailingObjects<UsingType, NestedNameSpecifier> {
6147 friend TrailingObjects;
6154 return UsingBits.hasQualifier ? *getTrailingObjects() : std::nullopt;
6167 UnderlyingType.Profile(ID);
6169 Qualifier.Profile(ID);
6175 static bool classof(
const Type *T) {
return T->getTypeClass() == Using; }
6178class TypedefType final
6180 private llvm::TrailingObjects<TypedefType,
6181 FoldingSetPlaceholder<TypedefType>,
6182 NestedNameSpecifier, QualType> {
6185 friend TrailingObjects;
6194 unsigned numTrailingObjects(OverloadToken<NestedNameSpecifier>)
const {
6195 return TypedefBits.hasQualifier;
6198 TypedefType(TypeClass TC, ElaboratedTypeKeyword Keyword,
6199 NestedNameSpecifier Qualifier,
const TypedefNameDecl *D,
6200 QualType UnderlyingType,
bool HasTypeDifferentFromDecl);
6202 FoldingSetPlaceholder<TypedefType> *getFoldingSetPlaceholder() {
6203 assert(numTrailingObjects(
6204 OverloadToken<FoldingSetPlaceholder<TypedefType>>{}) == 1);
6205 return getTrailingObjects<FoldingSetPlaceholder<TypedefType>>();
6210 return TypedefBits.hasQualifier ? *getTrailingObjects<NestedNameSpecifier>()
6231 ID.AddInteger(llvm::to_underlying(
Keyword));
6233 Qualifier.Profile(ID);
6234 if (!Underlying.
isNull())
6248class MacroQualifiedType :
public Type {
6257 UnderlyingTy(UnderlyingTy), MacroII(MacroII) {
6259 "Expected a macro qualified type to only wrap attributed types.");
6274 return T->getTypeClass() == MacroQualified;
6302 bool isSugared()
const;
6304 static bool classof(
const Type *T) {
return T->getTypeClass() == TypeOfExpr; }
6314 public llvm::FoldingSetNode {
6324 static void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context,
6325 Expr *E,
bool IsUnqual);
6330class TypeOfType :
public Type {
6336 TypeOfType(
const ASTContext &Context, QualType T, QualType Can,
6340 QualType getUnmodifiedType()
const {
return TOType; }
6343 QualType desugar()
const;
6346 bool isSugared()
const {
return true; }
6350 return static_cast<TypeOfKind>(TypeOfBits.Kind);
6353 static bool classof(
const Type *T) {
return T->getTypeClass() == TypeOf; }
6357class DecltypeType :
public Type {
6359 QualType UnderlyingType;
6362 friend class ASTContext;
6364 DecltypeType(Expr *E, QualType underlyingType, QualType can = QualType());
6367 Expr *getUnderlyingExpr()
const {
return E; }
6371 QualType desugar()
const;
6374 bool isSugared()
const;
6376 static bool classof(
const Type *T) {
return T->getTypeClass() == Decltype; }
6385class DependentDecltypeType :
public DecltypeType,
public llvm::FoldingSetNode {
6387 DependentDecltypeType(Expr *E);
6389 void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context) {
6390 Profile(ID, Context, getUnderlyingExpr());
6393 static void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context,
6397class PackIndexingType final
6399 public llvm::FoldingSetNode,
6400 private llvm::TrailingObjects<PackIndexingType, QualType> {
6401 friend TrailingObjects;
6408 LLVM_PREFERRED_TYPE(
bool)
6409 unsigned FullySubstituted : 1;
6412 friend class ASTContext;
6413 PackIndexingType(QualType Canonical, QualType Pattern, Expr *IndexExpr,
6414 bool FullySubstituted, ArrayRef<QualType> Expansions = {});
6417 Expr *getIndexExpr()
const {
return IndexExpr; }
6418 QualType getPattern()
const {
return Pattern; }
6420 bool isSugared()
const {
return hasSelectedType(); }
6422 QualType desugar()
const {
6423 if (hasSelectedType())
6424 return getSelectedType();
6425 return QualType(
this, 0);
6428 QualType getSelectedType()
const {
6429 assert(hasSelectedType() &&
"Type is dependant");
6430 return *(getExpansionsPtr() + *getSelectedIndex());
6435 bool hasSelectedType()
const {
return getSelectedIndex() != std::nullopt; }
6437 bool isFullySubstituted()
const {
return FullySubstituted; }
6439 bool expandsToEmptyPack()
const {
return isFullySubstituted() &&
Size == 0; }
6441 ArrayRef<QualType> getExpansions()
const {
6442 return {getExpansionsPtr(),
Size};
6445 static bool classof(
const Type *T) {
6446 return T->getTypeClass() == PackIndexing;
6449 void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context);
6450 static void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context,
6451 QualType Pattern, Expr *E,
bool FullySubstituted,
6452 ArrayRef<QualType> Expansions);
6455 const QualType *getExpansionsPtr()
const {
return getTrailingObjects(); }
6458 ArrayRef<QualType> Expansions = {});
6462class UnaryTransformType :
public Type,
public llvm::FoldingSetNode {
6465#define TRANSFORM_TYPE_TRAIT_DEF(Enum, _) Enum,
6466#include "clang/Basic/TransformTypeTraits.def"
6474 QualType UnderlyingType;
6479 friend class ASTContext;
6481 UnaryTransformType(QualType BaseTy, QualType UnderlyingTy, UTTKind UKind,
6482 QualType CanonicalTy);
6485 bool isSugared()
const {
return !isDependentType(); }
6486 QualType desugar()
const {
return UnderlyingType; }
6491 UTTKind getUTTKind()
const {
return UKind; }
6493 static bool classof(
const Type *T) {
6494 return T->getTypeClass() == UnaryTransform;
6497 void Profile(llvm::FoldingSetNodeID &ID) {
6501 static void Profile(llvm::FoldingSetNodeID &ID, QualType BaseType,
6502 QualType UnderlyingType, UTTKind UKind) {
6503 BaseType.Profile(ID);
6504 UnderlyingType.Profile(ID);
6505 ID.AddInteger(UKind);
6509class TagType :
public TypeWithKeyword {
6510 friend class ASTContext;
6516 void *getTrailingPointer()
const;
6517 NestedNameSpecifier &getTrailingQualifier()
const;
6520 TagType(TypeClass TC, ElaboratedTypeKeyword Keyword,
6521 NestedNameSpecifier Qualifier,
const TagDecl *TD,
bool OwnsTag,
6522 bool IsInjected,
const Type *CanonicalType);
6525 TagDecl *getDecl()
const {
return decl; }
6526 [[deprecated(
"Use getDecl instead")]] TagDecl *getOriginalDecl()
const {
6530 NestedNameSpecifier getQualifier()
const;
6533 bool isTagOwned()
const {
return TagTypeBits.OwnsTag; }
6535 bool isInjected()
const {
return TagTypeBits.IsInjected; }
6537 ClassTemplateDecl *getTemplateDecl()
const;
6538 TemplateName getTemplateName(
const ASTContext &Ctx)
const;
6539 ArrayRef<TemplateArgument> getTemplateArgs(
const ASTContext &Ctx)
const;
6541 bool isSugared()
const {
return false; }
6542 QualType desugar()
const {
return getCanonicalTypeInternal(); }
6544 static bool classof(
const Type *T) {
6545 return T->getTypeClass() ==
Enum || T->getTypeClass() ==
Record ||
6546 T->getTypeClass() == InjectedClassName;
6550struct TagTypeFoldingSetPlaceholder :
public llvm::FoldingSetNode {
6551 static constexpr size_t getOffset() {
6552 return alignof(TagType) -
6553 (
sizeof(TagTypeFoldingSetPlaceholder) %
alignof(TagType));
6556 static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword,
6557 NestedNameSpecifier Qualifier,
const TagDecl *Tag,
6558 bool OwnsTag,
bool IsInjected) {
6559 ID.AddInteger(
uintptr_t(Tag) | OwnsTag | (IsInjected << 1) |
6560 ((Keyword != ElaboratedTypeKeyword::None) << 2));
6561 if (Keyword != ElaboratedTypeKeyword::None)
6562 ID.AddInteger(llvm::to_underlying(Keyword));
6567 void Profile(llvm::FoldingSetNodeID &ID)
const {
6568 const TagType *T = getTagType();
6569 Profile(ID, T->getKeyword(), T->getQualifier(), T->getDecl(),
6570 T->isTagOwned(), T->isInjected());
6573 TagType *getTagType() {
6574 return reinterpret_cast<TagType *
>(
reinterpret_cast<char *
>(
this + 1) +
6577 const TagType *getTagType()
const {
6578 return const_cast<TagTypeFoldingSetPlaceholder *
>(
this)->getTagType();
6580 static TagTypeFoldingSetPlaceholder *fromTagType(TagType *T) {
6581 return reinterpret_cast<TagTypeFoldingSetPlaceholder *
>(
6582 reinterpret_cast<char *
>(T) - getOffset()) -
6589class RecordType final :
public TagType {
6590 using TagType::TagType;
6593 RecordDecl *getDecl()
const {
6594 return reinterpret_cast<RecordDecl *
>(TagType::getDecl());
6596 [[deprecated(
"Use getDecl instead")]] RecordDecl *getOriginalDecl()
const {
6602 bool hasConstFields()
const;
6604 static bool classof(
const Type *T) {
return T->getTypeClass() ==
Record; }
6609class EnumType final :
public TagType {
6610 using TagType::TagType;
6613 EnumDecl *getDecl()
const {
6614 return reinterpret_cast<EnumDecl *
>(TagType::getDecl());
6616 [[deprecated(
"Use getDecl instead")]] EnumDecl *getOriginalDecl()
const {
6620 static bool classof(
const Type *T) {
return T->getTypeClass() ==
Enum; }
6640class InjectedClassNameType final :
public TagType {
6641 friend class ASTContext;
6643 InjectedClassNameType(ElaboratedTypeKeyword Keyword,
6644 NestedNameSpecifier Qualifier,
const TagDecl *TD,
6645 bool IsInjected,
const Type *CanonicalType);
6648 CXXRecordDecl *getDecl()
const {
6649 return reinterpret_cast<CXXRecordDecl *
>(TagType::getDecl());
6651 [[deprecated(
"Use getDecl instead")]] CXXRecordDecl *getOriginalDecl()
const {
6655 static bool classof(
const Type *T) {
6656 return T->getTypeClass() == InjectedClassName;
6674 using Kind = attr::Kind;
6677 friend class ASTContext;
6679 const Attr *Attribute;
6681 QualType ModifiedType;
6682 QualType EquivalentType;
6684 AttributedType(QualType canon, attr::Kind attrKind, QualType modified,
6685 QualType equivalent)
6688 AttributedType(QualType canon,
const Attr *attr, QualType modified,
6689 QualType equivalent);
6692 AttributedType(QualType canon, attr::Kind attrKind,
const Attr *attr,
6693 QualType modified, QualType equivalent);
6696 Kind getAttrKind()
const {
6697 return static_cast<Kind>(AttributedTypeBits.AttrKind);
6700 const Attr *getAttr()
const {
return Attribute; }
6702 QualType getModifiedType()
const {
return ModifiedType; }
6703 QualType getEquivalentType()
const {
return EquivalentType; }
6705 bool isSugared()
const {
return true; }
6706 QualType desugar()
const {
return getEquivalentType(); }
6723 bool isQualifier()
const;
6725 bool isMSTypeSpec()
const;
6727 bool isWebAssemblyFuncrefSpec()
const;
6729 bool isCallingConv()
const;
6744 void Profile(llvm::FoldingSetNodeID &ID) {
6745 Profile(ID, getAttrKind(), ModifiedType, EquivalentType, Attribute);
6748 static void Profile(llvm::FoldingSetNodeID &ID, Kind attrKind,
6749 QualType modified, QualType equivalent,
6751 ID.AddInteger(attrKind);
6752 ID.AddPointer(modified.getAsOpaquePtr());
6753 ID.AddPointer(equivalent.getAsOpaquePtr());
6754 ID.AddPointer(attr);
6757 static bool classof(
const Type *T) {
6758 return T->getTypeClass() == Attributed;
6762class BTFTagAttributedType :
public Type,
public llvm::FoldingSetNode {
6764 friend class ASTContext;
6766 QualType WrappedType;
6767 const BTFTypeTagAttr *BTFAttr;
6769 BTFTagAttributedType(QualType Canon, QualType Wrapped,
6770 const BTFTypeTagAttr *BTFAttr)
6771 : Type(BTFTagAttributed, Canon, Wrapped->getDependence()),
6772 WrappedType(Wrapped), BTFAttr(BTFAttr) {}
6775 QualType getWrappedType()
const {
return WrappedType; }
6776 const BTFTypeTagAttr *getAttr()
const {
return BTFAttr; }
6778 bool isSugared()
const {
return true; }
6779 QualType desugar()
const {
return getWrappedType(); }
6781 void Profile(llvm::FoldingSetNodeID &ID) {
6782 Profile(ID, WrappedType, BTFAttr);
6785 static void Profile(llvm::FoldingSetNodeID &ID, QualType Wrapped,
6786 const BTFTypeTagAttr *BTFAttr) {
6787 ID.AddPointer(Wrapped.getAsOpaquePtr());
6788 ID.AddPointer(BTFAttr);
6791 static bool classof(
const Type *T) {
6792 return T->getTypeClass() == BTFTagAttributed;
6796class OverflowBehaviorType :
public Type,
public llvm::FoldingSetNode {
6798 enum OverflowBehaviorKind { Wrap, Trap };
6801 friend class ASTContext;
6803 QualType UnderlyingType;
6804 OverflowBehaviorKind BehaviorKind;
6806 OverflowBehaviorType(QualType Canon, QualType Underlying,
6807 OverflowBehaviorKind Kind);
6811 OverflowBehaviorKind getBehaviorKind()
const {
return BehaviorKind; }
6813 bool isWrapKind()
const {
return BehaviorKind == OverflowBehaviorKind::Wrap; }
6814 bool isTrapKind()
const {
return BehaviorKind == OverflowBehaviorKind::Trap; }
6816 bool isSugared()
const {
return false; }
6819 void Profile(llvm::FoldingSetNodeID &ID) {
6820 Profile(ID, UnderlyingType, BehaviorKind);
6823 static void Profile(llvm::FoldingSetNodeID &ID, QualType Underlying,
6824 OverflowBehaviorKind Kind) {
6825 ID.AddPointer(Underlying.getAsOpaquePtr());
6826 ID.AddInteger((
int)Kind);
6829 static bool classof(
const Type *T) {
6834class HLSLAttributedResourceType :
public Type,
public llvm::FoldingSetNode {
6839 llvm::dxil::ResourceDimension ResourceDimension;
6841 LLVM_PREFERRED_TYPE(
bool)
6844 LLVM_PREFERRED_TYPE(
bool)
6845 uint8_t RawBuffer : 1;
6847 LLVM_PREFERRED_TYPE(
bool)
6848 uint8_t IsCounter : 1;
6851 llvm::dxil::ResourceDimension ResourceDimension,
6852 bool IsROV =
false,
bool RawBuffer =
false,
6853 bool IsCounter =
false)
6855 IsROV(IsROV), RawBuffer(RawBuffer), IsCounter(IsCounter) {}
6865 friend bool operator==(
const Attributes &LHS,
const Attributes &RHS) {
6866 return std::tie(LHS.ResourceClass, LHS.ResourceDimension, LHS.IsROV,
6867 LHS.RawBuffer, LHS.IsCounter) ==
6868 std::tie(RHS.ResourceClass, RHS.ResourceDimension, RHS.IsROV,
6869 RHS.RawBuffer, RHS.IsCounter);
6871 friend bool operator!=(
const Attributes &LHS,
const Attributes &RHS) {
6872 return !(LHS == RHS);
6877 friend class ASTContext;
6879 QualType WrappedType;
6880 QualType ContainedType;
6881 const Attributes Attrs;
6883 HLSLAttributedResourceType(QualType Wrapped, QualType Contained,
6884 const Attributes &Attrs)
6885 : Type(HLSLAttributedResource, QualType(),
6887 : Contained->getDependence()),
6888 WrappedType(Wrapped), ContainedType(Contained), Attrs(Attrs) {}
6891 QualType getWrappedType()
const {
return WrappedType; }
6892 QualType getContainedType()
const {
return ContainedType; }
6893 bool hasContainedType()
const {
return !ContainedType.isNull(); }
6894 const Attributes &getAttrs()
const {
return Attrs; }
6895 bool isRaw()
const {
return Attrs.RawBuffer; }
6896 bool isStructured()
const {
return !ContainedType->isChar8Type(); }
6898 bool isSugared()
const {
return false; }
6899 QualType desugar()
const {
return QualType(
this, 0); }
6901 void Profile(llvm::FoldingSetNodeID &ID) {
6902 Profile(ID, WrappedType, ContainedType, Attrs);
6905 static void Profile(llvm::FoldingSetNodeID &ID, QualType Wrapped,
6906 QualType Contained,
const Attributes &Attrs) {
6907 ID.AddPointer(Wrapped.getAsOpaquePtr());
6908 ID.AddPointer(Contained.getAsOpaquePtr());
6909 ID.AddInteger(
static_cast<uint32_t>(Attrs.ResourceClass));
6910 ID.AddInteger(
static_cast<uint32_t>(Attrs.ResourceDimension));
6911 ID.AddBoolean(Attrs.IsROV);
6912 ID.AddBoolean(Attrs.RawBuffer);
6913 ID.AddBoolean(Attrs.IsCounter);
6916 static bool classof(
const Type *T) {
6917 return T->getTypeClass() == HLSLAttributedResource;
6921 static const HLSLAttributedResourceType *
6922 findHandleTypeOnResource(
const Type *RT);
6928 enum SpirvOperandKind :
unsigned char {
6941 QualType ResultType;
6947 SpirvOperand(SpirvOperandKind Kind, QualType ResultType, llvm::APInt
Value)
6950 SpirvOperand(
const SpirvOperand &Other) =
default;
6951 ~SpirvOperand() =
default;
6952 SpirvOperand &operator=(
const SpirvOperand &Other) =
default;
6954 bool operator==(
const SpirvOperand &Other)
const {
6959 bool operator!=(
const SpirvOperand &Other)
const {
return !(*
this ==
Other); }
6964 bool isConstant()
const {
return Kind == ConstantId; }
6966 bool isType()
const {
return Kind == TypeId; }
6968 llvm::APInt getValue()
const {
6970 "This is not an operand with a value!");
6974 QualType getResultType()
const {
6975 assert((isConstant() || isType()) &&
6976 "This is not an operand with a result type!");
6980 static SpirvOperand createConstant(QualType ResultType, llvm::APInt Val) {
6981 return SpirvOperand(ConstantId, ResultType, std::move(Val));
6984 static SpirvOperand createLiteral(llvm::APInt Val) {
6985 return SpirvOperand(Literal, QualType(), std::move(Val));
6988 static SpirvOperand createType(QualType T) {
6989 return SpirvOperand(TypeId, T, llvm::APSInt());
6992 void Profile(llvm::FoldingSetNodeID &ID)
const {
6993 ID.AddInteger(Kind);
6994 ID.AddPointer(ResultType.getAsOpaquePtr());
7000class HLSLInlineSpirvType final
7002 public llvm::FoldingSetNode,
7003 private llvm::TrailingObjects<HLSLInlineSpirvType, SpirvOperand> {
7004 friend class ASTContext;
7005 friend TrailingObjects;
7013 HLSLInlineSpirvType(uint32_t Opcode, uint32_t Size, uint32_t Alignment,
7014 ArrayRef<SpirvOperand> Operands)
7016 Size(
Size), Alignment(Alignment), NumOperands(Operands.size()) {
7017 for (
size_t I = 0; I < NumOperands; I++) {
7020 auto *
Operand =
new (&getTrailingObjects()[I]) SpirvOperand();
7028 uint32_t getAlignment()
const {
return Alignment; }
7029 ArrayRef<SpirvOperand> getOperands()
const {
7030 return getTrailingObjects(NumOperands);
7033 bool isSugared()
const {
return false; }
7034 QualType desugar()
const {
return QualType(
this, 0); }
7036 void Profile(llvm::FoldingSetNodeID &ID) {
7037 Profile(ID, Opcode, Size, Alignment, getOperands());
7040 static void Profile(llvm::FoldingSetNodeID &ID, uint32_t Opcode,
7041 uint32_t Size, uint32_t Alignment,
7042 ArrayRef<SpirvOperand> Operands) {
7043 ID.AddInteger(Opcode);
7044 ID.AddInteger(Size);
7045 ID.AddInteger(Alignment);
7046 for (
auto &Operand : Operands)
7050 static bool classof(
const Type *T) {
7051 return T->getTypeClass() == HLSLInlineSpirv;
7055class TemplateTypeParmType :
public Type,
public llvm::FoldingSetNode {
7056 friend class ASTContext;
7059 TemplateTypeParmDecl *TTPDecl;
7061 TemplateTypeParmType(
unsigned D,
unsigned I,
bool PP,
7062 TemplateTypeParmDecl *TTPDecl, QualType Canon)
7067 assert(!TTPDecl == Canon.isNull());
7068 assert(D < (1 << TemplateTypeParmTypeDepthBits) &&
"Depth too large");
7069 assert(I < (1 << TemplateTypeParmTypeIndexBits) &&
"Index too large");
7070 TemplateTypeParmTypeBits.Depth = D;
7071 TemplateTypeParmTypeBits.Index = I;
7072 TemplateTypeParmTypeBits.ParameterPack = PP;
7076 unsigned getDepth()
const {
return TemplateTypeParmTypeBits.Depth; }
7077 unsigned getIndex()
const {
return TemplateTypeParmTypeBits.Index; }
7079 return TemplateTypeParmTypeBits.ParameterPack;
7082 TemplateTypeParmDecl *getDecl()
const {
return TTPDecl; }
7086 bool isSugared()
const {
return false; }
7087 QualType desugar()
const {
return QualType(
this, 0); }
7089 void Profile(llvm::FoldingSetNodeID &ID) {
7093 static void Profile(llvm::FoldingSetNodeID &ID,
unsigned Depth,
7094 unsigned Index,
bool ParameterPack,
7095 TemplateTypeParmDecl *TTPDecl) {
7096 ID.AddInteger(Depth);
7097 ID.AddInteger(Index);
7098 ID.AddBoolean(ParameterPack);
7099 ID.AddPointer(TTPDecl);
7102 static bool classof(
const Type *T) {
7114class SubstTemplateTypeParmType final
7116 public llvm::FoldingSetNode,
7117 private llvm::TrailingObjects<SubstTemplateTypeParmType, QualType> {
7118 friend class ASTContext;
7119 friend class llvm::TrailingObjects<SubstTemplateTypeParmType, QualType>;
7121 Decl *AssociatedDecl;
7123 SubstTemplateTypeParmType(QualType Replacement, Decl *AssociatedDecl,
7124 unsigned Index, UnsignedOrNone PackIndex,
7130 QualType getReplacementType()
const {
7131 return SubstTemplateTypeParmTypeBits.HasNonCanonicalUnderlyingType
7132 ? *getTrailingObjects()
7133 : getCanonicalTypeInternal();
7139 Decl *getAssociatedDecl()
const {
return AssociatedDecl; }
7142 const TemplateTypeParmDecl *getReplacedParameter()
const;
7146 unsigned getIndex()
const {
return SubstTemplateTypeParmTypeBits.Index; }
7150 unsigned getFinal()
const {
return SubstTemplateTypeParmTypeBits.Final; }
7153 return UnsignedOrNone::fromInternalRepresentation(
7154 SubstTemplateTypeParmTypeBits.PackIndex);
7157 bool isSugared()
const {
return true; }
7158 QualType desugar()
const {
return getReplacementType(); }
7160 void Profile(llvm::FoldingSetNodeID &ID) {
7161 Profile(ID, getReplacementType(), getAssociatedDecl(),
getIndex(),
7162 getPackIndex(), getFinal());
7165 static void Profile(llvm::FoldingSetNodeID &ID, QualType Replacement,
7166 const Decl *AssociatedDecl,
unsigned Index,
7167 UnsignedOrNone PackIndex,
bool Final);
7169 static bool classof(
const Type *T) {
7170 return T->getTypeClass() == SubstTemplateTypeParm;
7180class SubstPackType :
public Type,
public llvm::FoldingSetNode {
7181 friend class ASTContext;
7188 SubstPackType(TypeClass Derived, QualType Canon,
7189 const TemplateArgument &ArgPack);
7192 unsigned getNumArgs()
const {
return SubstPackTypeBits.NumArgs; }
7194 TemplateArgument getArgumentPack()
const;
7196 void Profile(llvm::FoldingSetNodeID &ID);
7197 static void Profile(llvm::FoldingSetNodeID &ID,
7198 const TemplateArgument &ArgPack);
7200 static bool classof(
const Type *T) {
7201 return T->getTypeClass() == SubstTemplateTypeParmPack ||
7202 T->getTypeClass() == SubstBuiltinTemplatePack;
7207class SubstBuiltinTemplatePackType :
public SubstPackType {
7208 friend class ASTContext;
7210 SubstBuiltinTemplatePackType(QualType Canon,
const TemplateArgument &ArgPack);
7213 bool isSugared()
const {
return false; }
7214 QualType desugar()
const {
return QualType(
this, 0); }
7217 using SubstPackType::Profile;
7219 static bool classof(
const Type *T) {
7220 return T->getTypeClass() == SubstBuiltinTemplatePack;
7236class SubstTemplateTypeParmPackType :
public SubstPackType {
7237 friend class ASTContext;
7239 llvm::PointerIntPair<Decl *, 1, bool> AssociatedDeclAndFinal;
7241 SubstTemplateTypeParmPackType(QualType Canon, Decl *AssociatedDecl,
7242 unsigned Index,
bool Final,
7243 const TemplateArgument &ArgPack);
7251 Decl *getAssociatedDecl()
const;
7254 const TemplateTypeParmDecl *getReplacedParameter()
const;
7259 return SubstPackTypeBits.SubstTemplTypeParmPackIndex;
7264 bool getFinal()
const;
7266 bool isSugared()
const {
return false; }
7267 QualType desugar()
const {
return QualType(
this, 0); }
7269 void Profile(llvm::FoldingSetNodeID &ID);
7270 static void Profile(llvm::FoldingSetNodeID &ID,
const Decl *AssociatedDecl,
7271 unsigned Index,
bool Final,
7272 const TemplateArgument &ArgPack);
7274 static bool classof(
const Type *T) {
7275 return T->getTypeClass() == SubstTemplateTypeParmPack;
7287class DeducedType :
public Type {
7288 QualType DeducedAsType;
7291 DeducedType(TypeClass TC, DeducedKind DK, QualType DeducedAsTypeOrCanon);
7293 static void Profile(llvm::FoldingSetNodeID &ID, DeducedKind DK,
7295 ID.AddInteger(llvm::to_underlying(DK));
7301 return static_cast<DeducedKind>(DeducedTypeBits.Kind);
7304 bool isSugared()
const {
return getDeducedKind() == DeducedKind::Deduced; }
7305 QualType desugar()
const {
7306 return isSugared() ? DeducedAsType : QualType(
this, 0);
7311 QualType getDeducedType()
const {
return DeducedAsType; }
7312 bool isDeduced()
const {
return getDeducedKind() != DeducedKind::Undeduced; }
7314 static bool classof(
const Type *T) {
7315 return T->getTypeClass() ==
Auto ||
7316 T->getTypeClass() == DeducedTemplateSpecialization;
7322class AutoType :
public DeducedType,
public llvm::FoldingSetNode {
7323 friend class ASTContext;
7325 TemplateDecl *TypeConstraintConcept;
7327 AutoType(DeducedKind DK, QualType DeducedAsTypeOrCanon,
7328 AutoTypeKeyword Keyword, TemplateDecl *TypeConstraintConcept,
7329 ArrayRef<TemplateArgument> TypeConstraintArgs);
7332 ArrayRef<TemplateArgument> getTypeConstraintArguments()
const {
7333 return {
reinterpret_cast<const TemplateArgument *
>(
this + 1),
7334 AutoTypeBits.NumArgs};
7337 TemplateDecl *getTypeConstraintConcept()
const {
7338 return TypeConstraintConcept;
7341 bool isConstrained()
const {
7342 return TypeConstraintConcept !=
nullptr;
7345 bool isDecltypeAuto()
const {
7346 return getKeyword() == AutoTypeKeyword::DecltypeAuto;
7349 bool isGNUAutoType()
const {
7350 return getKeyword() == AutoTypeKeyword::GNUAutoType;
7354 return (AutoTypeKeyword)AutoTypeBits.Keyword;
7357 void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context);
7358 static void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context,
7359 DeducedKind DK, QualType Deduced, AutoTypeKeyword Keyword,
7360 TemplateDecl *CD, ArrayRef<TemplateArgument> Arguments);
7362 static bool classof(
const Type *T) {
7363 return T->getTypeClass() ==
Auto;
7368class DeducedTemplateSpecializationType :
public KeywordWrapper<DeducedType>,
7369 public llvm::FoldingSetNode {
7370 friend class ASTContext;
7375 DeducedTemplateSpecializationType(DeducedKind DK,
7376 QualType DeducedAsTypeOrCanon,
7377 ElaboratedTypeKeyword Keyword,
7378 TemplateName Template)
7379 : KeywordWrapper(
Keyword, DeducedTemplateSpecialization, DK,
7380 DeducedAsTypeOrCanon),
7384 if (DK == DeducedKind::Deduced)
7393 void Profile(llvm::FoldingSetNodeID &ID)
const {
7394 Profile(ID, getDeducedKind(), getDeducedType(), getKeyword(),
7398 static void Profile(llvm::FoldingSetNodeID &ID, DeducedKind DK,
7399 QualType Deduced, ElaboratedTypeKeyword Keyword,
7400 TemplateName Template) {
7401 DeducedType::Profile(ID, DK, Deduced);
7402 ID.AddInteger(llvm::to_underlying(Keyword));
7406 static bool classof(
const Type *T) {
7407 return T->getTypeClass() == DeducedTemplateSpecialization;
7431class TemplateSpecializationType :
public TypeWithKeyword,
7432 public llvm::FoldingSetNode {
7433 friend class ASTContext;
7444 TemplateSpecializationType(ElaboratedTypeKeyword Keyword, TemplateName T,
7445 bool IsAlias, ArrayRef<TemplateArgument> Args,
7446 QualType Underlying);
7461 anyDependentTemplateArguments(ArrayRef<TemplateArgumentLoc> Args,
7462 ArrayRef<TemplateArgument> Converted);
7464 anyDependentTemplateArguments(
const TemplateArgumentListInfo &,
7465 ArrayRef<TemplateArgument> Converted);
7466 static bool anyInstantiationDependentTemplateArguments(
7467 ArrayRef<TemplateArgumentLoc> Args);
7471 bool isCurrentInstantiation()
const {
7472 return isa<InjectedClassNameType>(getCanonicalTypeInternal());
7490 bool isTypeAlias()
const {
return TemplateSpecializationTypeBits.TypeAlias; }
7494 QualType getAliasedType()
const;
7499 ArrayRef<TemplateArgument> template_arguments()
const {
7500 return {
reinterpret_cast<const TemplateArgument *
>(
this + 1),
7501 TemplateSpecializationTypeBits.NumArgs};
7504 bool isSugared()
const;
7506 QualType desugar()
const {
7507 return isTypeAlias() ? getAliasedType() : getCanonicalTypeInternal();
7510 void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Ctx);
7511 static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword,
7512 TemplateName T, ArrayRef<TemplateArgument> Args,
7513 QualType Underlying,
const ASTContext &Context);
7515 static bool classof(
const Type *T) {
7522void printTemplateArgumentList(raw_ostream &OS,
7523 ArrayRef<TemplateArgument> Args,
7524 const PrintingPolicy &Policy,
7525 const TemplateParameterList *TPL =
nullptr);
7527void printTemplateArgumentList(raw_ostream &OS,
7528 ArrayRef<TemplateArgumentLoc> Args,
7529 const PrintingPolicy &Policy,
7530 const TemplateParameterList *TPL =
nullptr);
7532void printTemplateArgumentList(raw_ostream &OS,
7533 const TemplateArgumentListInfo &Args,
7534 const PrintingPolicy &Policy,
7535 const TemplateParameterList *TPL =
nullptr);
7539bool isSubstitutedDefaultArgument(ASTContext &Ctx, TemplateArgument Arg,
7540 const NamedDecl *Param,
7541 ArrayRef<TemplateArgument> Args,
7556class DependentNameType :
public TypeWithKeyword,
public llvm::FoldingSetNode {
7557 friend class ASTContext;
7560 NestedNameSpecifier NNS;
7563 const IdentifierInfo *Name;
7565 DependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier NNS,
7566 const IdentifierInfo *Name, QualType CanonType)
7567 : TypeWithKeyword(
Keyword, DependentName, CanonType,
7571 NNS(NNS), Name(Name) {
7577 NestedNameSpecifier getQualifier()
const {
return NNS; }
7585 bool isSugared()
const {
return false; }
7586 QualType desugar()
const {
return QualType(
this, 0); }
7588 void Profile(llvm::FoldingSetNodeID &ID) {
7589 Profile(ID, getKeyword(), NNS, Name);
7592 static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword,
7593 NestedNameSpecifier NNS,
const IdentifierInfo *Name) {
7594 ID.AddInteger(llvm::to_underlying(Keyword));
7596 ID.AddPointer(Name);
7599 static bool classof(
const Type *T) {
7600 return T->getTypeClass() == DependentName;
7626class PackExpansionType :
public Type,
public llvm::FoldingSetNode {
7627 friend class ASTContext;
7632 PackExpansionType(QualType Pattern, QualType Canon,
7633 UnsignedOrNone NumExpansions)
7634 : Type(PackExpansion, Canon,
7639 PackExpansionTypeBits.NumExpansions =
7640 NumExpansions ? *NumExpansions + 1 : 0;
7647 QualType getPattern()
const {
return Pattern; }
7652 if (PackExpansionTypeBits.NumExpansions)
7653 return PackExpansionTypeBits.NumExpansions - 1;
7654 return std::nullopt;
7657 bool isSugared()
const {
return false; }
7658 QualType desugar()
const {
return QualType(
this, 0); }
7660 void Profile(llvm::FoldingSetNodeID &ID) {
7661 Profile(ID, getPattern(), getNumExpansions());
7664 static void Profile(llvm::FoldingSetNodeID &ID, QualType Pattern,
7665 UnsignedOrNone NumExpansions) {
7666 ID.AddPointer(Pattern.getAsOpaquePtr());
7667 ID.AddInteger(NumExpansions.toInternalRepresentation());
7670 static bool classof(
const Type *T) {
7671 return T->getTypeClass() == PackExpansion;
7678class ObjCProtocolQualifiers {
7680 ObjCProtocolQualifiers() =
default;
7682 ObjCProtocolDecl *
const *getProtocolStorage()
const {
7683 return const_cast<ObjCProtocolQualifiers*
>(
this)->getProtocolStorage();
7686 ObjCProtocolDecl **getProtocolStorage() {
7687 return static_cast<T*
>(
this)->getProtocolStorageImpl();
7690 void setNumProtocols(
unsigned N) {
7691 static_cast<T*
>(
this)->setNumProtocolsImpl(N);
7694 void initialize(ArrayRef<ObjCProtocolDecl *> protocols) {
7695 setNumProtocols(protocols.size());
7696 assert(getNumProtocols() == protocols.size() &&
7697 "bitfield overflow in protocol count");
7698 if (!protocols.empty())
7699 memcpy(getProtocolStorage(), protocols.data(),
7700 protocols.size() *
sizeof(ObjCProtocolDecl*));
7704 using qual_iterator = ObjCProtocolDecl *
const *;
7705 using qual_range = llvm::iterator_range<qual_iterator>;
7707 qual_range quals()
const {
return qual_range(qual_begin(), qual_end()); }
7708 qual_iterator qual_begin()
const {
return getProtocolStorage(); }
7709 qual_iterator qual_end()
const {
return qual_begin() + getNumProtocols(); }
7711 bool qual_empty()
const {
return getNumProtocols() == 0; }
7715 unsigned getNumProtocols()
const {
7716 return static_cast<const T*
>(
this)->getNumProtocolsImpl();
7720 ObjCProtocolDecl *getProtocol(
unsigned I)
const {
7721 assert(I < getNumProtocols() &&
"Out-of-range protocol access");
7722 return qual_begin()[I];
7726 ArrayRef<ObjCProtocolDecl *> getProtocols()
const {
7727 return ArrayRef<ObjCProtocolDecl *>(qual_begin(), getNumProtocols());
7733class ObjCTypeParamType :
public Type,
7734 public ObjCProtocolQualifiers<ObjCTypeParamType>,
7735 public llvm::FoldingSetNode {
7736 friend class ASTContext;
7737 friend class ObjCProtocolQualifiers<ObjCTypeParamType>;
7740 unsigned NumProtocols : 6;
7742 ObjCTypeParamDecl *OTPDecl;
7747 ObjCProtocolDecl **getProtocolStorageImpl();
7751 unsigned getNumProtocolsImpl()
const {
7752 return NumProtocols;
7755 void setNumProtocolsImpl(
unsigned N) {
7759 ObjCTypeParamType(
const ObjCTypeParamDecl *D,
7761 ArrayRef<ObjCProtocolDecl *> protocols);
7764 bool isSugared()
const {
return true; }
7765 QualType desugar()
const {
return getCanonicalTypeInternal(); }
7767 static bool classof(
const Type *T) {
7768 return T->getTypeClass() == ObjCTypeParam;
7771 void Profile(llvm::FoldingSetNodeID &ID);
7772 static void Profile(llvm::FoldingSetNodeID &ID,
7773 const ObjCTypeParamDecl *OTPDecl,
7774 QualType CanonicalType,
7775 ArrayRef<ObjCProtocolDecl *> protocols);
7777 ObjCTypeParamDecl *getDecl()
const {
return OTPDecl; }
7808class ObjCObjectType :
public Type,
7809 public ObjCProtocolQualifiers<ObjCObjectType> {
7810 friend class ObjCProtocolQualifiers<ObjCObjectType>;
7828 mutable llvm::PointerIntPair<const ObjCObjectType *, 1, bool>
7829 CachedSuperClassType;
7831 QualType *getTypeArgStorage();
7832 const QualType *getTypeArgStorage()
const {
7833 return const_cast<ObjCObjectType *
>(
this)->getTypeArgStorage();
7836 ObjCProtocolDecl **getProtocolStorageImpl();
7839 unsigned getNumProtocolsImpl()
const {
7840 return ObjCObjectTypeBits.NumProtocols;
7842 void setNumProtocolsImpl(
unsigned N) {
7843 ObjCObjectTypeBits.NumProtocols = N;
7847 enum Nonce_ObjCInterface { Nonce_ObjCInterface };
7849 ObjCObjectType(QualType Canonical, QualType Base,
7850 ArrayRef<QualType> typeArgs,
7851 ArrayRef<ObjCProtocolDecl *> protocols,
7854 ObjCObjectType(
enum Nonce_ObjCInterface)
7856 BaseType(QualType(this_(), 0)) {
7857 ObjCObjectTypeBits.NumProtocols = 0;
7858 ObjCObjectTypeBits.NumTypeArgs = 0;
7859 ObjCObjectTypeBits.IsKindOf = 0;
7862 void computeSuperClassTypeSlow()
const;
7873 bool isObjCId()
const {
7874 return getBaseType()->isSpecificBuiltinType(BuiltinType::ObjCId);
7877 bool isObjCClass()
const {
7878 return getBaseType()->isSpecificBuiltinType(BuiltinType::ObjCClass);
7881 bool isObjCUnqualifiedId()
const {
return qual_empty() && isObjCId(); }
7882 bool isObjCUnqualifiedClass()
const {
return qual_empty() && isObjCClass(); }
7883 bool isObjCUnqualifiedIdOrClass()
const {
7884 if (!qual_empty())
return false;
7885 if (
const BuiltinType *T =
getBaseType()->getAs<BuiltinType>())
7886 return T->getKind() == BuiltinType::ObjCId ||
7887 T->getKind() == BuiltinType::ObjCClass;
7890 bool isObjCQualifiedId()
const {
return !qual_empty() && isObjCId(); }
7891 bool isObjCQualifiedClass()
const {
return !qual_empty() && isObjCClass(); }
7895 ObjCInterfaceDecl *getInterface()
const;
7899 bool isSpecialized()
const;
7902 bool isSpecializedAsWritten()
const {
7903 return ObjCObjectTypeBits.NumTypeArgs > 0;
7908 bool isUnspecialized()
const {
return !isSpecialized(); }
7912 bool isUnspecializedAsWritten()
const {
return !isSpecializedAsWritten(); }
7915 ArrayRef<QualType> getTypeArgs()
const;
7919 ArrayRef<QualType> getTypeArgsAsWritten()
const {
7920 return {getTypeArgStorage(), ObjCObjectTypeBits.NumTypeArgs};
7924 bool isKindOfTypeAsWritten()
const {
return ObjCObjectTypeBits.IsKindOf; }
7927 bool isKindOfType()
const;
7935 QualType getSuperClassType()
const {
7936 if (!CachedSuperClassType.getInt())
7937 computeSuperClassTypeSlow();
7939 assert(CachedSuperClassType.getInt() &&
"Superclass not set?");
7940 return QualType(CachedSuperClassType.getPointer(), 0);
7945 QualType stripObjCKindOfTypeAndQuals(
const ASTContext &ctx)
const;
7947 bool isSugared()
const {
return false; }
7948 QualType desugar()
const {
return QualType(
this, 0); }
7950 static bool classof(
const Type *T) {
7951 return T->getTypeClass() == ObjCObject ||
7952 T->getTypeClass() == ObjCInterface;
7960class ObjCObjectTypeImpl :
public ObjCObjectType,
public llvm::FoldingSetNode {
7961 friend class ASTContext;
7966 ObjCObjectTypeImpl(QualType Canonical, QualType Base,
7967 ArrayRef<QualType> typeArgs,
7968 ArrayRef<ObjCProtocolDecl *> protocols,
7970 : ObjCObjectType(Canonical,
Base, typeArgs, protocols, isKindOf) {}
7973 void Profile(llvm::FoldingSetNodeID &ID);
7974 static void Profile(llvm::FoldingSetNodeID &ID,
7976 ArrayRef<QualType> typeArgs,
7977 ArrayRef<ObjCProtocolDecl *> protocols,
7981inline QualType *ObjCObjectType::getTypeArgStorage() {
7982 return reinterpret_cast<QualType *
>(
static_cast<ObjCObjectTypeImpl*
>(
this)+1);
7985inline ObjCProtocolDecl **ObjCObjectType::getProtocolStorageImpl() {
7986 return reinterpret_cast<ObjCProtocolDecl**
>(
7987 getTypeArgStorage() + ObjCObjectTypeBits.NumTypeArgs);
7990inline ObjCProtocolDecl **ObjCTypeParamType::getProtocolStorageImpl() {
7991 return reinterpret_cast<ObjCProtocolDecl**
>(
7992 static_cast<ObjCTypeParamType*
>(
this)+1);
8026 return T->getTypeClass() == ObjCInterface;
8042inline ObjCInterfaceDecl *ObjCObjectType::getInterface()
const {
8043 QualType baseType = getBaseType();
8045 if (
const auto *T = dyn_cast<ObjCInterfaceType>(ObjT))
8046 return T->getDecl();
8048 baseType = ObjT->getBaseType();
8063class ObjCObjectPointerType :
public Type,
public llvm::FoldingSetNode {
8070 PointeeType(Pointee) {}
8213 QualType getSuperClassType()
const;
8225 ID.AddPointer(T.getAsOpaquePtr());
8229 return T->getTypeClass() == ObjCObjectPointer;
8233class AtomicType :
public Type,
public llvm::FoldingSetNode {
8254 ID.AddPointer(T.getAsOpaquePtr());
8258 return T->getTypeClass() ==
Atomic;
8263class PipeType :
public Type,
public llvm::FoldingSetNode {
8271 ElementType(elemType), isRead(isRead) {}
8285 ID.AddPointer(T.getAsOpaquePtr());
8286 ID.AddBoolean(isRead);
8290 return T->getTypeClass() ==
Pipe;
8299 LLVM_PREFERRED_TYPE(
bool)
8300 unsigned IsUnsigned : 1;
8301 unsigned NumBits : 24;
8318 static void Profile(llvm::FoldingSetNodeID &ID,
bool IsUnsigned,
8320 ID.AddBoolean(IsUnsigned);
8321 ID.AddInteger(NumBits);
8329 llvm::PointerIntPair<Expr*, 1, bool> ExprAndUnsigned;
8337 Expr *getNumBitsExpr()
const;
8345 static void Profile(llvm::FoldingSetNodeID &ID,
const ASTContext &Context,
8346 bool IsUnsigned,
Expr *NumBitsExpr);
8349 return T->getTypeClass() == DependentBitInt;
8353class PredefinedSugarType final :
public Type {
8366 static StringRef getName(Kind KD);
8380 return T->getTypeClass() == PredefinedSugar;
8394 if (!
type.hasLocalNonFastQualifiers())
8395 return type.getTypePtrUnsafe();
8416class alignas(8) TypeSourceInfo {
8423 TypeSourceInfo(
QualType ty,
size_t DataSize);
8440 Ty->getLocallyUnqualifiedSingleStepDesugaredType().split();
8446 return getCommonPtr()->BaseType;
8450 return (
isNull() ?
nullptr : getCommonPtr()->BaseType);
8458 if (
Self.isObjectType() ||
Self.isReferenceType())
8461 return F->getMethodQuals().empty() && F->getRefQualifier() ==
RQ_None;
8471 const ExtQuals *eq = getExtQualsUnsafe();
8480 Quals = getExtQualsUnsafe()->getQualifiers();
8486 Qualifiers quals = getCommonPtr()->CanonicalType.getLocalQualifiers();
8492 unsigned cvr = getCommonPtr()->CanonicalType.getLocalCVRQualifiers();
8498 QualType canon = getCommonPtr()->CanonicalType;
8503 return getTypePtr()->isCanonicalUnqualified();
8511 if (T->isVariablyModifiedType() && T->hasSizedVLAType())
8520 getCommonPtr()->CanonicalType.isLocalConstQualified();
8525 getCommonPtr()->CanonicalType.isLocalRestrictQualified();
8531 getCommonPtr()->CanonicalType.isLocalVolatileQualified();
8536 getCommonPtr()->CanonicalType.hasLocalQualifiers();
8543 return QualType(getSplitUnqualifiedTypeImpl(*this).Ty, 0);
8550 return getSplitUnqualifiedTypeImpl(*
this);
8582 if (
const auto *FT = PT->getPointeeType()->getAs<
FunctionType>())
8583 return FT->getExtInfo();
8585 return FT->getExtInfo();
8632 return RefType->getPointeeType();
8723 return !T->getPointeeType()->isFunctionType();
8730 return Fn->hasCFIUncheckedCallee();
8751 return T->getPointeeType()->isFunctionType();
8758 return T->getPointeeType()->isFunctionType();
8769 return T->isMemberFunctionPointer();
8776 return T->isMemberDataPointer();
8836 if (
auto *CMT = dyn_cast<ConstantMatrixType>(CanonicalType))
8837 return CMT->getElementType()->isBooleanType();
8884 return OPT->isObjCQualifiedIdType();
8890 return OPT->isObjCQualifiedClassType();
8896 return OPT->isObjCIdType();
8902 return OPT->isObjCClassType();
8908 return OPT->getPointeeType()->isSpecificBuiltinType(BuiltinType::ObjCSel);
8920#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
8921 inline bool Type::is##Id##Type() const { \
8922 return isSpecificBuiltinType(BuiltinType::Id); \
8924#include "clang/Basic/OpenCLImageTypes.def"
8947#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) is##Id##Type() ||
8949#include "clang/Basic/OpenCLImageTypes.def"
8961#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
8962 inline bool Type::is##Id##Type() const { \
8963 return isSpecificBuiltinType(BuiltinType::Id); \
8965#include "clang/Basic/OpenCLExtensionTypes.def"
8968#define INTEL_SUBGROUP_AVC_TYPE(ExtType, Id) \
8969 isOCLIntelSubgroupAVC##Id##Type() ||
8971#include "clang/Basic/OpenCLExtensionTypes.def"
8976#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) is##Id##Type() ||
8978#include "clang/Basic/OpenCLExtensionTypes.def"
8987#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) \
8988 inline bool Type::is##Id##Type() const { \
8989 return isSpecificBuiltinType(BuiltinType::Id); \
8991#include "clang/Basic/HLSLIntangibleTypes.def"
8994#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) is##Id##Type() ||
8996#include "clang/Basic/HLSLIntangibleTypes.def"
9025 if (
const auto *BT = dyn_cast<BuiltinType>(
this))
9026 return BT->isPlaceholderType();
9031 if (
const auto *BT = dyn_cast<BuiltinType>(
this))
9032 if (BT->isPlaceholderType())
9043 if (
const auto *BT = dyn_cast<BuiltinType>(
this))
9044 return BT->isNonOverloadPlaceholderType();
9093 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType))
9094 return BT->isInteger();
9095 if (
const EnumType *ET = dyn_cast<EnumType>(CanonicalType)) {
9102 if (
const auto *OT = dyn_cast<OverflowBehaviorType>(CanonicalType))
9103 return OT->getUnderlyingType()->isIntegerType();
9109 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType)) {
9110 return BT->getKind() >= BuiltinType::ShortAccum &&
9111 BT->getKind() <= BuiltinType::SatULongFract;
9125 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType)) {
9126 return BT->getKind() >= BuiltinType::SatShortAccum &&
9127 BT->getKind() <= BuiltinType::SatULongFract;
9137 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType)) {
9138 return ((BT->getKind() >= BuiltinType::ShortAccum &&
9139 BT->getKind() <= BuiltinType::LongAccum) ||
9140 (BT->getKind() >= BuiltinType::ShortFract &&
9141 BT->getKind() <= BuiltinType::LongFract) ||
9142 (BT->getKind() >= BuiltinType::SatShortAccum &&
9143 BT->getKind() <= BuiltinType::SatLongAccum) ||
9144 (BT->getKind() >= BuiltinType::SatShortFract &&
9145 BT->getKind() <= BuiltinType::SatLongFract));
9155 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType))
9156 return BT->getKind() > BuiltinType::Void &&
9157 BT->getKind() <= BuiltinType::NullPtr;
9158 if (
const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
9171 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType))
9172 return BT->isInteger();
9176 if (
const auto *ET = dyn_cast<EnumType>(CanonicalType))
9179 if (
const auto *OBT = dyn_cast<OverflowBehaviorType>(CanonicalType))
9180 return OBT->getUnderlyingType()->isIntegralOrEnumerationType();
9186 if (
const auto *BT = dyn_cast<BuiltinType>(CanonicalType))
9187 return BT->getKind() == BuiltinType::Bool;
9193 return DT && !DT->isDeduced();
9210 return TST->isTypeAlias();
9237 if (
type->isAnyPointerType())
9238 return type->getPointeeType().getTypePtr();
9239 else if (
type->isArrayType())
9240 return type->getBaseElementTypeUnsafe();
9265 PD.
AddTaggedVal(
reinterpret_cast<uint64_t
>(T.getAsOpaquePtr()),
9277 "ArrayType cannot be used with getAs!");
9280 if (
const auto *Ty = dyn_cast<T>(
this))
9284 if (!
isa<T>(CanonicalType))
9296 if (
const auto *Ty = dyn_cast<T>(
this))
9300 if (!
isa<T>(CanonicalType))
9305 const Type *Ty =
this;
9307 if (
const auto *A = dyn_cast<AttributedType>(Ty))
9308 Ty = A->getModifiedType().getTypePtr();
9309 else if (
const auto *A = dyn_cast<BTFTagAttributedType>(Ty))
9310 Ty = A->getWrappedType().getTypePtr();
9311 else if (
const auto *A = dyn_cast<HLSLAttributedResourceType>(Ty))
9312 Ty = A->getWrappedType().getTypePtr();
9313 else if (
const auto *P = dyn_cast<ParenType>(Ty))
9314 Ty = P->desugar().getTypePtr();
9315 else if (
const auto *A = dyn_cast<AdjustedType>(Ty))
9316 Ty = A->desugar().getTypePtr();
9317 else if (
const auto *M = dyn_cast<MacroQualifiedType>(Ty))
9318 Ty = M->desugar().getTypePtr();
9325 return dyn_cast<T>(Ty);
9330 if (
const auto *arr = dyn_cast<ArrayType>(
this))
9344 "ArrayType cannot be used with castAs!");
9346 if (
const auto *ty = dyn_cast<T>(
this))
return ty;
9347 assert(
isa<T>(CanonicalType));
9353 if (
const auto *arr = dyn_cast<ArrayType>(
this))
return arr;
9359 :
AdjustedType(Decayed, OriginalType, DecayedPtr, CanonicalPtr) {
9361 QualType Adjusted = getAdjustedType();
9362 (void)AttributedType::stripOuterNullability(Adjusted);
9369 (void)AttributedType::stripOuterNullability(Decayed);
9384 TypePtr = Pointee.getTypePtr();
9390 if (
const auto *FPT = TypePtr->
getAs<FunctionProtoType>())
9391 return FPT->getFunctionEffects();
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)
llvm::dxil::ResourceClass ResourceClass
static std::optional< NonLoc > getIndex(ProgramStateRef State, const ElementRegion *ER, CharKind CK)
clang::CharUnits operator*(clang::CharUnits::QuantityType Scale, const clang::CharUnits &CU)
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 QualType getObjectType(APValue::LValueBase B)
Retrieves the "underlying object type" of the given expression, as used by __builtin_object_size.
Result
Implement __builtin_bit_cast and related operations.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
llvm::MachO::Record Record
*collection of selector each with an associated kind and an ordered *collection of selectors A selector has a kind
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const OMPTraitInfo &TI)
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 bool hasAttr(const Decl *D, bool IgnoreImplicitAttr)
static RecordDecl * getAsRecordDecl(QualType BaseType, HeuristicResolver &Resolver)
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 OMPAtomicDirective * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef< OMPClause * > Clauses, Stmt *AssociatedStmt, Expressions Exprs)
Creates directive with a list of Clauses and 'x', 'v' and 'expr' parts of the atomic construct (see S...
static bool classof(const Stmt *T)
static QualType getPointeeType(const MemRegion *R)
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 ...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
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
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
ArrayType(TypeClass tc, QualType et, QualType can, ArraySizeModifier sm, unsigned tq, const Expr *sz=nullptr)
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)
Attr - This represents one attribute.
static bool classof(const Type *T)
BitIntType(bool isUnsigned, unsigned NumBits)
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
BoundsAttributedType(TypeClass TC, QualType Wrapped, QualType Canon)
const TypeCoupledDeclRefInfo * decl_iterator
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.
StringRef getName(const PrintingPolicy &Policy) const
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.
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)
unsigned getRowMajorFlattenedIndex(unsigned Row, unsigned Column) const
Returns the row-major flattened index of a matrix element located at row Row, and column Column.
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.
unsigned getFlattenedIndex(unsigned Row, unsigned Column, bool IsRowMajor=false) const
Returns the flattened index of a matrix element located at row Row, and column Column.
ConstantMatrixType(QualType MatrixElementType, unsigned NRows, unsigned NColumns, QualType CanonElementType)
unsigned mapColumnMajorToRowMajorFlattenedIndex(unsigned ColumnMajorIdx) const
Given a column-major flattened index ColumnMajorIdx, return the equivalent row-major flattened index.
unsigned mapRowMajorToColumnMajorFlattenedIndex(unsigned RowMajorIdx) const
Given a row-major flattened index RowMajorIdx, return the equivalent column-major flattened index.
unsigned getColumnMajorFlattenedIndex(unsigned Row, unsigned Column) const
Returns the column-major flattened index of a matrix element located at row Row, and column Column.
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
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.
Expr * getAddrSpaceExpr() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
QualType getPointeeType() const
static bool classof(const Type *T)
SourceLocation getAttributeLoc() const
Expr * getNumBitsExpr() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
DependentBitIntType(bool IsUnsigned, Expr *NumBits)
static bool classof(const Type *T)
friend class StmtIteratorBase
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
static bool classof(const Type *T)
Expr * getSizeExpr() const
Expr * getSizeExpr() const
static bool classof(const Type *T)
SourceLocation getAttributeLoc() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
QualType getElementType() const
Expr * getColumnExpr() const
Expr * getRowExpr() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
SourceLocation getAttributeLoc() const
static bool classof(const Type *T)
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
DependentTypeOfExprType(const ASTContext &Context, Expr *E, TypeOfKind Kind)
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)
@ ak_addrspace
address space
Wrap a function effect's condition expression in another struct so that FunctionProtoType's TrailingO...
EffectConditionExpr(Expr *E)
Expr * getCondition() const
bool operator==(const EffectConditionExpr &RHS) const
EffectConditionExpr()=default
This represents one expression.
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
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.
Support iteration in parallel through a pair of FunctionEffect and EffectConditionExpr containers.
bool operator==(const FunctionEffectIterator &Other) const
bool operator!=(const FunctionEffectIterator &Other) const
FunctionEffectIterator operator++()
FunctionEffectIterator(const Container &O, size_t I)
FunctionEffectWithCondition operator*() const
A mutable set of FunctionEffect::Kind.
static FunctionEffectKindSet difference(FunctionEffectKindSet LHS, FunctionEffectKindSet RHS)
bool contains(const FunctionEffect::Kind EK) const
FunctionEffectKindSet()=default
FunctionEffectKindSet(FunctionEffectsRef FX)
void insert(FunctionEffectKindSet Set)
void insert(FunctionEffectsRef FX)
void insert(FunctionEffect Effect)
FunctionEffectSet(const FunctionEffectsRef &FX)
FunctionEffectSet()=default
FunctionEffectIterator< FunctionEffectSet > iterator
bool insert(const FunctionEffectWithCondition &NewEC, Conflicts &Errs)
SmallVector< Conflict > Conflicts
static FunctionEffectSet getIntersection(FunctionEffectsRef LHS, FunctionEffectsRef RHS)
static FunctionEffectSet getUnion(FunctionEffectsRef LHS, FunctionEffectsRef RHS, Conflicts &Errs)
Represents an abstract function effect, using just an enumeration describing its kind.
Kind kind() const
The kind of the effect.
unsigned Flags
Flags describing some behaviors of the effect.
static constexpr size_t KindCount
friend bool operator<(FunctionEffect LHS, FunctionEffect RHS)
friend bool operator==(FunctionEffect LHS, FunctionEffect RHS)
uint32_t toOpaqueInt32() const
For serialization.
@ FE_ExcludeStaticLocalVars
@ FE_ExcludeThreadLocalVars
@ FE_ExcludeObjCMessageSend
friend bool operator!=(FunctionEffect LHS, FunctionEffect RHS)
Kind
Identifies the particular effect.
Flags flags() const
Flags describing some behaviors of the effect.
StringRef name() const
The description printed in diagnostics, e.g. 'nonblocking'.
static FunctionEffect fromOpaqueInt32(uint32_t Value)
friend raw_ostream & operator<<(raw_ostream &OS, const FunctionEffect &Effect)
An immutable set of FunctionEffects and possibly conditions attached to them.
ArrayRef< FunctionEffect > effects() const
ArrayRef< EffectConditionExpr > conditions() const
static FunctionEffectsRef create(ArrayRef< FunctionEffect > FX, ArrayRef< EffectConditionExpr > Conds)
Asserts invariants.
FunctionEffectIterator< FunctionEffectsRef > iterator
FunctionEffectsRef()=default
friend bool operator==(const FunctionEffectsRef &LHS, const FunctionEffectsRef &RHS)
static FunctionEffectsRef get(QualType QT)
Extract the effects from a Type if it is a function, block, or member function pointer,...
friend bool operator!=(const FunctionEffectsRef &LHS, const FunctionEffectsRef &RHS)
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
unsigned getNumFunctionEffectConditions() const
ExtParameterInfo getExtParameterInfo(unsigned I) const
ArrayRef< EffectConditionExpr > getFunctionEffectConditions() const
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
ArrayRef< FunctionEffect > getFunctionEffectsWithoutConditions() const
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.
const QualType * param_type_iterator
Qualifiers getMethodQuals() const
const QualType * exception_iterator
static bool classof(const Type *T)
QualType getParamType(unsigned i) const
FunctionEffectsRef getFunctionEffects() 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 getNumFunctionEffects() const
bool hasCFIUncheckedCallee() 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.
CanThrowResult canThrow() const
Determine whether this function type has a non-throwing exception specification.
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...
FunctionTypeExtraAttributeInfo getExtraAttributeInfo() const
Return the extra attribute information.
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
friend class FunctionType
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?
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
AArch64SMETypeAttributes
The AArch64 SME ACLE (Arm C/C++ Language Extensions) define a number of function type attributes that...
@ SME_PStateSMEnabledMask
@ SME_PStateSMCompatibleMask
@ SME_AgnosticZAStateShift
@ SME_AgnosticZAStateMask
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.
One of these records is kept for each identifier that is lexed.
void Profile(llvm::FoldingSetNodeID &ID)
static void Profile(llvm::FoldingSetNodeID &ID, QualType ET, ArraySizeModifier SizeMod, unsigned TypeQuals)
friend class StmtIteratorBase
static bool classof(const Type *T)
KeywordWrapper(ElaboratedTypeKeyword Keyword, As &&...as)
ElaboratedTypeKeyword getKeyword() const
static CannotCastToThisType classof(const T *)
static bool classof(const Type *T)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
static bool classof(const Type *T)
QualType getUnderlyingType() const
const IdentifierInfo * getMacroIdentifier() const
static bool isValidElementType(QualType T, const LangOptions &LangOpts)
Valid elements types are the following:
QualType getElementType() const
Returns type of the elements being stored in the matrix.
MatrixType(QualType ElementTy, QualType CanonElementTy)
QualType ElementType
The element type of the matrix.
static bool classof(const Type *T)
NestedNameSpecifier getQualifier() const
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 bool classof(const Type *T)
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.
Represents typeof(type), a C23 feature and GCC extension, or `typeof_unqual(type),...
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.
Represents an Objective-C protocol declaration.
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
@ MaxDiscriminator
The maximum supported pointer-authentication discriminator.
@ MaxKey
The maximum supported pointer-authentication key.
void Profile(llvm::FoldingSetNodeID &ID) const
bool isAddressDiscriminated() const
PointerAuthQualifier withoutKeyNone() const
unsigned getExtraDiscriminator() const
void print(raw_ostream &OS, const PrintingPolicy &Policy) const
PointerAuthenticationMode getAuthenticationMode() const
bool isEmptyWhenPrinted(const PrintingPolicy &Policy) const
std::string getAsString() 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)
static bool classof(const Type *T)
const IdentifierInfo * getIdentifier() const
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 hasAddressDiscriminatedPointerAuth() const
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.
bool isBitwiseCloneableType(const ASTContext &Context) const
Return true if the type is safe to bitwise copy using memcpy/memmove.
QualType withoutLocalFastQualifiers() const
void Profile(llvm::FoldingSetNodeID &ID) const
bool isAddressSpaceOverlapping(QualType T, const ASTContext &Ctx) const
Returns true if address space qualifiers overlap with T address space qualifiers.
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 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 ...
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 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...
bool hasPostfixDeclaratorSyntax() const
Returns true if the type uses postfix declarator syntax, i.e.
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.
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
bool isTrapType() const
Returns true if it is a OverflowBehaviorType of Trap kind.
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 isMoreQualifiedThan(QualType Other, const ASTContext &Ctx) const
Determine whether this type is more qualified than the other given type, requiring exact equality for...
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.
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.
bool requiresBuiltinLaunder(const ASTContext &Context) const
Returns true if this type requires laundering by checking if it is a dynamic class 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
bool isWrapType() const
Returns true if it is a OverflowBehaviorType of Wrap kind.
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 isAtLeastAsQualifiedAs(QualType Other, const ASTContext &Ctx) const
Determine whether this type is at least as qualified as the other given type, requiring exact equalit...
friend class QualifierCollector
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_PtrAuth
The type is an address-discriminated signed pointer type.
@ 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...
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 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)
static bool isTargetAddressSpaceSupersetOf(LangAS A, LangAS B, const ASTContext &Ctx)
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 compatiblyIncludes(Qualifiers other, const ASTContext &Ctx) const
Determines if these qualifiers compatibly include another set.
bool hasUnaligned() const
unsigned getAddressSpaceAttributePrintValue() const
Get the address space attribute value to be printed by diagnostics.
bool hasAddressSpace() const
static bool isAddressSpaceSupersetOf(LangAS A, LangAS B, const ASTContext &Ctx)
Returns true if address space A is equal to or a superset of B.
Qualifiers withoutAddressSpace() const
unsigned getFastQualifiers() const
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool appendSpaceIfNonEmpty=false) const
void removeAddressSpace()
void addQualifiers(Qualifiers Q)
Add the qualifiers from the given set to this set.
static Qualifiers fromCVRMask(unsigned CVR)
void setAddressSpace(LangAS space)
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
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)
@ FastWidth
The width of the "fast" qualifier mask.
@ MaxAddressSpace
The maximum supported address space number.
@ FastMask
The fast qualifier mask.
bool hasFastQualifiers() const
bool hasOnlyRestrict() const
bool isAddressSpaceSupersetOf(Qualifiers other, const ASTContext &Ctx) const
Returns true if the address space in these qualifiers is equal to or a superset of the address space ...
void addObjCLifetime(ObjCLifetime type)
void setObjCLifetime(ObjCLifetime type)
static bool classof(const Type *T)
Represents a struct/union/class.
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.
Stmt - This represents one statement.
The streaming interface shared between DiagnosticBuilder and PartialDiagnostic.
void AddTaggedVal(uint64_t V, DiagnosticsEngine::ArgumentKind Kind) const
Represents the declaration of a struct/union/class/enum.
Stores a list of template parameters for a TemplateDecl and its derived classes.
[BoundsSafety] Represents information of declarations referenced by the arguments of the counted_by a...
TypeCoupledDeclRefInfo(ValueDecl *D=nullptr, bool Deref=false)
D is to a declaration referenced by the argument of attribute.
llvm::PointerIntPair< ValueDecl *, 1, unsigned > BaseTy
Base wrapper for a particular "section" of type source info.
static bool classof(const Type *T)
TypeOfKind getKind() const
Returns the kind of 'typeof' type this is.
TypeOfExprType(const ASTContext &Context, Expr *E, TypeOfKind Kind, QualType Can=QualType())
Expr * getUnderlyingExpr() const
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!
TypeWithKeyword(ElaboratedTypeKeyword Keyword, TypeClass tc, QualType Canonical, TypeDependence Dependence)
friend class AttributedType
friend class ConstantArrayType
friend class CountAttributedType
FunctionTypeBitfields store various bits belonging to FunctionProtoType.
friend class FunctionProtoType
friend class FunctionType
friend class KeywordWrapper
friend class ObjCObjectType
friend class PackExpansionType
friend class PredefinedSugarType
friend class ReferenceType
friend class SubstTemplateTypeParmPackType
friend class SubstPackType
friend class SubstTemplateTypeParmType
friend class TemplateSpecializationType
friend class TemplateTypeParmType
friend class TypeOfExprType
friend class UnresolvedUsingType
friend class DependentVectorType
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.
bool isDecltypeType() const
bool isDependentSizedArrayType() const
bool isFixedPointOrIntegerType() const
Return true if this is a fixed point or integer type.
bool isBlockPointerType() const
TypedefBitfields TypedefBits
bool isBooleanType() const
bool isFunctionReferenceType() const
bool isSignableType(const ASTContext &Ctx) const
Type(const Type &)=delete
bool isObjCBuiltinType() const
const TemplateSpecializationType * getAsNonAliasTemplateSpecializationType() const
Look through sugar for an instance of TemplateSpecializationType which is not a type alias,...
bool isMFloat8Type() const
const Type * getPointeeOrArrayElementType() const
If this is a pointer type, return the pointee type.
bool isIncompleteArrayType() const
bool isPlaceholderType() const
Test for a type which does not represent an actual type-system type but is instead used as a placehol...
bool isFloat16Type() const
ReferenceTypeBitfields ReferenceTypeBits
bool isSignablePointerType() const
ArrayTypeBitfields ArrayTypeBits
const ArrayType * castAsArrayTypeUnsafe() const
A variant of castAs<> for array type which silently discards qualifiers from the outermost type.
static constexpr int NumDeducedTypeBits
bool isDependentAddressSpaceType() const
bool isUndeducedAutoType() const
bool isRValueReferenceType() const
bool isFundamentalType() const
Tests whether the type is categorized as a fundamental type.
VectorTypeBitfields VectorTypeBits
SubstPackTypeBitfields SubstPackTypeBits
bool isConstantArrayType() const
bool canDecayToPointerType() const
Determines whether this type can decay to a pointer type.
bool isFunctionPointerType() const
bool isHLSLInlineSpirvType() const
bool isConvertibleToFixedPointType() const
Return true if this can be converted to (or from) a fixed point type.
bool isArithmeticType() const
PredefinedSugarTypeBitfields PredefinedSugarTypeBits
bool isConstantMatrixType() const
bool isHLSLBuiltinIntangibleType() const
bool isPointerType() const
const TemplateSpecializationType * castAsNonAliasTemplateSpecializationType() const
bool isArrayParameterType() const
TypeOfBitfields TypeOfBits
static constexpr int FunctionTypeNumParamsLimit
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
bool isObjCSelType() const
const T * castAs() const
Member-template castAs<specific type>.
BuiltinTypeBitfields BuiltinTypeBits
bool isSpecificPlaceholderType(unsigned K) const
Test for a specific placeholder type.
bool isReferenceType() const
bool isSignedFixedPointType() const
Return true if this is a fixed point type that is signed according to ISO/IEC JTC1 SC22 WG14 N1169.
bool isObjectPointerType() 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)
bool isScalarType() const
bool isVariableArrayType() const
bool isFloat128Type() const
bool isSveVLSBuiltinType() const
Determines if this is a sizeless type supported by the 'arm_sve_vector_bits' type attribute,...
CountAttributedTypeBitfields CountAttributedTypeBits
bool isObjCQualifiedIdType() const
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
LinkageInfo getLinkageAndVisibility() const
Determine the linkage and visibility of this type.
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
bool isExtVectorType() const
bool isExtVectorBoolType() const
Type & operator=(const Type &)=delete
bool isObjCObjectOrInterfaceType() const
bool isNonOverloadPlaceholderType() const
Test for a placeholder type other than Overload; see BuiltinType::isNonOverloadPlaceholderType.
bool isOCLIntelSubgroupAVCType() const
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 isMemberDataPointerType() const
bool isLValueReferenceType() const
bool isBitIntType() const
bool isSpecificBuiltinType(unsigned K) const
Test for a particular builtin type.
bool isBuiltinType() const
Helper methods to distinguish type categories.
bool isOpenCLSpecificType() const
bool isConstantMatrixBoolType() const
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isSignableIntegerType(const ASTContext &Ctx) const
bool isFloat32Type() const
bool isAnyComplexType() const
bool isFixedPointType() const
Return true if this is a fixed point type according to ISO/IEC JTC1 SC22 WG14 N1169.
friend class TypePropertyCache
DeducedType * getContainedDeducedType() const
Get the DeducedType whose type will be deduced for a variable with an initializer of this type.
bool isSaturatedFixedPointType() const
Return true if this is a saturated fixed point type according to ISO/IEC JTC1 SC22 WG14 N1169.
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
bool hasPointeeToCFIUncheckedCalleeFunctionType() const
const BuiltinType * getAsPlaceholderType() const
QualType getCanonicalTypeInternal() const
bool isHLSLSpecificType() const
bool isTemplateTypeParmType() const
static constexpr unsigned TemplateTypeParmTypeDepthBits
@ PtrdiffT
The "ptrdiff_t" type.
@ SizeT
The "size_t" type.
@ SignedSizeT
The signed integer type corresponding to "size_t".
bool isCompoundType() const
Tests whether the type is categorized as a compound type.
bool containsErrors() const
Whether this type is an error type.
const Type * getBaseElementTypeUnsafe() const
Get the base element type of this type, potentially discarding type qualifiers.
bool isMemberPointerType() const
bool isAtomicType() const
AttributedTypeBitfields AttributedTypeBits
bool isFunctionProtoType() const
bool isIbm128Type() const
bool isOverloadableType() const
Determines whether this is a type for which one can define an overloaded operator.
bool isObjCIdType() const
bool isMatrixType() const
TagTypeBitfields TagTypeBits
bool isOverflowBehaviorType() const
PackExpansionTypeBitfields PackExpansionTypeBits
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
bool isUnsaturatedFixedPointType() const
Return true if this is a saturated fixed point type according to ISO/IEC JTC1 SC22 WG14 N1169.
UnresolvedUsingBitfields UnresolvedUsingBits
bool isObjCObjectType() const
bool isFromAST() const
Whether this type comes from an AST file.
const ArrayType * getAsArrayTypeUnsafe() const
A variant of getAs<> for array types which silently discards qualifiers from the outermost type.
bool isUndeducedType() const
Determine whether this type is an undeduced type, meaning that it somehow involves a C++11 'auto' typ...
bool isObjectType() const
Determine whether this type is an object type.
bool isDoubleType() const
bool isPointerOrReferenceType() const
KeywordWrapperBitfields KeywordWrapperBits
FunctionTypeBitfields FunctionTypeBits
bool isBFloat16Type() const
void setDependence(TypeDependence D)
const T * getAsAdjusted() const
Member-template getAsAdjusted<specific type>.
bool isFunctionType() const
bool isObjCObjectPointerType() const
SubstTemplateTypeParmTypeBitfields SubstTemplateTypeParmTypeBits
TypeDependence getDependence() const
Visibility getVisibility() const
Determine the visibility of this type.
bool isMemberFunctionPointerType() const
bool isUnsignedFixedPointType() const
Return true if this is a fixed point type that is unsigned according to ISO/IEC JTC1 SC22 WG14 N1169.
bool isVectorType() const
bool isObjCQualifiedClassType() const
bool isObjCClassType() const
bool isObjCInertUnsafeUnretainedType() const
Was this type written with the special inert-in-ARC __unsafe_unretained qualifier?
bool isRealFloatingType() const
Floating point categories.
const T * getAsCanonical() const
If this type is canonically the specified type, return its canonical type cast to that specified type...
bool isHLSLAttributedResourceType() const
ObjCObjectTypeBitfields ObjCObjectTypeBits
TemplateTypeParmTypeBitfields TemplateTypeParmTypeBits
bool isOCLExtOpaqueType() const
const T * castAsCanonical() const
Return this type's canonical type cast to the specified type.
bool isAnyPointerType() const
TypeClass getTypeClass() const
bool isCanonicalUnqualified() const
Determines if this type would be canonical if it had no further qualification.
static constexpr unsigned TemplateTypeParmTypeIndexBits
bool isSubscriptableVectorType() const
const T * getAs() const
Member-template getAs<specific type>'.
const Type * getUnqualifiedDesugaredType() const
Return the specified type with any "sugar" removed from the type, removing any typedefs,...
bool isNullPtrType() const
bool isRecordType() const
TemplateSpecializationTypeBitfields TemplateSpecializationTypeBits
bool isTypedefNameType() const
Determines whether this type is written as a typedef-name.
static constexpr int FunctionTypeNumParamsWidth
bool isFunctionNoProtoType() const
bool isReserveIDT() const
bool hasObjCPointerRepresentation() const
Whether this type can represent an objective pointer type for the purpose of GC'ability.
bool hasPointerRepresentation() const
Whether this type is represented natively as a pointer.
DeducedTypeBitfields DeducedTypeBits
AutoTypeBitfields AutoTypeBits
bool isCFIUncheckedCalleeFunctionType() const
Type & operator=(Type &&)=delete
Base class for declarations which introduce a typedef-name.
TypedefNameDecl * getDecl() const
NestedNameSpecifier getQualifier() const
static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TypedefNameDecl *Decl, QualType Underlying)
static bool classof(const Type *T)
bool typeMatchesDecl() const
void Profile(llvm::FoldingSetNodeID &ID) const
void Profile(llvm::FoldingSetNodeID &ID) const
NestedNameSpecifier getQualifier() const
UnresolvedUsingTypenameDecl * getDecl() const
static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const UnresolvedUsingTypenameDecl *D)
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 ...
UsingShadowDecl * getDecl() const
void Profile(llvm::FoldingSetNodeID &ID) const
NestedNameSpecifier getQualifier() const
static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const UsingShadowDecl *D, QualType UnderlyingType)
static bool classof(const Type *T)
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
static bool classof(const Type *T)
friend class StmtIteratorBase
void Profile(llvm::FoldingSetNodeID &ID)
Expr * getSizeExpr() const
unsigned getNumElements() const
VectorType(QualType vecType, unsigned nElements, QualType canonType, VectorKind vecKind)
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.
mlir::Type getBaseType(mlir::Value varPtr)
@ AttributedType
The l-value was considered opaque, so the alignment was determined from a type, but that type was an ...
bool operator!=(const CommonEntityInfo &LHS, const CommonEntityInfo &RHS)
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const AstTypeMatcher< ArrayType > arrayType
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
uint32_t Literal
Literals are represented as positive integers.
std::variant< struct RequiresDecl, struct HeaderDecl, struct UmbrellaDirDecl, struct ModuleDecl, struct ExcludeDecl, struct ExportDecl, struct ExportAsDecl, struct ExternModuleDecl, struct UseDecl, struct LinkDecl, struct ConfigMacrosDecl, struct ConflictDecl > Decl
All declarations that can appear in a module declaration.
bool operator==(const ValueType &a, const ValueType &b)
bool isLiteral(TokenKind K)
Return true if this is a "literal" kind, like a numeric constant, string, etc.
The JSON file list parser is used to communicate input to InstallAPI.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
@ Overload
This is a legitimate overload: the existing declarations are functions or function templates with dif...
bool isa(CodeGen::Address addr)
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)
TypeDependenceScope::TypeDependence TypeDependence
void initialize(TemplateInstantiationCallbackPtrs &Callbacks, const Sema &TheSema)
@ Nullable
Values of this type can be null.
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 (&&).
@ TemplateName
The identifier is a template name. FIXME: Add an annotation for that.
bool IsEnumDeclComplete(EnumDecl *ED)
Check if the given decl is complete.
ExprDependence computeDependence(FullExpr *E)
@ Vector
'vector' clause, allowed on 'loop', Combined, and 'routine' directives.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
TypeOfKind
The kind of 'typeof' expression we're after.
bool operator==(const CallGraphNode::CallRecord &LHS, const CallGraphNode::CallRecord &RHS)
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
TypeDependence toTypeDependence(ExprDependence D)
@ Dependent
Parse the block as a dependent block, which may be used in some template instantiations but not other...
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.
@ Ordinary
This parameter uses ordinary ABI rules for its type.
OptionalUnsigned< unsigned > UnsignedOrNone
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
@ Template
We are parsing a template declaration.
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.
std::is_base_of< ArrayType, T > TypeIsArrayType
@ Keyword
The name has been typo-corrected to a keyword.
LangAS
Defines the address space values used by the address space qualifier of QualType.
void FixedPointValueToString(SmallVectorImpl< char > &Str, llvm::APSInt Val, unsigned Scale)
bool operator!=(CanQual< T > x, CanQual< U > y)
@ Deduced
The normal deduced case.
@ Undeduced
Not deduced yet. This is for example an 'auto' which was just parsed.
@ DeducedAsPack
Same as above, but additionally this represents a case where the deduced entity itself is a pack.
@ DeducedAsDependent
This is a special case where the initializer is dependent, so we can't deduce a type yet.
PointerAuthenticationMode
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)
Insertion operator for diagnostics.
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
U cast(CodeGen::Address addr)
@ None
The alignment was not explicit in code.
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.
@ None
No keyword precedes the qualified type name.
@ Struct
The "struct" keyword introduces the elaborated-type-specifier.
@ Class
The "class" keyword introduces the elaborated-type-specifier.
@ Union
The "union" keyword introduces the elaborated-type-specifier.
@ Enum
The "enum" 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)
OptionalUnsigned< NullabilityKind > NullabilityKindOrNone
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...
void Profile(llvm::FoldingSetNodeID &ID)
const T * getType() const
FunctionEffectWithCondition Rejected
FunctionEffectWithCondition Kept
A FunctionEffect plus a potential boolean expression determining whether the effect is declared (e....
FunctionEffectWithCondition(FunctionEffect E, const EffectConditionExpr &C)
Holds information about the various types of exception specification.
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
ExceptionSpecInfo(ExceptionSpecificationType EST)
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
ExceptionSpecificationType Type
The kind of exception specification this is.
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Expr * NoexceptExpr
Noexcept expression, if this is a computed noexcept specification.
ExceptionSpecInfo()=default
Extra information about a function prototype.
ExceptionSpecInfo ExceptionSpec
FunctionTypeExtraAttributeInfo ExtraAttributeInfo
bool requiresFunctionProtoTypeArmAttributes() const
unsigned AArch64SMEAttributes
SourceLocation EllipsisLoc
FunctionEffectsRef FunctionEffects
unsigned CFIUncheckedCallee
const ExtParameterInfo * ExtParameterInfos
RefQualifierKind RefQualifier
bool requiresFunctionProtoTypeExtraAttributeInfo() const
ExtProtoInfo withCFIUncheckedCallee(bool CFIUncheckedCallee)
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.
FunctionTypeArmAttributes()
unsigned AArch64SMEAttributes
Any AArch64 SME ACLE type attributes that need to be propagated on declarations and function pointers...
Provides a few static helpers for converting and printing elaborated type keyword and tag type kind e...
static StringRef getTagTypeKindName(TagTypeKind Kind)
static StringRef getKeywordName(ElaboratedTypeKeyword Keyword)
static ElaboratedTypeKeyword getKeywordForTagTypeKind(TagTypeKind Tag)
Converts a TagTypeKind into an elaborated type keyword.
static TagTypeKind getTagTypeKindForKeyword(ElaboratedTypeKeyword Keyword)
Converts an elaborated type keyword into a TagTypeKind.
static TagTypeKind getTagTypeKindForTypeSpec(unsigned TypeSpec)
Converts a type specifier (DeclSpec::TST) into a tag type kind.
static bool KeywordIsTagTypeKind(ElaboratedTypeKeyword Keyword)
static ElaboratedTypeKeyword getKeywordForTypeSpec(unsigned TypeSpec)
Converts a type specifier (DeclSpec::TST) into an elaborated type keyword.
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 constexpr int NumLowBitsAvailable
static void * getAsVoidPointer(::clang::Type *P)
static constexpr int NumLowBitsAvailable
static inline ::clang::Type * getFromVoidPointer(void *P)
static void * getAsVoidPointer(clang::QualType P)
static clang::QualType getFromVoidPointer(void *P)
static constexpr int NumLowBitsAvailable
static SimpleType getSimplifiedValue(::clang::QualType Val)
const ::clang::Type * SimpleType