17 #ifndef LLVM_CLANG_AST_TYPE_H
18 #define LLVM_CLANG_AST_TYPE_H
30 #include "llvm/ADT/APInt.h"
31 #include "llvm/ADT/FoldingSet.h"
32 #include "llvm/ADT/Optional.h"
33 #include "llvm/ADT/PointerIntPair.h"
34 #include "llvm/ADT/PointerUnion.h"
35 #include "llvm/ADT/Twine.h"
36 #include "llvm/ADT/iterator_range.h"
37 #include "llvm/Support/ErrorHandling.h"
51 class PointerLikeTypeTraits;
72 struct isPodLike<clang::QualType> {
static const bool value =
true; };
77 class TypedefNameDecl;
79 class TemplateTypeParmDecl;
80 class NonTypeTemplateParmDecl;
81 class TemplateTemplateParmDecl;
88 class ObjCInterfaceDecl;
89 class ObjCProtocolDecl;
91 class UnresolvedUsingTypenameDecl;
95 class StmtIteratorBase;
96 class TemplateArgument;
97 class TemplateArgumentLoc;
98 class TemplateArgumentListInfo;
101 class ExtQualsTypeCommonBase;
102 struct PrintingPolicy;
104 template <
typename>
class CanQual;
108 #define TYPE(Class, Base) class Class##Type;
109 #include "clang/AST/TypeNodes.def"
173 Q.Mask = L.Mask & R.Mask;
253 assert(!(mask & ~
CVRMask) &&
"bitmask contains non-CVR bits");
254 Mask = (Mask & ~
CVRMask) | mask;
257 assert(!(mask & ~
CVRMask) &&
"bitmask contains non-CVR bits");
264 assert(!(mask & ~
CVRMask) &&
"bitmask contains non-CVR bits");
271 Mask = (Mask & ~GCAttrMask) | (type << GCAttrShift);
291 return ObjCLifetime((Mask & LifetimeMask) >> LifetimeShift);
294 Mask = (Mask & ~LifetimeMask) | (type << LifetimeShift);
300 Mask |= (type << LifetimeShift);
319 Mask = (Mask & ~AddressSpaceMask)
320 | (((uint32_t) space) << AddressSpaceShift);
333 assert(!(mask & ~
FastMask) &&
"bitmask contains non-fast qualifier bits");
337 assert(!(mask & ~
FastMask) &&
"bitmask contains non-fast qualifier bits");
344 assert(!(mask & ~
FastMask) &&
"bitmask contains non-fast qualifier bits");
359 bool empty()
const {
return !Mask; }
496 bool appendSpaceIfNonEmpty =
false)
const;
508 static const uint32_t GCAttrMask = 0x18;
509 static const uint32_t GCAttrShift = 3;
510 static const uint32_t LifetimeMask = 0xE0;
511 static const uint32_t LifetimeShift = 5;
512 static const uint32_t AddressSpaceMask = ~(
CVRMask|GCAttrMask|LifetimeMask);
513 static const uint32_t AddressSpaceShift = 8;
531 std::pair<const Type *,Qualifiers>
asPair()
const {
532 return std::pair<const Type *, Qualifiers>(Ty, Quals);
577 llvm::PointerIntPair<llvm::PointerUnion<const Type*,const ExtQuals*>,
580 const ExtQuals *getExtQualsUnsafe()
const {
584 const Type *getTypePtrUnsafe()
const {
585 return Value.getPointer().get<
const Type*>();
589 assert(!isNull() &&
"Cannot retrieve a NULL type pointer");
590 uintptr_t CommonPtrVal
591 =
reinterpret_cast<uintptr_t
>(
Value.getOpaqueValue());
601 :
Value(Ptr, Quals) {}
603 :
Value(Ptr, Quals) {}
612 const Type *getTypePtr()
const;
614 const Type *getTypePtrOrNull()
const;
626 T.Value.setFromOpaqueValue(const_cast<void*>(Ptr));
631 return *getTypePtr();
638 bool isCanonical()
const;
639 bool isCanonicalAsParam()
const;
643 return Value.getPointer().isNull();
654 bool isConstQualified()
const;
664 bool isRestrictQualified()
const;
674 bool isVolatileQualified()
const;
680 return getLocalFastQualifiers() || hasLocalNonFastQualifiers();
705 return getLocalFastQualifiers();
762 return withFastQualifiers(CVR);
767 &&
"non-fast qualifier bits set in mask!");
771 void removeLocalConst();
772 void removeLocalVolatile();
773 void removeLocalRestrict();
774 void removeLocalCVRQualifiers(
unsigned Mask);
828 inline QualType getUnqualifiedType()
const;
843 bool isMoreQualifiedThan(
QualType Other)
const;
847 bool isAtLeastAsQualifiedAs(
QualType Other)
const;
849 QualType getNonReferenceType()
const;
870 return getDesugaredType(*
this, Context);
874 return getSplitDesugaredType(*
this);
883 return getSingleStepDesugaredTypeImpl(*
this, Context);
889 if (isa<ParenType>(*
this))
896 return LHS.Value == RHS.Value;
899 return LHS.Value != RHS.Value;
912 const Twine &PlaceHolder = Twine())
const {
913 print(split(), OS, Policy, PlaceHolder);
917 return print(split.
Ty, split.
Quals, OS, policy, PlaceHolder);
921 const Twine &PlaceHolder);
925 return getAsStringInternal(split(), Str, Policy);
929 return getAsStringInternal(split.
Ty, split.
Quals, out, policy);
938 const Twine &PlaceHolder;
941 const Twine &PlaceHolder)
942 : T(T), Policy(Policy), PlaceHolder(PlaceHolder) { }
946 SQT.T.
print(OS, SQT.Policy, SQT.PlaceHolder);
952 const Twine &PlaceHolder = Twine())
const {
956 void dump(
const char *s)
const;
960 ID.AddPointer(getAsOpaquePtr());
981 return getQualifiers().getObjCLifetime();
985 return getQualifiers().hasNonTrivialObjCLifetime();
989 return getQualifiers().hasStrongOrWeakObjCLifetime();
996 DK_objc_weak_lifetime
1004 return isDestructedTypeImpl(*
this);
1017 bool isCForbiddenLValueType()
const;
1075 static DestructionKind isDestructedTypeImpl(
QualType type);
1101 enum { NumLowBitsAvailable = 0 };
1114 : BaseType(baseType), CanonicalType(canon) {}
1121 const Type *
const BaseType;
1164 canon.isNull() ?
QualType(this_(), 0) : canon),
1168 &&
"ExtQuals created with no fast qualifiers");
1170 &&
"ExtQuals created with fast qualifiers");
1193 const Type *BaseType,
1196 ID.AddPointer(BaseType);
1252 #define TYPE(Class, Base) Class,
1253 #define LAST_TYPE(Class) TypeLast = Class,
1254 #define ABSTRACT_TYPE(Class, Base)
1255 #include "clang/AST/TypeNodes.def"
1261 void operator=(
const Type &) =
delete;
1264 class TypeBitfields {
1272 unsigned Dependent : 1;
1276 unsigned InstantiationDependent : 1;
1279 unsigned VariablyModified : 1;
1283 unsigned ContainsUnexpandedParameterPack : 1;
1287 mutable unsigned CacheValid : 1;
1290 mutable unsigned CachedLinkage : 3;
1293 mutable unsigned CachedLocalOrUnnamed : 1;
1296 mutable unsigned FromAST : 1;
1298 bool isCacheValid()
const {
1302 assert(isCacheValid() &&
"getting linkage from invalid cache");
1303 return static_cast<Linkage>(CachedLinkage);
1305 bool hasLocalOrUnnamedType()
const {
1306 assert(isCacheValid() &&
"getting linkage from invalid cache");
1307 return CachedLocalOrUnnamed;
1310 enum { NumTypeBits = 18 };
1319 unsigned : NumTypeBits;
1323 unsigned IndexTypeQuals : 3;
1328 unsigned SizeModifier : 3;
1334 unsigned : NumTypeBits;
1344 unsigned : NumTypeBits;
1356 unsigned TypeQuals : 3;
1361 unsigned RefQualifier : 2;
1367 unsigned : NumTypeBits;
1370 unsigned NumTypeArgs : 7;
1373 unsigned NumProtocols : 6;
1376 unsigned IsKindOf : 1;
1378 static_assert(NumTypeBits + 7 + 6 + 1 <= 32,
"Does not fit in an unsigned");
1383 unsigned : NumTypeBits;
1396 unsigned SpelledAsLValue : 1;
1400 unsigned InnerRef : 1;
1406 unsigned : NumTypeBits;
1409 unsigned Keyword : 8;
1415 unsigned : NumTypeBits;
1419 unsigned VecKind : 3;
1422 unsigned NumElements : 29 - NumTypeBits;
1424 enum { MaxNumElements = (1 << (29 - NumTypeBits)) - 1 };
1430 unsigned : NumTypeBits;
1433 unsigned AttrKind : 32 - NumTypeBits;
1439 unsigned : NumTypeBits;
1443 unsigned Keyword : 2;
1461 void setFromAST(
bool V =
true)
const {
1471 bool InstantiationDependent,
bool VariablyModified,
1472 bool ContainsUnexpandedParameterPack)
1477 TypeBits.InstantiationDependent = Dependent || InstantiationDependent;
1478 TypeBits.VariablyModified = VariablyModified;
1479 TypeBits.ContainsUnexpandedParameterPack = ContainsUnexpandedParameterPack;
1481 TypeBits.CachedLocalOrUnnamed =
false;
1490 TypeBits.InstantiationDependent =
true;
1493 TypeBits.InstantiationDependent = D; }
1497 TypeBits.ContainsUnexpandedParameterPack = PP;
1522 return TypeBits.ContainsUnexpandedParameterPack;
1528 return CanonicalType ==
QualType(
this, 0);
1758 return TypeBits.InstantiationDependent;
1850 template <
typename T>
const T *
getAs()
const;
1862 template <
typename T>
const T *
castAs()
const;
1974 return CanonicalType;
1998 #define TYPE(Class, Base)
1999 #define LEAF_TYPE(Class) \
2000 template <> inline const Class##Type *Type::getAs() const { \
2001 return dyn_cast<Class##Type>(CanonicalType); \
2003 template <> inline const Class##Type *Type::castAs() const { \
2004 return cast<Class##Type>(CanonicalType); \
2006 #include "clang/AST/TypeNodes.def"
2014 #define BUILTIN_TYPE(Id, SingletonId) Id,
2015 #define LAST_BUILTIN_TYPE(Id) LastKind = Id
2016 #include "clang/AST/BuiltinTypes.def"
2032 StringRef str =
getName(Policy);
2033 assert(!str.empty() && str.data()[str.size()] ==
'\0');
2058 return K >= Overload;
2094 ElementType(Element) {
2155 PointeeType(Pointee) {
2206 OriginalTy(OriginalTy), AdjustedTy(AdjustedTy) {}
2218 Profile(ID, OriginalTy, AdjustedTy);
2234 :
AdjustedType(Decayed, OriginalType, DecayedPtr, CanonicalPtr) {
2261 PointeeType(Pointee) {
2292 bool SpelledAsLValue) :
2297 PointeeType(Referencee)
2313 return T->PointeeType;
2321 bool SpelledAsLValue) {
2323 ID.AddBoolean(SpelledAsLValue);
2336 bool SpelledAsLValue) :
2337 ReferenceType(LValueReference, Referencee, CanonicalRef, SpelledAsLValue)
2353 ReferenceType(RValueReference, Referencee, CanonicalRef,
false) {
2376 Type(MemberPointer, CanonicalPtr,
2383 PointeeType(Pointee), Class(Cls) {
2412 const Type *Class) {
2414 ID.AddPointer(Class);
2445 bool ContainsUnexpandedParameterPack)
2449 ContainsUnexpandedParameterPack),
2485 :
ArrayType(ConstantArray, et, can, sm, tq,
2495 const llvm::APInt &
getSize()
const {
return Size; }
2504 const llvm::APInt &NumElements);
2516 unsigned TypeQuals) {
2518 ID.AddInteger(ArraySize.getZExtValue());
2519 ID.AddInteger(SizeMod);
2520 ID.AddInteger(TypeQuals);
2534 :
ArrayType(IncompleteArray, et, can, sm, tq,
2555 ID.AddInteger(SizeMod);
2556 ID.AddInteger(TypeQuals);
2585 :
ArrayType(VariableArray, et, can, sm, tq,
2587 SizeExpr((
Stmt*) e), Brackets(brackets) {}
2594 return (
Expr*) SizeExpr;
2610 llvm_unreachable(
"Cannot unique VariableArrayTypes.");
2650 return (
Expr*) SizeExpr;
2673 unsigned TypeQuals,
Expr *
E);
2751 return NumElements > VectorTypeBitfields::MaxNumElements;
2769 ID.AddInteger(NumElements);
2770 ID.AddInteger(TypeClass);
2771 ID.AddInteger(VecKind);
2812 case 'a':
return 10;
2814 case 'b':
return 11;
2816 case 'c':
return 12;
2818 case 'd':
return 13;
2820 case 'e':
return 14;
2822 case 'f':
return 15;
2881 enum { CallConvMask = 0xF };
2882 enum { NoReturnMask = 0x10 };
2883 enum { ProducesResultMask = 0x20 };
2884 enum { RegParmMask = ~(CallConvMask | NoReturnMask | ProducesResultMask),
2885 RegParmOffset = 6 };
2889 ExtInfo(
unsigned Bits) : Bits(static_cast<uint16_t>(Bits)) {}
2897 bool producesResult) {
2898 assert((!hasRegParm || regParm < 7) &&
"Invalid regparm value");
2900 (noReturn ? NoReturnMask : 0) |
2901 (producesResult ? ProducesResultMask : 0) |
2902 (hasRegParm ? ((regParm + 1) << RegParmOffset) : 0);
2917 unsigned RegParm = Bits >> RegParmOffset;
2925 return Bits == Other.Bits;
2928 return Bits != Other.Bits;
2936 return ExtInfo(Bits | NoReturnMask);
2938 return ExtInfo(Bits & ~NoReturnMask);
2943 return ExtInfo(Bits | ProducesResultMask);
2945 return ExtInfo(Bits & ~ProducesResultMask);
2949 assert(RegParm < 7 &&
"Invalid regparm value");
2950 return ExtInfo((Bits & ~RegParmMask) |
2951 ((RegParm + 1) << RegParmOffset));
2955 return ExtInfo((Bits & ~CallConvMask) | (
unsigned) cc);
2959 ID.AddInteger(Bits);
2965 QualType Canonical,
bool Dependent,
2966 bool InstantiationDependent,
2967 bool VariablyModified,
bool ContainsUnexpandedParameterPack,
2969 :
Type(tc, Canonical, Dependent, InstantiationDependent, VariablyModified,
2970 ContainsUnexpandedParameterPack),
3046 SourceDecl(nullptr), SourceTemplate(nullptr) {}
3049 :
Type(EST), NoexceptExpr(nullptr), SourceDecl(nullptr),
3050 SourceTemplate(nullptr) {}
3069 : Variadic(
false), HasTrailingReturn(
false), TypeQuals(0),
3070 RefQualifier(
RQ_None), ConsumedParameters(nullptr) {}
3074 RefQualifier(
RQ_None), ConsumedParameters(nullptr) {}
3084 bool HasTrailingReturn : 1;
3094 static bool containsAnyUnexpandedParameterPack(
const QualType *ArgArray,
3096 for (
unsigned Idx = 0; Idx < numArgs; ++Idx)
3104 QualType canonical,
const ExtProtoInfo &epi);
3107 unsigned NumParams : 15;
3110 unsigned NumExceptions : 9;
3113 unsigned ExceptionSpecType : 4;
3116 unsigned HasAnyConsumedParams : 1;
3119 unsigned Variadic : 1;
3122 unsigned HasTrailingReturn : 1;
3144 const bool *getConsumedParamsBuffer()
const {
3145 assert(hasAnyConsumedParams());
3148 Expr *
const *eh_end =
reinterpret_cast<Expr *
const *
>(exception_end());
3156 return reinterpret_cast<const bool*
>(eh_end);
3162 assert(i < NumParams &&
"invalid parameter index");
3163 return param_type_begin()[i];
3166 return llvm::makeArrayRef(param_type_begin(), param_type_end());
3187 if (hasAnyConsumedParams())
3198 return getExceptionSpecType() !=
EST_None;
3209 bool hasDependentExceptionSpec()
const;
3219 NoexceptResult getNoexceptSpec(
const ASTContext &Ctx)
const;
3222 assert(i < NumExceptions &&
"Invalid exception number!");
3223 return exception_begin()[i];
3229 return *
reinterpret_cast<Expr *
const *
>(param_type_end());
3239 return reinterpret_cast<FunctionDecl *
const *
>(param_type_end())[0];
3248 return reinterpret_cast<FunctionDecl *
const *
>(param_type_end())[1];
3253 bool isNothrow(
const ASTContext &Ctx,
bool ResultIfDependent =
false)
const;
3263 bool isTemplateVariadic()
const;
3282 return reinterpret_cast<const QualType *
>(
this+1);
3285 return param_type_begin() + NumParams;
3291 return llvm::makeArrayRef(exception_begin(), exception_end());
3295 return param_type_end();
3299 return exception_begin();
3300 return exception_begin() + NumExceptions;
3305 assert(I < getNumParams() &&
"parameter index out of range");
3306 if (hasAnyConsumedParams())
3307 return getConsumedParamsBuffer()[
I];
3314 void printExceptionSpecification(raw_ostream &OS,
3323 param_type_iterator ArgTys,
unsigned NumArgs,
3338 Decl(const_cast<UnresolvedUsingTypenameDecl*>(D)) {}
3370 assert(!isa<TypedefType>(can) &&
"Invalid canonical type");
3433 assert(!isa<TypedefType>(can) &&
"Invalid canonical type");
3482 Profile(ID, Context, getUnderlyingExpr());
3535 bool isBeingDefined()
const;
3610 FirstExprOperandKind = attr_address_space,
3611 LastExprOperandKind = attr_neon_polyvector_type,
3619 FirstEnumOperandKind = attr_objc_gc,
3620 LastEnumOperandKind = attr_pcs_vfp,
3656 ModifiedType(modified), EquivalentType(equivalent) {
3686 bool isQualifier()
const;
3688 bool isMSTypeSpec()
const;
3690 bool isCallingConv()
const;
3699 return attr_nonnull;
3702 return attr_nullable;
3705 return attr_null_unspecified;
3707 llvm_unreachable(
"Unknown nullability kind.");
3722 Profile(ID, getAttrKind(), ModifiedType, EquivalentType);
3727 ID.AddInteger(attrKind);
3739 struct CanonicalTTPTInfo {
3740 unsigned Depth : 15;
3741 unsigned ParameterPack : 1;
3742 unsigned Index : 16;
3754 :
Type(TemplateTypeParm, Canon,
true,
3758 TTPDecl(TTPDecl) { }
3761 TemplateTypeParmType(
unsigned D,
unsigned I,
bool PP)
3762 : Type(TemplateTypeParm,
QualType(this, 0),
3766 CanTTPTInfo.Depth = D;
3767 CanTTPTInfo.Index =
I;
3768 CanTTPTInfo.ParameterPack = PP;
3773 const CanonicalTTPTInfo& getCanTTPTInfo()
const {
3779 unsigned getDepth()
const {
return getCanTTPTInfo().Depth; }
3780 unsigned getIndex()
const {
return getCanTTPTInfo().Index; }
3793 Profile(ID, getDepth(), getIndex(), isParameterPack(), getDecl());
3797 unsigned Index,
bool ParameterPack,
3799 ID.AddInteger(Depth);
3800 ID.AddInteger(Index);
3801 ID.AddBoolean(ParameterPack);
3802 ID.AddPointer(TTPDecl);
3846 Profile(ID, getReplacedParameter(), getReplacementType());
3851 ID.AddPointer(Replaced);
3881 unsigned NumArguments;
3902 void Profile(llvm::FoldingSetNodeID &
ID);
3903 static void Profile(llvm::FoldingSetNodeID &
ID,
3921 IsDependent, IsDependent,
3925 assert((DeducedType.
isNull() || !IsDependent) &&
3926 "auto deduced to dependent type");
3959 ID.AddInteger((
unsigned)Keyword);
3960 ID.AddBoolean(IsDependent);
3990 public llvm::FoldingSetNode {
4018 bool &InstantiationDependent);
4021 bool &InstantiationDependent);
4029 bool SkipBrackets =
false);
4066 assert(
isTypeAlias() &&
"not a type alias template specialization");
4088 const TemplateArgument &
getArg(
unsigned Idx)
const;
4101 static void Profile(llvm::FoldingSetNodeID &
ID, TemplateName T,
4102 const TemplateArgument *Args,
4151 Decl(D), InjectedType(TST) {
4152 assert(isa<TemplateSpecializationType>(TST));
4160 return cast<TemplateSpecializationType>(InjectedType.getTypePtr());
4214 QualType Canonical,
bool Dependent,
4215 bool InstantiationDependent,
bool VariablyModified,
4216 bool ContainsUnexpandedParameterPack)
4217 :
Type(tc, Canonical, Dependent, InstantiationDependent, VariablyModified,
4218 ContainsUnexpandedParameterPack) {
4232 static TagTypeKind getTagTypeKindForTypeSpec(
unsigned TypeSpec);
4247 return getKeywordName(getKeywordForTagTypeKind(Kind));
4277 NNS(NNS), NamedType(NamedType) {
4278 assert(!(Keyword ==
ETK_None && NNS ==
nullptr) &&
4279 "ElaboratedType cannot have elaborated type keyword "
4280 "and name qualifier both null.");
4301 Profile(ID, getKeyword(), NNS, NamedType);
4306 ID.AddInteger(Keyword);
4342 NNS(NNS),
Name(Name) {}
4363 Profile(ID, getKeyword(), NNS, Name);
4368 ID.AddInteger(Keyword);
4370 ID.AddPointer(Name);
4383 public llvm::FoldingSetNode {
4399 return reinterpret_cast<TemplateArgument*
>(
this+1);
4403 NestedNameSpecifier *NNS,
4404 const IdentifierInfo *
Name,
4406 const TemplateArgument *Args,
4416 const TemplateArgument *
getArgs()
const {
4423 const TemplateArgument &
getArg(
unsigned Idx)
const;
4425 typedef const TemplateArgument *
iterator;
4429 bool isSugared()
const {
return false; }
4436 static void Profile(llvm::FoldingSetNodeID &ID,
4439 NestedNameSpecifier *Qualifier,
4440 const IdentifierInfo *
Name,
4442 const TemplateArgument *Args);
4444 static bool classof(
const Type *T) {
4445 return T->getTypeClass() == DependentTemplateSpecialization;
4481 unsigned NumExpansions;
4490 NumExpansions(NumExpansions? *NumExpansions + 1: 0) { }
4504 return NumExpansions - 1;
4513 Profile(ID, getPattern(), getNumExpansions());
4519 ID.AddBoolean(NumExpansions.hasValue());
4521 ID.AddInteger(*NumExpansions);
4574 mutable llvm::PointerIntPair<const ObjCObjectType *, 1, bool>
4575 CachedSuperClassType;
4582 const QualType *getTypeArgStorage()
const {
4603 void computeSuperClassTypeSlow()
const;
4615 return getBaseType()->isSpecificBuiltinType(BuiltinType::ObjCId);
4618 return getBaseType()->isSpecificBuiltinType(BuiltinType::ObjCClass);
4623 if (!qual_empty())
return false;
4624 if (
const BuiltinType *T = getBaseType()->getAs<BuiltinType>())
4625 return T->getKind() == BuiltinType::ObjCId ||
4626 T->getKind() == BuiltinType::ObjCClass;
4638 bool isSpecialized()
const;
4659 return llvm::makeArrayRef(getTypeArgStorage(),
4678 assert(I < getNumProtocols() &&
"Out-of-range protocol access");
4679 return qual_begin()[
I];
4691 bool isKindOfType()
const;
4700 if (!CachedSuperClassType.getInt())
4701 computeSuperClassTypeSlow();
4703 assert(CachedSuperClassType.getInt() &&
"Superclass not set?");
4704 return QualType(CachedSuperClassType.getPointer(), 0);
4734 :
ObjCObjectType(Canonical, Base, typeArgs, protocols, isKindOf) {}
4737 void Profile(llvm::FoldingSetNodeID &ID);
4738 static void Profile(llvm::FoldingSetNodeID &ID,
4745 inline QualType *ObjCObjectType::getTypeArgStorage() {
4746 return reinterpret_cast<QualType *
>(
static_cast<ObjCObjectTypeImpl*
>(
this)+1);
4749 inline ObjCProtocolDecl **ObjCObjectType::getProtocolStorage() {
4750 return reinterpret_cast<ObjCProtocolDecl**
>(
4771 Decl(const_cast<ObjCInterfaceDecl*>(D)) {}
4804 return T->getDecl();
4806 baseType = ObjT->getBaseType();
4825 :
Type(ObjCObjectPointer, Canonical,
4830 PointeeType(Pointee) {}
4971 QualType getSuperClassType()
const;
5028 ElementType(elemType) {}
5065 return type.getTypePtrUnsafe();
5067 const ExtQuals *extQuals = type.getExtQualsUnsafe();
5090 return getCommonPtr()->BaseType;
5094 return (isNull() ?
nullptr : getCommonPtr()->BaseType);
5098 if (!hasLocalNonFastQualifiers())
5102 const ExtQuals *eq = getExtQualsUnsafe();
5110 if (hasLocalNonFastQualifiers())
5111 Quals = getExtQualsUnsafe()->getQualifiers();
5117 Qualifiers quals = getCommonPtr()->CanonicalType.getLocalQualifiers();
5123 unsigned cvr = getCommonPtr()->CanonicalType.getLocalCVRQualifiers();
5124 cvr |= getLocalCVRQualifiers();
5129 QualType canon = getCommonPtr()->CanonicalType;
5134 return getTypePtr()->isCanonicalUnqualified();
5138 if (!isCanonical())
return false;
5139 if (hasLocalQualifiers())
return false;
5141 const Type *T = getTypePtr();
5145 return !isa<FunctionType>(T) && !isa<ArrayType>(T);
5149 return isLocalConstQualified() ||
5150 getCommonPtr()->CanonicalType.isLocalConstQualified();
5154 return isLocalRestrictQualified() ||
5155 getCommonPtr()->CanonicalType.isLocalRestrictQualified();
5160 return isLocalVolatileQualified() ||
5161 getCommonPtr()->CanonicalType.isLocalVolatileQualified();
5165 return hasLocalQualifiers() ||
5166 getCommonPtr()->CanonicalType.hasLocalQualifiers();
5173 return QualType(getSplitUnqualifiedTypeImpl(*this).Ty, 0);
5180 return getSplitUnqualifiedTypeImpl(*
this);
5200 removeLocalFastQualifiers(Mask);
5205 return getQualifiers().getAddressSpace();
5210 return getQualifiers().getObjCGCAttr();
5216 return FT->getExtInfo();
5218 return FT->getExtInfo();
5243 return getQualifiers().compatiblyIncludes(other.
getQualifiers());
5263 return ((getTypePtr()->
isVoidType() && !hasQualifiers()) ||
5303 return isa<FunctionType>(CanonicalType);
5306 return isa<PointerType>(CanonicalType);
5312 return isa<BlockPointerType>(CanonicalType);
5315 return isa<ReferenceType>(CanonicalType);
5318 return isa<LValueReferenceType>(CanonicalType);
5321 return isa<RValueReferenceType>(CanonicalType);
5325 return T->getPointeeType()->isFunctionType();
5330 return isa<MemberPointerType>(CanonicalType);
5334 return T->isMemberFunctionPointer();
5340 return T->isMemberDataPointer();
5345 return isa<ArrayType>(CanonicalType);
5348 return isa<ConstantArrayType>(CanonicalType);
5351 return isa<IncompleteArrayType>(CanonicalType);
5354 return isa<VariableArrayType>(CanonicalType);
5357 return isa<DependentSizedArrayType>(CanonicalType);
5360 return isa<BuiltinType>(CanonicalType);
5363 return isa<RecordType>(CanonicalType);
5366 return isa<EnumType>(CanonicalType);
5369 return isa<ComplexType>(CanonicalType);
5372 return isa<VectorType>(CanonicalType);
5375 return isa<ExtVectorType>(CanonicalType);
5378 return isa<ObjCObjectPointerType>(CanonicalType);
5381 return isa<ObjCObjectType>(CanonicalType);
5384 return isa<ObjCInterfaceType>(CanonicalType) ||
5385 isa<ObjCObjectType>(CanonicalType);
5388 return isa<AtomicType>(CanonicalType);
5393 return OPT->isObjCQualifiedIdType();
5398 return OPT->isObjCQualifiedClassType();
5403 return OPT->isObjCIdType();
5408 return OPT->isObjCClassType();
5412 if (
const PointerType *OPT = getAs<PointerType>())
5413 return OPT->getPointeeType()->isSpecificBuiltinType(BuiltinType::ObjCSel);
5501 return isa<PipeType>(CanonicalType);
5510 return isa<TemplateTypeParmType>(CanonicalType);
5521 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(
this))
5522 return BT->isPlaceholderType();
5527 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(
this))
5528 if (BT->isPlaceholderType())
5535 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(
this))
5541 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(
this))
5542 return BT->isNonOverloadPlaceholderType();
5547 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
5548 return BT->getKind() == BuiltinType::Void;
5553 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
5554 return BT->getKind() == BuiltinType::Half;
5561 return BT->getKind() == BuiltinType::NullPtr;
5569 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
5570 return BT->getKind() >= BuiltinType::Bool &&
5571 BT->getKind() <= BuiltinType::Int128;
5572 if (
const EnumType *ET = dyn_cast<EnumType>(CanonicalType)) {
5582 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
5583 return BT->getKind() > BuiltinType::Void &&
5584 BT->getKind() <= BuiltinType::NullPtr;
5585 if (
const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
5589 return isa<PointerType>(CanonicalType) ||
5590 isa<BlockPointerType>(CanonicalType) ||
5591 isa<MemberPointerType>(CanonicalType) ||
5592 isa<ComplexType>(CanonicalType) ||
5593 isa<ObjCObjectPointerType>(CanonicalType);
5597 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
5598 return BT->getKind() >= BuiltinType::Bool &&
5599 BT->getKind() <= BuiltinType::Int128;
5603 if (
const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
5610 if (
const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
5611 return BT->getKind() == BuiltinType::Bool;
5643 type = arrayType->getElementType().getTypePtr();
5667 template <typename T, bool isArrayType = (std::is_same<T, ArrayType>::value ||
5668 std::is_base_of<ArrayType, T>::value)>
5671 template<
typename T>
5680 if (
const T *Ty = dyn_cast<T>(
this))
5684 if (!isa<T>(CanonicalType))
5694 if (
const ArrayType *arr = dyn_cast<ArrayType>(
this))
5698 if (!isa<ArrayType>(CanonicalType))
5710 if (
const T *ty = dyn_cast<T>(
this))
return ty;
5711 assert(isa<T>(CanonicalType));
5716 assert(isa<ArrayType>(CanonicalType));
5717 if (
const ArrayType *arr = dyn_cast<ArrayType>(
this))
return arr;
bool isDynamicExceptionSpec(ExceptionSpecificationType ESpecType)
bool isObjCSelType() const
bool isPlaceholderType() const
Determines whether this type is a placeholder type, i.e.
Internal representation of canonical, dependent typeof(expr) types.
unsigned getNumElements() const
bool hasObjCGCAttr() const
unsigned getAddressSpace() const
Return the address space of this type.
const ComplexType * getAsComplexIntegerType() const
bool isUnspecialized() const
Determine whether this object type is "unspecialized", meaning that it has no type arguments...
bool compatiblyIncludesObjCLifetime(Qualifiers other) const
Determines if these qualifiers compatibly include another set of qualifiers from the narrow perspecti...
void Profile(llvm::FoldingSetNodeID &ID) const
bool isObjCObjectOrInterfaceType() const
QualType getExceptionType(unsigned i) const
Represents a type that was referred to using an elaborated type keyword, e.g., struct S...
SourceLocation getEnd() const
typedefconst::clang::Type * SimpleType
Expr * getSizeExpr() const
QualType getUnderlyingType() const
Qualifiers getLocalQualifiers() const
Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifie...
const Type * Ty
The locally-unqualified type.
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
Qualifiers getNonFastQualifiers() const
static bool classof(const Type *T)
bool isNullPtrType() const
The "enum" keyword introduces the elaborated-type-specifier.
bool containsUnexpandedParameterPack() const
Whether this nested-name-specifier contains an unexpanded parameter pack (for C++11 variadic template...
unsigned getDepth() const
void setDependent(bool D=true)
no exception specification
bool canDecayToPointerType() const
Determines whether this type can decay to a pointer type.
bool isNonOverloadPlaceholderType() const
Test for a placeholder type other than Overload; see BuiltinType::isNonOverloadPlaceholderType.
PointerType - C99 6.7.5.1 - Pointer Declarators.
void Profile(llvm::FoldingSetNodeID &ID)
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
bool isAtLeastAsQualifiedAs(QualType Other) const
Determine whether this type is at least as qualified as the other given type, requiring exact equalit...
A (possibly-)qualified type.
bool isConstantArrayType() const
static void Profile(llvm::FoldingSetNodeID &ID, QualType Pointee)
ExtProtoInfo(CallingConv CC)
SourceRange getBracketsRange() const
bool isCanonicalUnqualified() const
Determines if this type would be canonical if it had no further qualification.
bool isSpecificBuiltinType(unsigned K) const
Test for a particular builtin type.
bool operator==(Qualifiers Other) const
bool hasFloatingRepresentation() const
Determine whether this type has a floating-point representation of some sort, e.g., it is a floating-point type or a vector thereof.
ExtInfo withCallingConv(CallingConv cc) const
ArrayRef< QualType > getTypeArgs() const
Retrieve the type arguments for this type.
DestructionKind isDestructedType() const
Returns a nonzero value if objects of this type require non-trivial work to clean up after...
static QualType getObjectType(APValue::LValueBase B)
Retrieves the "underlying object type" of the given expression, as used by __builtin_object_size.
bool isMemberPointerType() const
FunctionDecl * getExceptionSpecDecl() const
If this function type has an exception specification which hasn't been determined yet (either because...
__auto_type (GNU extension)
bool isKindOfTypeAsWritten() const
Whether this is a "__kindof" type as written.
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
unsigned getFastQualifiers() const
QualType getNonLValueExprType(const ASTContext &Context) const
Determine the type of a (typically non-lvalue) expression with the specified result type...
Qualifiers::ObjCLifetime getObjCARCImplicitLifetime() const
Return the implicit lifetime for this type, which must not be dependent.
bool IsEnumDeclScoped(EnumDecl *ED)
Check if the given decl is scoped.
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
void setInstantiationDependent(bool D=true)
NullabilityKind
Describes the nullability of a particular type.
bool isAnyCharacterType() const
Determine whether this type is any of the built-in character types.
FunctionType - C99 6.7.5.3 - Function Declarators.
bool isLocalRestrictQualified() const
Determine whether this particular QualType instance has the "restrict" qualifier set, without looking through typedefs that may have added "restrict" at a different level.
static void Profile(llvm::FoldingSetNodeID &ID, Kind attrKind, QualType modified, QualType equivalent)
void Profile(llvm::FoldingSetNodeID &ID)
bool canHaveNullability() const
Determine whether the given type can have a nullability specifier applied to it, i.e., if it is any kind of pointer type or a dependent type that could instantiate to any kind of pointer type.
static void Profile(llvm::FoldingSetNodeID &ID, QualType Inner)
No linkage, which means that the entity is unique and can only be referred to from within its scope...
void Profile(llvm::FoldingSetNodeID &ID)
void addConst()
Add the const type qualifier to this QualType.
Qualifiers::GC getObjCGCAttr() const
Returns gc attribute of this type.
Represents a qualified type name for which the type name is dependent.
CanonicalTTPTInfo CanTTPTInfo
void setObjCLifetime(ObjCLifetime type)
friend Qualifiers operator-(Qualifiers L, Qualifiers R)
Compute the difference between two qualifier sets.
ConstantArrayType(TypeClass tc, QualType et, QualType can, const llvm::APInt &size, ArraySizeModifier sm, unsigned tq)
ArrayRef< ObjCProtocolDecl * > getProtocols() const
Retrieve all of the protocol qualifiers.
static bool classof(const Type *T)
static bool classof(const Type *T)
static std::string getAsString(SplitQualType split)
bool isRecordType() const
static void Profile(llvm::FoldingSetNodeID &ID, QualType T)
Decl - This represents one declaration (or definition), e.g.
bool isChar16Type() const
ObjCObjectTypeBitfields ObjCObjectTypeBits
bool isLiteralType(const ASTContext &Ctx) const
Return true if this is a literal type (C++11 [basic.types]p10)
AutoType * getContainedAutoType() const
Get the AutoType whose type will be deduced for a variable with an initializer of this type...
bool isVoidPointerType() const
Represents a C++11 auto or C++14 decltype(auto) type.
bool isObjCQualifiedId() const
bool isEnumeralType() const
void Profile(llvm::FoldingSetNodeID &ID) const
A class providing a concrete implementation of ObjCObjectType, so as to not increase the footprint of...
void removeQualifiers(Qualifiers Q)
Remove the qualifiers from the given set from this set.
static bool classof(const Type *T)
std::string getAsString() const
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
TemplateSpecializationType(TemplateName T, const TemplateArgument *Args, unsigned NumArgs, QualType Canon, QualType Aliased)
QualType getPointeeType() const
The base class of the type hierarchy.
ObjCObjectType(enum Nonce_ObjCInterface)
bool isObjCQualifiedClassType() const
bool isElaboratedTypeSpecifier() const
Determine wither this type is a C++ elaborated-type-specifier.
DependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, unsigned NumArgs, const TemplateArgument *Args, QualType Canon)
unsigned getCVRQualifiers() const
Retrieve the set of CVR (const-volatile-restrict) qualifiers applied to this type.
void setObjCGCAttr(GC type)
Represents an array type, per C99 6.7.5.2 - Array Declarators.
void Profile(llvm::FoldingSetNodeID &ID)
const ObjCObjectType * getObjectType() const
Gets the type pointed to by this ObjC pointer.
AdjustedType(TypeClass TC, QualType OriginalTy, QualType AdjustedTy, QualType CanonicalPtr)
static bool classof(const Type *T)
void Profile(llvm::FoldingSetNodeID &ID)
bool isDecltypeAuto() const
bool isBooleanType() const
static clang::QualType getFromVoidPointer(void *P)
bool compatiblyIncludes(Qualifiers other) const
Determines if these qualifiers compatibly include another set.
QualType ElementType
The element type of the vector.
RefQualifierKind RefQualifier
const QualType * param_type_iterator
unsigned getIndex() const
bool getHasRegParm() const
bool isBlockPointerType() const
const ObjCObjectPointerType * getAsObjCQualifiedClassType() const
bool isCForbiddenLValueType() const
Determine whether expressions of the given type are forbidden from being lvalues in C...
bool isUnspecialized() const
Whether this type is unspecialized, meaning that is has no type arguments.
Qualifiers & operator+=(Qualifiers R)
bool isSpelledAsLValue() const
static inline::clang::ExtQuals * getFromVoidPointer(void *P)
static void Profile(llvm::FoldingSetNodeID &ID, QualType ET, const llvm::APInt &ArraySize, ArraySizeModifier SizeMod, unsigned TypeQuals)
bool hasUnsignedIntegerRepresentation() const
Determine whether this type has an unsigned integer representation of some sort, e.g., it is an unsigned integer type or a vector.
bool hasStrongOrWeakObjCLifetime() const
True if the lifetime is either strong or weak.
const llvm::APInt & getSize() const
bool isImage2dArrayMSAAT() const
void * getAsOpaquePtr() const
static Qualifiers fromOpaqueValue(unsigned opaque)
The noexcept specifier has a bad expression.
void removeObjCLifetime()
ObjCLifetime getObjCLifetime() const
Extra information about a function prototype.
CallingConv getCallConv() const
std::string getAsString() const
AutoTypeKeyword getKeyword() const
Qualifiers::ObjCLifetime getObjCLifetime() const
ArrayTypeBitfields ArrayTypeBits
bool isSpecialized() const
Whether this type is specialized, meaning that it has type arguments.
The "__interface" keyword.
TemplateTypeParmDecl * getDecl() const
bool hasAnyConsumedParams() const
void addAddressSpace(unsigned space)
QualType getOriginalType() const
bool isMemberDataPointerType() const
static Qualifiers fromFastMask(unsigned Mask)
static StringRef getTagTypeKindName(TagTypeKind Kind)
QualType(const Type *Ptr, unsigned Quals)
Describes how types, statements, expressions, and declarations should be printed. ...
void getAsStringInternal(std::string &Str, const PrintingPolicy &Policy) const
const BuiltinType * getAsPlaceholderType() const
Qualifiers getIndexTypeQualifiers() const
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
bool isObjCRetainableType() const
Represents the result of substituting a type for a template type parameter.
void Profile(llvm::FoldingSetNodeID &ID)
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have...
const Type * getUnqualifiedDesugaredType() const
Return the specified type with any "sugar" removed from the type, removing any typedefs, typeofs, etc., as well as any qualifiers.
The collection of all-type qualifiers we support.
bool isNoexceptExceptionSpec(ExceptionSpecificationType ESpecType)
static int getAccessorIdx(char c)
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
void Profile(llvm::FoldingSetNodeID &ID)
bool operator==(ExtInfo Other) const
QualType getPointeeType() const
unsigned getNumParams() const
RecordDecl - Represents a struct/union/class.
Visibility getVisibility() const
bool isOpenCLSpecificType() const
DependentTypeOfExprType(const ASTContext &Context, Expr *E)
const IdentifierInfo * getIdentifier() const
Retrieve the type named by the typename specifier as an identifier.
QualType getElementType() const
FunctionType::ExtInfo ExtInfo
One of these records is kept for each identifier that is lexed.
unsigned getIndexTypeCVRQualifiers() const
ExtInfo withProducesResult(bool producesResult) const
bool isScalarType() const
Defines the Linkage enumeration and various utility functions.
bool hasObjCPointerRepresentation() const
Whether this type can represent an objective pointer type for the purpose of GC'ability.
TagDecl * getAsTagDecl() const
Retrieves the TagDecl that this type refers to, either because the type is a TagType or because it is...
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
Represents a class type in Objective C.
Expr * getSizeExpr() const
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
ArrayRef< QualType > getParamTypes() const
bool isObjCARCImplicitlyUnretainedType() const
Determines if this type, which must satisfy isObjCLifetimeType(), is implicitly __unsafe_unretained r...
bool isReferenceType() const
bool isStructureOrClassType() const
bool isAnyPointerType() const
Defines the ExceptionSpecificationType enumeration and various utility functions. ...
bool isSugared() const
Returns whether this type directly provides sugar.
const TemplateArgument * getArgs() const
Retrieve the template arguments.
NoexceptResult
Result type of getNoexceptSpec().
void Profile(llvm::FoldingSetNodeID &ID)
static bool classof(const Type *T)
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
void setLocalFastQualifiers(unsigned Quals)
bool isChar32Type() const
const CXXRecordDecl * getPointeeCXXRecordDecl() const
If this is a pointer or reference to a RecordType, return the CXXRecordDecl that that type refers to...
ObjCObjectType::qual_iterator qual_iterator
An iterator over the qualifiers on the object type.
Base class that is common to both the ExtQuals and Type classes, which allows QualType to access the ...
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
unsigned getCVRQualifiers() const
static bool classof(const Type *T)
static bool classof(const Type *T)
Represents the result of substituting a set of types for a template type parameter pack...
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments for this type.
ObjCProtocolDecl *const * qual_iterator
const RecordType * getAsUnionType() const
NOTE: getAs*ArrayType are methods on ASTContext.
bool isLocalVolatileQualified() const
Determine whether this particular QualType instance has the "volatile" qualifier set, without looking through typedefs that may have added "volatile" at a different level.
static void Profile(llvm::FoldingSetNodeID &ID, QualType ElementType, unsigned NumElements, TypeClass TypeClass, VectorKind VecKind)
static int getPointAccessorIdx(char c)
unsigned getAsOpaqueValue() const
static unsigned getNumAddressingBits(ASTContext &Context, QualType ElementType, const llvm::APInt &NumElements)
Determine the number of bits required to address a member of.
ObjCProtocolDecl * getProtocol(unsigned I) const
Retrieve a qualifying protocol by index on the object type.
unsigned getRegParm() const
bool hasStrongOrWeakObjCLifetime() const
static void Profile(llvm::FoldingSetNodeID &ID, QualType Referencee, bool SpelledAsLValue)
bool isParamConsumed(unsigned I) const
void Profile(llvm::FoldingSetNodeID &ID)
StreamedQualTypeHelper(const QualType &T, const PrintingPolicy &Policy, const Twine &PlaceHolder)
QualType getUnderlyingType() const
ReferenceType(TypeClass tc, QualType Referencee, QualType CanonicalRef, bool SpelledAsLValue)
Expr * getUnderlyingExpr() const
FunctionType(TypeClass tc, QualType res, QualType Canonical, bool Dependent, bool InstantiationDependent, bool VariablyModified, bool ContainsUnexpandedParameterPack, ExtInfo Info)
Values of this type can be null.
void addRestrict()
Add the restrict qualifier to this QualType.
const Type & operator*() const
static bool classof(const Type *T)
unsigned getRegParmType() const
Type(TypeClass tc, QualType canon, bool Dependent, bool InstantiationDependent, bool VariablyModified, bool ContainsUnexpandedParameterPack)
bool isIntegralOrUnscopedEnumerationType() const
Determine whether this type is an integral or unscoped enumeration type.
QualType getCallResultType(ASTContext &Context) const
Determine the type of an expression that calls a function of this type.
bool hasNonFastQualifiers() const
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated...
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
An rvalue reference type, per C++11 [dcl.ref].
static bool classof(const Type *T)
param_type_range param_types() const
static bool classof(const Type *T)
An lvalue ref-qualifier was provided (&).
bool isSpecificPlaceholderType(unsigned K) const
Test for a specific placeholder type.
void addObjCGCAttr(GC type)
bool isFundamentalType() const
Tests whether the type is categorized as a fundamental type.
A convenient class for passing around template argument information.
Qualifiers withoutObjCGCAttr() const
void setRestrict(bool flag)
static bool classof(const Type *T)
LinkageInfo getLinkageAndVisibility() const
Determine the linkage and visibility of this type.
QualType getBaseType() const
Gets the base type of this object type.
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
QualType getReturnType() const
The "struct" keyword introduces the elaborated-type-specifier.
const TemplateArgument & getArg(unsigned Idx) const
Retrieve a specific template argument as a type.
UnresolvedUsingTypenameDecl * getDecl() const
TypeWithKeyword(ElaboratedTypeKeyword Keyword, TypeClass tc, QualType Canonical, bool Dependent, bool InstantiationDependent, bool VariablyModified, bool ContainsUnexpandedParameterPack)
Whether values of this type can be null is (explicitly) unspecified.
Visibility
Describes the different kinds of visibility that a declaration may have.
SplitQualType getSplitUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
bool isObjCLifetimeType() const
Returns true if objects of this type have lifetime semantics under ARC.
Represents a typeof (or typeof) expression (a GCC extension).
void addCVRQualifiers(unsigned mask)
Expr * getNoexceptExpr() const
unsigned getNumProtocols() const
Return the number of qualifying protocols on the object type.
RecordDecl * getDecl() const
QualType withoutLocalFastQualifiers() const
ObjCInterfaceDecl * getInterface() const
Gets the interface declaration for this object type, if the base type really is an interface...
bool isUnsignedIntegerType() const
Return true if this is an integer type that is unsigned, according to C99 6.2.5p6 [which returns true...
void Profile(llvm::FoldingSetNodeID &ID)
const ObjCObjectType * getAsObjCInterfaceType() const
Values of this type can never be null.
static Qualifiers removeCommonQualifiers(Qualifiers &L, Qualifiers &R)
Returns the common set of qualifiers while removing them from the given sets.
static bool classof(const Type *T)
TemplateTypeParmDecl * TTPDecl
void addQualifiers(Qualifiers Q)
Add the qualifiers from the given set to this set.
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
TypeClass getTypeClass() const
bool isStructureType() const
Represents an Objective-C protocol declaration.
bool isObjCIndependentClassType() const
bool isIncompleteType(NamedDecl **Def=nullptr) const
Types are partitioned into 3 broad categories (C99 6.2.5p1): object types, function types...
QualType withVolatile() const
static bool classof(const Type *T)
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool appendSpaceIfNonEmpty=false) const
const TemplateSpecializationType * getInjectedTST() const
friend Qualifiers operator+(Qualifiers L, Qualifiers R)
Represents an ObjC class declaration.
bool isExtVectorType() const
static void * getAsVoidPointer(clang::QualType P)
static void PrintTemplateArgumentList(raw_ostream &OS, const TemplateArgument *Args, unsigned NumArgs, const PrintingPolicy &Policy, bool SkipBrackets=false)
Print a template argument list, including the '<' and '>' enclosing the template arguments...
friend bool operator==(const QualType &LHS, const QualType &RHS)
Indicate whether the specified types and qualifiers are identical.
detail::InMemoryDirectory::const_iterator I
is ARM Neon polynomial vector
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
bool operator!=(ExtInfo Other) const
bool isFromAST() const
Whether this type comes from an AST file.
QualType getCanonicalTypeInternal() const
void setFastQualifiers(unsigned mask)
static void Profile(llvm::FoldingSetNodeID &ID, const TemplateTypeParmType *Replaced, QualType Replacement)
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
ObjCProtocolDecl * getProtocol(unsigned I) const
Fetch a protocol by index.
Represents an extended vector type where either the type or size is dependent.
This object can be modified without requiring retains or releases.
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
bool isLinkageValid() const
True if the computed linkage is valid.
Defines the clang::Visibility enumeration and various utility functions.
bool isImage2dMSAATDepth() const
static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name)
static bool classof(const Type *T)
const ArrayType * getAsArrayTypeUnsafe() const
A variant of getAs<> for array types which silently discards qualifiers from the outermost type...
EnumDecl * getDecl() const
Represents a K&R-style 'int foo()' function, which has no information available about its arguments...
Provides definitions for the various language-specific address spaces.
void Profile(llvm::FoldingSetNodeID &ID)
llvm::iterator_range< qual_iterator > qual_range
QualType getValueType() const
Gets the type contained by this atomic type, i.e.
QualType getInjectedSpecializationType() const
bool isObjCUnqualifiedId() const
const Type * getBaseType() const
ExtInfo getExtInfo() const
const ArrayType * castAsArrayTypeUnsafe() const
A variant of castAs<> for array type which silently discards qualifiers from the outermost type...
void Profile(llvm::FoldingSetNodeID &ID)
A little helper class used to produce diagnostics.
CanQualType getCanonicalTypeUnqualified() const
ExtQuals(const Type *baseType, QualType canon, Qualifiers quals)
Optional< ArrayRef< QualType > > getObjCSubstitutions(const DeclContext *dc) const
Retrieve the set of substitutions required when accessing a member of the Objective-C receiver type t...
QualType getParamType(unsigned i) const
Represents a prototype with parameter type info, e.g.
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
QualType getAliasedType() const
Get the aliased type, if this is a specialization of a type alias template.
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
bool isFloatingPoint() const
const Type * operator->() const
qual_iterator qual_end() const
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
param_type_iterator param_type_begin() const
bool isUnspecializedAsWritten() const
Determine whether this object type is "unspecialized" as written, meaning that it has no type argumen...
ArraySizeModifier
Capture whether this is a normal array (e.g.
void addObjCLifetime(ObjCLifetime type)
ID
Defines the set of possible language-specific address spaces.
bool isMoreQualifiedThan(QualType Other) const
Determine whether this type is more qualified than the other given type, requiring exact equality for...
bool hasFastQualifiers() const
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
bool isFunctionPointerType() const
void Profile(llvm::FoldingSetNodeID &ID)
bool hasLocalQualifiers() const
Determine whether this particular QualType instance has any qualifiers, without looking through any t...
bool hasSizedVLAType() const
Whether this type involves a variable-length array type with a definite size.
bool isRealFloatingType() const
Floating point categories.
bool isObjCInertUnsafeUnretainedType() const
Was this type written with the special inert-in-MRC __unsafe_unretained qualifier?
static void * getAsVoidPointer(::clang::ExtQuals *P)
bool isSignedInteger() const
bool isKindOfType() const
Whether this is a "__kindof" type.
Represents an array type in C++ whose size is a value-dependent expression.
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
static bool classof(const Type *T)
RecordType(TypeClass TC, RecordDecl *D)
bool isImage2dMSAAT() const
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
static bool classof(const Type *T)
const Type * getTypePtrOrNull() const
Qualifiers::GC getObjCGCAttr() const
bool isImage2dDepthT() const
QualType getSuperClassType() const
Retrieve the type of the superclass of this object type.
QualType getPointeeType() const
bool isUndeducedType() const
Determine whether this type is an undeduced type, meaning that it somehow involves a C++11 'auto' typ...
Expr - This represents one expression.
static void getAsStringInternal(SplitQualType split, std::string &out, const PrintingPolicy &policy)
static bool classof(const Type *T)
The "typename" keyword precedes the qualified type name, e.g., typename T::type.
static unsigned getMaxSizeBits(ASTContext &Context)
Determine the maximum number of active bits that an array's size can require, which limits the maximu...
QualType desugar() const
Remove a single level of sugar.
bool isAnyComplexType() const
static Kind getNullabilityAttrKind(NullabilityKind kind)
Retrieve the attribute kind corresponding to the given nullability kind.
bool isObjCClassType() const
Declaration of a template type parameter.
Internal representation of canonical, dependent decltype(expr) types.
bool hasObjCGCAttr() const
bool hasCVRQualifiers() const
friend bool operator!=(const QualType &LHS, const QualType &RHS)
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
bool isLocalConstQualified() const
Determine whether this particular QualType instance has the "const" qualifier set, without looking through typedefs that may have added "const" at a different level.
bool isAtomicType() const
bool isUnsignedInteger() const
void Profile(llvm::FoldingSetNodeID &ID)
void setAddressSpace(unsigned space)
ObjCSubstitutionContext
The kind of type we are substituting Objective-C type arguments into.
bool isObjCGCWeak() const
true when Type is objc's weak.
static void print(SplitQualType split, raw_ostream &OS, const PrintingPolicy &policy, const Twine &PlaceHolder)
llvm::iterator_range< param_type_iterator > param_type_range
Expr * getUnderlyingExpr() const
bool isVariableArrayType() const
bool isImage2dArrayMSAATDepth() const
bool hasObjCLifetime() const
QualType getNamedType() const
Retrieve the type named by the qualified-id.
ExtProtoInfo getExtProtoInfo() const
ExtProtoInfo withExceptionSpec(const ExceptionSpecInfo &O)
static bool classof(const Type *T)
void removeFastQualifiers(unsigned mask)
void Profile(llvm::FoldingSetNodeID &ID)
bool isFloatingType() const
void Profile(llvm::FoldingSetNodeID &ID)
ArrayType(TypeClass tc, QualType et, QualType can, ArraySizeModifier sm, unsigned tq, bool ContainsUnexpandedParameterPack)
Represents a C++ template name within the type system.
Represents the type decltype(expr) (C++11).
const bool * ConsumedParameters
void removeLocalVolatile()
bool isFunctionNoProtoType() const
unsigned getTypeQuals() const
QualType getDesugaredType(const ASTContext &Context) const
Return the specified type with any "sugar" removed from the type.
There is no noexcept specifier.
bool isObjCIdType() const
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
static inline::clang::Type * getFromVoidPointer(void *P)
SourceLocation getAttributeLoc() const
void print(raw_ostream &OS, const PrintingPolicy &Policy, const Twine &PlaceHolder=Twine()) const
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
static bool classof(const Type *T)
bool hasTrailingReturn() const
Qualifiers Quals
The local qualifiers.
bool isObjCQualifiedIdType() const
True if this is equivalent to 'id.
static bool classof(const Type *T)
SourceLocation getRBracketLoc() const
A helper class for Type nodes having an ElaboratedTypeKeyword.
QualType withFastQualifiers(unsigned TQs) const
Represents a GCC generic vector type.
An lvalue reference type, per C++11 [dcl.ref].
bool isCurrentInstantiation() const
True if this template specialization type matches a current instantiation in the context in which it ...
class LLVM_ALIGNAS(8) TemplateSpecializationType unsigned NumArgs
Represents a type template specialization; the template must be a class template, a type alias templa...
llvm::iterator_range< qual_iterator > qual_range
QualType getElementType() const
bool isStrictSupersetOf(Qualifiers Other) const
Determine whether this set of qualifiers is a strict superset of another set of qualifiers, not considering qualifier compatibility.
bool isComplexIntegerType() const
The result type of a method or function.
static bool classof(const Type *T)
void removeLocalCVRQualifiers(unsigned Mask)
unsigned getLocalCVRQualifiers() const
Retrieve the set of CVR (const-volatile-restrict) qualifiers local to this particular QualType instan...
bool IsEnumDeclComplete(EnumDecl *ED)
Check if the given decl is complete.
bool isUnsignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is unsigned or an enumeration types whose underlying ...
void removeCVRQualifiers(unsigned mask)
QualType getReplacementType() const
Gets the type that was substituted for the template parameter.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
bool isTemplateTypeParmType() const
bool isObjectType() const
Determine whether this type is an object type.
bool hasObjCLifetime() const
bool isEmptyWhenPrinted(const PrintingPolicy &Policy) const
SourceRange getBracketsRange() const
bool hasUnnamedOrLocalType() const
Whether this type is or contains a local or unnamed type.
static void Profile(llvm::FoldingSetNodeID &ID, QualType Pointee)
unsigned getLocalFastQualifiers() const
bool getNoReturnAttr() const
Determine whether this function type includes the GNU noreturn attribute.
static void Profile(llvm::FoldingSetNodeID &ID, ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType NamedType)
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
bool isDependentSizedArrayType() const
CXXRecordDecl * getMostRecentCXXRecordDecl() const
static void Profile(llvm::FoldingSetNodeID &ID, QualType T)
There is no lifetime qualification on this type.
exception_iterator exception_begin() const
ExtInfo withRegParm(unsigned RegParm) const
bool hasNoexceptExceptionSpec() const
Return whether this function has a noexcept exception spec.
static void Profile(llvm::FoldingSetNodeID &ID, QualType ResultType, ExtInfo Info)
is AltiVec 'vector Pixel'
Assigning into this object requires the old value to be released and the new value to be retained...
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
not a target-specific vector type
ExceptionSpecificationType Type
The kind of exception specification this is.
static bool classof(const Type *T)
static bool classof(const Type *T)
void setVolatile(bool flag)
const char * getNameAsCString(const PrintingPolicy &Policy) const
Encodes a location in the source.
bool hasIntegerRepresentation() const
Determine whether this type has an integer representation of some sort, e.g., it is an integer type o...
void addVolatile()
Add the volatile type qualifier to this QualType.
bool isObjCIdOrClassType() const
True if this is equivalent to the 'id' or 'Class' type,.
Sugar for parentheses used when specifying types.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums...
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Visibility getVisibility() const
Determine the visibility of this type.
const TemplateArgument * iterator
QualType getElementType() const
QualType withCVRQualifiers(unsigned CVR) const
RefQualifierKind getRefQualifier() const
Retrieve the ref-qualifier associated with this function type.
SourceLocation getLBracketLoc() const
Represents typeof(type), a GCC extension.
Interfaces are the core concept in Objective-C for object oriented design.
The maximum supported address space number.
static bool classof(const Type *T)
bool isComplexType() const
isComplexType() does not include complex integers (a GCC extension).
bool isBuiltinType() const
Helper methods to distinguish type categories.
bool isConstant(ASTContext &Ctx) const
static bool classof(const Type *T)
TagDecl - Represents the declaration of a struct/union/class/enum.
bool isConstantSizeType() const
Return true if this is not a variable sized type, according to the rules of C99 6.7.5p3.
static bool isPlaceholderTypeKind(Kind K)
Determines whether the given kind corresponds to a placeholder type.
static bool classof(const Type *T)
void Profile(llvm::FoldingSetNodeID &ID)
static QualType getUnderlyingType(const SubRegion *R)
bool isObjCUnqualifiedIdOrClass() const
static void Profile(llvm::FoldingSetNodeID &ID, QualType T)
VectorKind getVectorKind() const
unsigned getAddressSpace() const
QualType withConst() const
bool isObjCBuiltinType() const
bool isObjCClassOrClassKindOfType() const
Whether the type is Objective-C 'Class' or a __kindof type of an Class type, e.g., __kindof Class <NSCopying>.
bool isVisibilityExplicit() const
Return true if the visibility was explicitly set is the code.
const TemplateArgument * getArgBuffer() const
void Profile(llvm::FoldingSetNodeID &ID)
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
static void Profile(llvm::FoldingSetNodeID &ID, const Type *BaseType, Qualifiers Quals)
No ref-qualifier was provided.
ExtInfo withNoReturn(bool noReturn) const
void AddTaggedVal(intptr_t V, DiagnosticsEngine::ArgumentKind Kind) const
const Type * getArrayElementTypeNoTypeQual() const
If this is an array type, return the element type of the array, potentially with type qualifiers miss...
bool isObjCBoxableRecordType() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
Represents a canonical, potentially-qualified type.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
FunctionDecl * getExceptionSpecTemplate() const
If this function type has an uninstantiated exception specification, this is the function whose excep...
bool hasConstFields() const
AttributedTypeBitfields AttributedTypeBits
SplitQualType getSplitDesugaredType() const
bool isImage2dArrayDepthT() const
static void Profile(llvm::FoldingSetNodeID &ID, QualType Deduced, AutoTypeKeyword Keyword, bool IsDependent)
ExceptionSpecInfo(ExceptionSpecificationType EST)
const Type * getBaseElementTypeUnsafe() const
Get the base element type of this type, potentially discarding type qualifiers.
is AltiVec 'vector bool ...'
bool acceptsObjCTypeParams() const
Determines if this is an ObjC interface type that may accept type parameters.
bool isSpecializedAsWritten() const
Determine whether this object type was written with type arguments.
qual_iterator qual_begin() const
RefQualifierKind
The kind of C++11 ref-qualifier associated with a function type.
bool isReserveIDT() const
bool isMemberDataPointer() const
Returns true if the member type (i.e.
TypedefNameDecl * getDecl() const
unsigned getNumProtocols() const
Return the number of qualifying protocols in this interface type, or 0 if there are none...
bool isObjCQualifiedClassType() const
True if this is equivalent to 'Class.
SourceLocation getBegin() const
const T * castAs() const
Member-template castAs<specific type>.
static bool classof(const Type *T)
qual_iterator qual_begin() const
const IdentifierInfo * getIdentifier() const
Qualifiers & operator-=(Qualifiers R)
bool isVectorType() const
static bool isVectorSizeTooLarge(unsigned NumElements)
bool isPromotableIntegerType() const
More type predicates useful for type checking/promotion.
bool isMemberFunctionPointerType() const
An rvalue ref-qualifier was provided (&&).
Assigning into this object requires a lifetime extension.
void addFastQualifiers(unsigned TQs)
bool isVolatileQualified() const
Determine whether this type is volatile-qualified.
static QualType getFromOpaquePtr(const void *Ptr)
void setVariablyModified(bool VM=true)
bool isAccessorWithinNumElements(char c) const
bool isImage1dArrayT() const
void Profile(llvm::FoldingSetNodeID &ID)
bool isObjCQualifiedClass() const
Represents a pointer type decayed from an array or function type.
bool isFunctionProtoType() const
The injected class name of a C++ class template or class template partial specialization.
QualType getPointeeType() const
Represents a pack expansion of types.
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments of this object type as they were written.
Defines various enumerations that describe declaration and type specifiers.
Expr * getSizeExpr() const
const char * getTypeClassName() const
Base class for declarations which introduce a typedef-name.
friend bool operator!=(SplitQualType a, SplitQualType b)
Represents a template argument.
static bool classof(const Type *T)
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons...
TagTypeKind
The kind of a tag type.
static const Type * getElementType(const Expr *BaseExpr)
not evaluated yet, for special member function
A qualifier set is used to build a set of qualifiers.
Qualifiers withoutObjCLifetime() const
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
bool isAggregateType() const
Determines whether the type is a C++ aggregate type or C aggregate or union type. ...
void setContainsUnexpandedParameterPack(bool PP=true)
static bool classof(const Type *T)
TypeWithKeywordBitfields TypeWithKeywordBits
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
void removeLocalFastQualifiers()
bool hasLocalNonFastQualifiers() const
Determine whether this particular QualType instance has any "non-fast" qualifiers, e.g., those that are stored in an ExtQualType instance.
static bool classof(const Type *T)
static bool classof(const Type *T)
QualType IgnoreParens() const
Returns the specified type after dropping any outer-level parentheses.
Reads an AST files chain containing the contents of a translation unit.
bool getProducesResult() const
bool hasNonTrivialObjCLifetime() const
True if the lifetime is neither None or ExplicitNone.
TypedefType(TypeClass tc, const TypedefNameDecl *D, QualType can)
QualType getEquivalentType() const
bool isParameterPack() const
bool isStandardLayoutType() const
Test if this type is a standard-layout type.
Represents a dependent using declaration which was marked with typename.
The "union" keyword introduces the elaborated-type-specifier.
CallingConv getCC() const
const Type * strip(QualType type)
Collect any qualifiers on the given type and return an unqualified type.
void Profile(llvm::FoldingSetNodeID &ID)
param_type_iterator param_type_end() const
The "class" keyword introduces the elaborated-type-specifier.
friend raw_ostream & operator<<(raw_ostream &OS, const StreamedQualTypeHelper &SQT)
ReferenceTypeBitfields ReferenceTypeBits
EnumDecl - Represents an enum.
FunctionType::ExtInfo getFunctionExtInfo(const Type &t)
void Profile(llvm::FoldingSetNodeID &ID)
QualType(const ExtQuals *Ptr, unsigned Quals)
detail::InMemoryDirectory::const_iterator E
A pointer to member type per C++ 8.3.3 - Pointers to members.
QualType getModifiedType() const
void setCVRQualifiers(unsigned mask)
static void Profile(llvm::FoldingSetNodeID &ID, QualType Orig, QualType New)
bool isLValueReferenceType() const
static void Profile(llvm::FoldingSetNodeID &ID, QualType Pattern, Optional< unsigned > NumExpansions)
bool isCanonicalAsParam() const
void Profile(llvm::FoldingSetNodeID &ID)
static bool classof(const Type *T)
void addConsistentQualifiers(Qualifiers qs)
Add the qualifiers from the given set to this set, given that they don't conflict.
const RecordType * getAsStructureType() const
bool isWideCharType() const
Defines the Diagnostic-related interfaces.
bool isRValueReferenceType() const
bool isVisibilityExplicit() const
void removeCVRQualifiers()
QualType getPointeeType() const
Gets the type pointed to by this ObjC pointer.
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
Represents a pointer to an Objective C object.
static bool classof(const Type *T)
bool isObjCObjectType() const
bool operator!=(Qualifiers Other) const
FunctionTypeBitfields FunctionTypeBits
QualType getLocalUnqualifiedType() const
Return this type with all of the instance-specific qualifiers removed, but without removing any quali...
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
const QualType * exception_iterator
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
qual_iterator qual_end() const
Complex values, per C99 6.2.5p11.
Location wrapper for a TemplateArgument.
static bool classof(const Type *T)
static bool classof(const Type *T)
bool isObjCNSObjectType() const
bool TypeAlias
Whether this template specialization type is a substituted type alias.
QualType withExactLocalFastQualifiers(unsigned TQs) const
const T * getAs() const
Member-template getAs<specific type>'.
AutoTypeBitfields AutoTypeBits
unsigned getTypeQuals() const
bool isAddressSpaceOverlapping(const PointerType &other) const
Returns true if address spaces of pointers overlap.
QualType getCanonicalType() const
static bool classof(const Type *T)
bool isSpecifierType() const
Returns true if this type can be represented by some set of type specifiers.
ObjCInterfaceDecl * getInterfaceDecl() const
If this pointer points to an Objective @interface type, gets the declaration for that interface...
const ObjCObjectType * getAsObjCQualifiedInterfaceType() const
void Profile(llvm::FoldingSetNodeID &ID)
static bool classof(const Type *T)
bool isObjCQualifiedIdType() const
VectorTypeBitfields VectorTypeBits
static bool classof(const Type *T)
bool isFunctionType() const
NestedNameSpecifier * getQualifier() const
ExtVectorType - Extended vector type.
QualType getInnerType() const
The noexcept specifier evaluates to false.
Base for LValueReferenceType and RValueReferenceType.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
QualType desugar() const
Remove a single level of sugar.
unsigned getAddressSpace() const
ExtInfo(bool noReturn, bool hasRegParm, unsigned regParm, CallingConv cc, bool producesResult)
QualType withRestrict() const
bool isRestrictQualified() const
Determine whether this type is restrict-qualified.
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
static bool classof(const Type *T)
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream...
QualType getPointeeType() const
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Linkage getLinkage() const
Determine the linkage of this type.
bool hasNonTrivialObjCLifetime() const
bool isObjCGCStrong() const
true when Type is objc's strong.
const Type * getClass() const
Reading or writing from this object requires a barrier call.
Expr * NoexceptExpr
Noexcept expression, if this is EST_ComputedNoexcept.
static void Profile(llvm::FoldingSetNodeID &ID, QualType Pointee, const Type *Class)
An attributed type is a type to which a type attribute has been applied.
bool hasAddressSpace() const
bool isBlockCompatibleObjCPointerType(ASTContext &ctx) const
bool isObjCClassType() const
True if this is equivalent to the 'Class' type, i.e.
bool isCARCBridgableType() const
Determine whether the given type T is a "bridgeable" C type.
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
std::pair< const Type *, Qualifiers > asPair() const
Represents a C++ struct/union/class.
void removeLocalRestrict()
bool hasQualifiers() const
Return true if the set contains any qualifiers.
bool isObjCObjectPointerType() const
bool isPlaceholderType() const
Test for a type which does not represent an actual type-system type but is instead used as a placehol...
static bool classof(const Type *T)
Represents a C array with an unspecified size.
bool isObjCUnqualifiedClass() const
SplitQualType(const Type *ty, Qualifiers qs)
void removeFastQualifiers()
bool isImage2dArrayT() const
bool isCompoundType() const
Tests whether the type is categorized as a compound type.
static bool anyDependentTemplateArguments(const TemplateArgumentLoc *Args, unsigned NumArgs, bool &InstantiationDependent)
Determine whether any of the given template arguments are dependent.
The parameter type of a method or function.
The width of the "fast" qualifier mask.
ArraySizeModifier getSizeModifier() const
ElaboratedTypeKeyword getKeyword() const
bool hasDynamicExceptionSpec() const
Return whether this function has a dynamic (throw) exception spec.
bool isOverloadableType() const
Determines whether this is a type for which one can define an overloaded operator.
void Profile(llvm::FoldingSetNodeID &ID)
unsigned kind
All of the diagnostics that can be emitted by the frontend.
bool isImage1dBufferT() const
This class is used for builtin types like 'int'.
exception_iterator exception_end() const
Writes an AST file containing the contents of a translation unit.
SourceLocation getLBracketLoc() const
QualType getAdjustedType() const
void Profile(llvm::FoldingSetNodeID &ID)
static bool classof(const Type *T)
void removeLocalFastQualifiers(unsigned Mask)
QualType getPattern() const
Retrieve the pattern of this pack expansion, which is the type that will be repeatedly instantiated w...
bool isSpecializedAsWritten() const
Whether this type is specialized, meaning that it has type arguments.
QualType getDecayedType() const
static Qualifiers fromCVRMask(unsigned CVR)
QualType getPointeeTypeAsWritten() const
bool getHasRegParm() const
TagDecl * getDecl() const
bool isObjCIndirectLifetimeType() const
bool isIncompleteArrayType() const
SourceLocation getRBracketLoc() const
Qualifiers getQualifiers() const
void Profile(llvm::FoldingSetNodeID &ID) const
QualType getElementType() const
QualType getElementType() const
static void Profile(llvm::FoldingSetNodeID &ID, QualType Element)
bool hasQualifiers() const
Determine whether this type has any qualifiers.
SplitQualType getSingleStepDesugaredType() const
RecordType(const RecordDecl *D)
bool hasExceptionSpec() const
Return whether this function has any kind of exception spec.
static void Profile(llvm::FoldingSetNodeID &ID, QualType ET, ArraySizeModifier SizeMod, unsigned TypeQuals)
static SimpleType getSimplifiedValue(::clang::QualType Val)
We can encode up to four bits in the low bits of a type pointer, but there are many more type qualifi...
IdentifierInfo * getIdentifier() const
static StringRef getNameForCallConv(CallingConv CC)
bool isObjCARCBridgableType() const
Determine whether the given type T is a "bridgable" Objective-C type, which is either an Objective-C ...
BuiltinTypeBitfields BuiltinTypeBits
static int getNumericAccessorIdx(char c)
bool isInterfaceType() const
A trivial tuple used to represent a source range.
VectorType(QualType vecType, unsigned nElements, QualType canonType, VectorKind vecKind)
static void * getAsVoidPointer(::clang::Type *P)
NamedDecl - This represents a decl with a name.
bool isNonOverloadPlaceholderType() const
Determines whether this type is a placeholder type other than Overload.
void addFastQualifiers(unsigned mask)
class LLVM_ALIGNAS(LLVM_PTR_SIZE) Stmt
Stmt - This represents one statement.
StringRef getName(const PrintingPolicy &Policy) const
Represents a C array with a specified size that is not an integer-constant-expression.
bool isObjCIdOrObjectKindOfType(const ASTContext &ctx, const ObjCObjectType *&bound) const
Whether the type is Objective-C 'id' or a __kindof type of an object type, e.g., __kindof NSView * or...
bool isArithmeticType() const
No keyword precedes the qualified type name.
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char, signed char, short, int, long..], or an enum decl which has a signed representation.
void Profile(llvm::FoldingSetNodeID &ID)
bool isConstQualified() const
Determine whether this type is const-qualified.
bool hasSignedIntegerRepresentation() const
Determine whether this type has an signed integer representation of some sort, e.g., it is an signed integer type or a vector.
bool isUnspecializedAsWritten() const
Determine whether this object type is "unspecialized" as written, meaning that it has no type argumen...
bool isNull() const
Return true if this QualType doesn't point to a type yet.
const ObjCObjectPointerType * getAsObjCInterfacePointerType() const
friend bool operator==(SplitQualType a, SplitQualType b)
bool isObjCIdType() const
True if this is equivalent to the 'id' type, i.e.
The noexcept specifier is dependent.
bool isSugared() const
Returns whether this type directly provides sugar.
static void Profile(llvm::FoldingSetNodeID &ID, UnresolvedUsingTypenameDecl *D)
void removeAddressSpace()
Optional< NullabilityKind > getNullability(const ASTContext &context) const
Determine the nullability of the given type.
QualType getSingleStepDesugaredType(const ASTContext &Context) const
Return the specified type with one level of "sugar" removed from the type.
QualifierCollector(Qualifiers Qs=Qualifiers())
The "__interface" keyword introduces the elaborated-type-specifier.
Optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
ArrayRef< QualType > exceptions() const
The superclass of a type.
Represents the canonical version of C arrays with a specified constant size.
bool isIntegralType(ASTContext &Ctx) const
Determine whether this type is an integral type.
ExceptionSpecInfo ExceptionSpec
static bool classof(const Type *T)
A class which abstracts out some details necessary for making a call.
bool isObjCQualifiedInterfaceType() const
static bool classof(const Type *T)
unsigned getNumArgs() const
Retrieve the number of template arguments.
ScalarTypeKind getScalarTypeKind() const
Given that this is a scalar type, classify it.
bool hasPointerRepresentation() const
Whether this type is represented natively as a pointer.
static void Profile(llvm::FoldingSetNodeID &ID, unsigned Depth, unsigned Index, bool ParameterPack, TemplateTypeParmDecl *TTPDecl)
void Profile(llvm::FoldingSetNodeID &ID)
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
const ObjCObjectPointerType * getAsObjCQualifiedIdType() const
StreamedQualTypeHelper stream(const PrintingPolicy &Policy, const Twine &PlaceHolder=Twine()) const
void Profile(llvm::FoldingSetNodeID &ID) const
bool hasAddressSpace() const
bool isAddressSpaceSupersetOf(Qualifiers other) const
Returns true if this address space is a superset of the other one.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
bool isPointerType() const
unsigned getNumExceptions() const
bool isIncompleteOrObjectType() const
Return true if this is an incomplete or object type, in other words, not a function type...
QualType getDeducedType() const
Get the type deduced for this auto type, or null if it's either not been deduced or was deduced to a ...