class QualType
Declaration
class QualType { /* full declaration omitted */ };
Description
A (possibly-)qualified type. For efficiency, we don't store CV-qualified types as nodes on their own: instead each reference to a type stores the qualifiers. This greatly reduces the number of nodes we need to allocate for types (for example we only need one for 'int', 'const int', 'volatile int', 'const volatile int', etc). As an added efficiency bonus, instead of making this a pair, we just store the two bits we care about in the low bits of the pointer. To handle the packing/unpacking, we make QualType be a simple wrapper class that acts like a smart pointer. A third bit indicates whether there are extended qualifiers present, in which case the pointer points to a special structure.
Declared at: clang/include/clang/AST/Type.h:731
Member Variables
- private llvm::PointerIntPair< llvm::PointerUnion<const Type*, const ExtQuals*>, Qualifiers::FastWidth> Value
Method Overview
- private static clang::QualType IgnoreParens(clang::QualType T)
- public clang::QualType IgnoreParens() const
- public void Profile(llvm::FoldingSetNodeID & ID) const
- public QualType()
- public QualType(const clang::Type * Ptr, unsigned int Quals)
- public QualType(const clang::ExtQuals * Ptr, unsigned int Quals)
- public void addConst()
- public void addFastQualifiers(unsigned int TQs)
- public void addRestrict()
- public void addVolatile()
- public void dump(const char * s) const
- public void dump() const
- public void dump(llvm::raw_ostream & OS, const clang::ASTContext & Context) const
- public inline clang::LangAS getAddressSpace() const
- public void * getAsOpaquePtr() const
- public static std::string getAsString(const clang::Type * ty, clang::Qualifiers qs, const clang::PrintingPolicy & Policy)
- public std::string getAsString(const clang::PrintingPolicy & Policy) const
- public std::string getAsString() const
- public static std::string getAsString(clang::SplitQualType split, const clang::PrintingPolicy & Policy)
- public void getAsStringInternal(std::string & Str, const clang::PrintingPolicy & Policy) const
- public static void getAsStringInternal(clang::SplitQualType split, std::string & out, const clang::PrintingPolicy & policy)
- public static void getAsStringInternal(const clang::Type * ty, clang::Qualifiers qs, std::string & out, const clang::PrintingPolicy & policy)
- public clang::QualType getAtomicUnqualifiedType() const
- public const clang::IdentifierInfo * getBaseTypeIdentifier() const
- public unsigned int getCVRQualifiers() const
- public clang::QualType getCanonicalType() const
- private const clang::ExtQualsTypeCommonBase * getCommonPtr() const
- private static clang::QualType getDesugaredType(clang::QualType T, const clang::ASTContext & Context)
- public clang::QualType getDesugaredType(const clang::ASTContext & Context) const
- private const clang::ExtQuals * getExtQualsUnsafe() const
- public static clang::QualType getFromOpaquePtr(const void * Ptr)
- public unsigned int getLocalCVRQualifiers() const
- public unsigned int getLocalFastQualifiers() const
- public clang::Qualifiers getLocalQualifiers() const
- public clang::QualType getLocalUnqualifiedType() const
- public clang::QualType getNonLValueExprType(const clang::ASTContext & Context) const
- public clang::QualType getNonPackExpansionType() const
- public clang::QualType getNonReferenceType() const
- public inline Qualifiers::GC getObjCGCAttr() const
- public Qualifiers::ObjCLifetime getObjCLifetime() const
- public clang::Qualifiers getQualifiers() const
- public clang::QualType getSingleStepDesugaredType(const clang::ASTContext & Context) const
- private static clang::QualType getSingleStepDesugaredTypeImpl(clang::QualType type, const clang::ASTContext & C)
- public clang::SplitQualType getSplitDesugaredType() const
- private static clang::SplitQualType getSplitDesugaredType(clang::QualType T)
- public inline clang::SplitQualType getSplitUnqualifiedType() const
- private static clang::SplitQualType getSplitUnqualifiedTypeImpl(clang::QualType type)
- public const clang::Type * getTypePtr() const
- public const clang::Type * getTypePtrOrNull() const
- private const clang::Type * getTypePtrUnsafe() const
- public inline clang::QualType getUnqualifiedType() const
- public inline bool hasAddressSpace() const
- public bool hasLocalNonFastQualifiers() const
- public bool hasLocalQualifiers() const
- public bool hasNonTrivialObjCLifetime() const
- private static bool hasNonTrivialToPrimitiveCopyCUnion(const clang::RecordDecl * RD)
- public bool hasNonTrivialToPrimitiveCopyCUnion() const
- public bool hasNonTrivialToPrimitiveDefaultInitializeCUnion() const
- private static bool hasNonTrivialToPrimitiveDefaultInitializeCUnion(const clang::RecordDecl * RD)
- public bool hasNonTrivialToPrimitiveDestructCUnion() const
- private static bool hasNonTrivialToPrimitiveDestructCUnion(const clang::RecordDecl * RD)
- public bool hasQualifiers() const
- public bool hasStrongOrWeakObjCLifetime() const
- public bool isAddressSpaceOverlapping(clang::QualType T) const
- public bool isAtLeastAsQualifiedAs(clang::QualType Other) const
- public bool isCForbiddenLValueType() const
- public bool isCXX11PODType(const clang::ASTContext & Context) const
- public bool isCXX98PODType(const clang::ASTContext & Context) const
- public bool isCanonical() const
- public bool isCanonicalAsParam() const
- public bool isConstQualified() const
- public bool isConstant(const clang::ASTContext & Ctx) const
- private static bool isConstant(clang::QualType T, const clang::ASTContext & Ctx)
- public clang::QualType::DestructionKind isDestructedType() const
- private static clang::QualType::DestructionKind isDestructedTypeImpl(clang::QualType type)
- public bool isLocalConstQualified() const
- public bool isLocalRestrictQualified() const
- public bool isLocalVolatileQualified() const
- public bool isMoreQualifiedThan(clang::QualType Other) const
- public clang::QualType::PrimitiveCopyKind isNonTrivialToPrimitiveCopy() const
- public clang::QualType::PrimitiveDefaultInitializeKind isNonTrivialToPrimitiveDefaultInitialize() const
- public clang::QualType::PrimitiveCopyKind isNonTrivialToPrimitiveDestructiveMove() const
- public bool isNonWeakInMRRWithObjCWeak(const clang::ASTContext & Context) const
- public bool isNull() const
- public bool isObjCGCStrong() const
- public bool isObjCGCWeak() const
- public bool isPODType(const clang::ASTContext & Context) const
- public bool isRestrictQualified() const
- public bool isTrivialType(const clang::ASTContext & Context) const
- public bool isTriviallyCopyableType(const clang::ASTContext & Context) const
- public bool isTriviallyRelocatableType(const clang::ASTContext & Context) const
- public bool isVolatileQualified() const
- public bool mayBeDynamicClass() const
- public bool mayBeNotDynamicClass() const
- public void print(llvm::raw_ostream & OS, const clang::PrintingPolicy & Policy, const llvm::Twine & PlaceHolder = llvm::Twine(), unsigned int Indentation = 0) const
- public static void print(clang::SplitQualType split, llvm::raw_ostream & OS, const clang::PrintingPolicy & policy, const llvm::Twine & PlaceHolder, unsigned int Indentation = 0)
- public static void print(const clang::Type * ty, clang::Qualifiers qs, llvm::raw_ostream & OS, const clang::PrintingPolicy & policy, const llvm::Twine & PlaceHolder, unsigned int Indentation = 0)
- public void removeLocalCVRQualifiers(unsigned int Mask)
- public void removeLocalConst()
- public void removeLocalFastQualifiers()
- public void removeLocalFastQualifiers(unsigned int Mask)
- public void removeLocalRestrict()
- public void removeLocalVolatile()
- public void setLocalFastQualifiers(unsigned int Quals)
- public clang::SplitQualType split() const
- public clang::QualType::StreamedQualTypeHelper stream(const clang::PrintingPolicy & Policy, const llvm::Twine & PlaceHolder = llvm::Twine(), unsigned int Indentation = 0) const
- public clang::QualType stripObjCKindOfType(const clang::ASTContext & ctx) const
- public clang::QualType substObjCMemberType(clang::QualType objectType, const clang::DeclContext * dc, clang::ObjCSubstitutionContext context) const
- public clang::QualType substObjCTypeArgs(clang::ASTContext & ctx, ArrayRef<clang::QualType> typeArgs, clang::ObjCSubstitutionContext context) const
- public clang::QualType withCVRQualifiers(unsigned int CVR) const
- public clang::QualType withConst() const
- public clang::QualType withExactLocalFastQualifiers(unsigned int TQs) const
- public clang::QualType withFastQualifiers(unsigned int TQs) const
- public clang::QualType withRestrict() const
- public clang::QualType withVolatile() const
- public clang::QualType withoutLocalFastQualifiers() const
Methods
¶static clang::QualType IgnoreParens(
clang::QualType T)
static clang::QualType IgnoreParens(
clang::QualType T)
Declared at: clang/include/clang/AST/Type.h:1368
Parameters
¶clang::QualType IgnoreParens() const
clang::QualType IgnoreParens() const
Description
Returns the specified type after dropping any outer-level parentheses.
Declared at: clang/include/clang/AST/Type.h:1062
¶void Profile(llvm::FoldingSetNodeID& ID) const
void Profile(llvm::FoldingSetNodeID& ID) const
Declared at: clang/include/clang/AST/Type.h:1145
Parameters
¶QualType()
QualType()
Declared at: clang/include/clang/AST/Type.h:754
¶QualType(const clang::Type* Ptr,
unsigned int Quals)
QualType(const clang::Type* Ptr,
unsigned int Quals)
Declared at: clang/include/clang/AST/Type.h:755
Parameters
- const clang::Type* Ptr
- unsigned int Quals
¶QualType(const clang::ExtQuals* Ptr,
unsigned int Quals)
QualType(const clang::ExtQuals* Ptr,
unsigned int Quals)
Declared at: clang/include/clang/AST/Type.h:756
Parameters
- const clang::ExtQuals* Ptr
- unsigned int Quals
¶void addConst()
void addConst()
Description
Add the `const` type qualifier to this QualType.
Declared at: clang/include/clang/AST/Type.h:902
¶void addFastQualifiers(unsigned int TQs)
void addFastQualifiers(unsigned int TQs)
Declared at: clang/include/clang/AST/Type.h:929
Parameters
- unsigned int TQs
¶void addRestrict()
void addRestrict()
Description
Add the `restrict` qualifier to this QualType.
Declared at: clang/include/clang/AST/Type.h:918
¶void addVolatile()
void addVolatile()
Description
Add the `volatile` type qualifier to this QualType.
Declared at: clang/include/clang/AST/Type.h:910
¶void dump(const char* s) const
void dump(const char* s) const
Declared at: clang/include/clang/AST/Type.h:1141
Parameters
- const char* s
¶void dump() const
void dump() const
Declared at: clang/include/clang/AST/Type.h:1142
¶void dump(llvm::raw_ostream& OS,
const clang::ASTContext& Context) const
void dump(llvm::raw_ostream& OS,
const clang::ASTContext& Context) const
Declared at: clang/include/clang/AST/Type.h:1143
Parameters
- llvm::raw_ostream& OS
- const clang::ASTContext& Context
¶inline clang::LangAS getAddressSpace() const
inline clang::LangAS getAddressSpace() const
Description
Return the address space of this type.
Declared at: clang/include/clang/AST/Type.h:1153
¶void* getAsOpaquePtr() const
void* getAsOpaquePtr() const
Declared at: clang/include/clang/AST/Type.h:776
¶static std::string getAsString(
const clang::Type* ty,
clang::Qualifiers qs,
const clang::PrintingPolicy& Policy)
static std::string getAsString(
const clang::Type* ty,
clang::Qualifiers qs,
const clang::PrintingPolicy& Policy)
Declared at: clang/include/clang/AST/Type.h:1083
Parameters
- const clang::Type* ty
- clang::Qualifiers qs
- const clang::PrintingPolicy& Policy
¶std::string getAsString(
const clang::PrintingPolicy& Policy) const
std::string getAsString(
const clang::PrintingPolicy& Policy) const
Declared at: clang/include/clang/AST/Type.h:1087
Parameters
- const clang::PrintingPolicy& Policy
¶std::string getAsString() const
std::string getAsString() const
Declared at: clang/include/clang/AST/Type.h:1086
¶static std::string getAsString(
clang::SplitQualType split,
const clang::PrintingPolicy& Policy)
static std::string getAsString(
clang::SplitQualType split,
const clang::PrintingPolicy& Policy)
Declared at: clang/include/clang/AST/Type.h:1079
Parameters
- clang::SplitQualType split
- const clang::PrintingPolicy& Policy
¶void getAsStringInternal(
std::string& Str,
const clang::PrintingPolicy& Policy) const
void getAsStringInternal(
std::string& Str,
const clang::PrintingPolicy& Policy) const
Declared at: clang/include/clang/AST/Type.h:1104
Parameters
- std::string& Str
- const clang::PrintingPolicy& Policy
¶static void getAsStringInternal(
clang::SplitQualType split,
std::string& out,
const clang::PrintingPolicy& policy)
static void getAsStringInternal(
clang::SplitQualType split,
std::string& out,
const clang::PrintingPolicy& policy)
Declared at: clang/include/clang/AST/Type.h:1107
Parameters
- clang::SplitQualType split
- std::string& out
- const clang::PrintingPolicy& policy
¶static void getAsStringInternal(
const clang::Type* ty,
clang::Qualifiers qs,
std::string& out,
const clang::PrintingPolicy& policy)
static void getAsStringInternal(
const clang::Type* ty,
clang::Qualifiers qs,
std::string& out,
const clang::PrintingPolicy& policy)
Declared at: clang/include/clang/AST/Type.h:1112
Parameters
- const clang::Type* ty
- clang::Qualifiers qs
- std::string& out
- const clang::PrintingPolicy& policy
¶clang::QualType getAtomicUnqualifiedType() const
clang::QualType getAtomicUnqualifiedType() const
Description
Remove all qualifiers including _Atomic.
Declared at: clang/include/clang/AST/Type.h:1356
¶const clang::IdentifierInfo*
getBaseTypeIdentifier() const
const clang::IdentifierInfo*
getBaseTypeIdentifier() const
Description
Retrieves a pointer to the name of the base type.
Declared at: clang/include/clang/AST/Type.h:770
¶unsigned int getCVRQualifiers() const
unsigned int getCVRQualifiers() const
Description
Retrieve the set of CVR (const-volatile-restrict) qualifiers applied to this type.
Declared at: clang/include/clang/AST/Type.h:864
¶clang::QualType getCanonicalType() const
clang::QualType getCanonicalType() const
Declared at: clang/include/clang/AST/Type.h:967
¶const clang::ExtQualsTypeCommonBase*
getCommonPtr() const
const clang::ExtQualsTypeCommonBase*
getCommonPtr() const
Declared at: clang/include/clang/AST/Type.h:746
¶static clang::QualType getDesugaredType(
clang::QualType T,
const clang::ASTContext& Context)
static clang::QualType getDesugaredType(
clang::QualType T,
const clang::ASTContext& Context)
Declared at: clang/include/clang/AST/Type.h:1363
Parameters
- clang::QualType T
- const clang::ASTContext& Context
¶clang::QualType getDesugaredType(
const clang::ASTContext& Context) const
clang::QualType getDesugaredType(
const clang::ASTContext& Context) const
Description
Return the specified type with any "sugar" removed from the type. This takes off typedefs, typeof's etc. If the outer level of the type is already concrete, it returns it unmodified. This is similar to getting the canonical type, but it doesn't remove *all* typedefs. For example, it returns "T*" as "T*", (not as "int*"), because the pointer is concrete. Qualifiers are left in place.
Declared at: clang/include/clang/AST/Type.h:1043
Parameters
- const clang::ASTContext& Context
¶const clang::ExtQuals* getExtQualsUnsafe() const
const clang::ExtQuals* getExtQualsUnsafe() const
Declared at: clang/include/clang/AST/Type.h:738
¶static clang::QualType getFromOpaquePtr(
const void* Ptr)
static clang::QualType getFromOpaquePtr(
const void* Ptr)
Declared at: clang/include/clang/AST/Type.h:778
Parameters
- const void* Ptr
¶unsigned int getLocalCVRQualifiers() const
unsigned int getLocalCVRQualifiers() const
Description
Retrieve the set of CVR (const-volatile-restrict) qualifiers local to this particular QualType instance, not including any qualifiers acquired through typedefs or other sugar.
Declared at: clang/include/clang/AST/Type.h:858
¶unsigned int getLocalFastQualifiers() const
unsigned int getLocalFastQualifiers() const
Declared at: clang/include/clang/AST/Type.h:758
¶clang::Qualifiers getLocalQualifiers() const
clang::Qualifiers getLocalQualifiers() const
Description
Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifiers acquired through typedefs or other sugar.
Declared at: clang/include/clang/AST/Type.h:850
¶clang::QualType getLocalUnqualifiedType() const
clang::QualType getLocalUnqualifiedType() const
Description
Return this type with all of the instance-specific qualifiers removed, but without removing any qualifiers that may have been applied through typedefs.
Declared at: clang/include/clang/AST/Type.h:972
¶clang::QualType getNonLValueExprType(
const clang::ASTContext& Context) const
clang::QualType getNonLValueExprType(
const clang::ASTContext& Context) const
Description
Determine the type of a (typically non-lvalue) expression with the specified result type. This routine should be used for expressions for which the return type is explicitly specified (e.g., in a cast or call) and isn't necessarily an lvalue. It removes a top-level reference (since there are no expressions of reference type) and deletes top-level cvr-qualifiers from non-class types (in C++) or all types (in C).
Declared at: clang/include/clang/AST/Type.h:1027
Parameters
- const clang::ASTContext& Context
¶clang::QualType getNonPackExpansionType() const
clang::QualType getNonPackExpansionType() const
Description
Remove an outer pack expansion type (if any) from this type. Used as part of converting the type of a declaration to the type of an expression that references that expression. It's meaningless for an expression to have a pack expansion type.
Declared at: clang/include/clang/AST/Type.h:1033
¶clang::QualType getNonReferenceType() const
clang::QualType getNonReferenceType() const
Description
If Type is a reference type (e.g., const int & ), returns the type that the reference refers to ("const int"). Otherwise, returns the type itself. This routine is used throughout Sema to implement C++ 5p6: If an expression initially has the type "reference to T" (8.3.2, 8.5.3), the type is adjusted to "T" prior to any further analysis, the expression designates the object or function denoted by the reference, and the expression is an lvalue.
Declared at: clang/include/clang/AST/Type.h:1017
¶inline Qualifiers::GC getObjCGCAttr() const
inline Qualifiers::GC getObjCGCAttr() const
Description
Returns gc attribute of this type.
Declared at: clang/include/clang/AST/Type.h:1171
¶Qualifiers::ObjCLifetime getObjCLifetime() const
Qualifiers::ObjCLifetime getObjCLifetime() const
Description
Returns lifetime attribute of this type.
Declared at: clang/include/clang/AST/Type.h:1184
¶clang::Qualifiers getQualifiers() const
clang::Qualifiers getQualifiers() const
Description
Retrieve the set of qualifiers applied to this type.
Declared at: clang/include/clang/AST/Type.h:853
¶clang::QualType getSingleStepDesugaredType(
const clang::ASTContext& Context) const
clang::QualType getSingleStepDesugaredType(
const clang::ASTContext& Context) const
Description
Return the specified type with one level of "sugar" removed from the type. This routine takes off the first typedef, typeof, etc. If the outer level of the type is already concrete, it returns it unmodified.
Declared at: clang/include/clang/AST/Type.h:1056
Parameters
- const clang::ASTContext& Context
¶static clang::QualType
getSingleStepDesugaredTypeImpl(
clang::QualType type,
const clang::ASTContext& C)
static clang::QualType
getSingleStepDesugaredTypeImpl(
clang::QualType type,
const clang::ASTContext& C)
Declared at: clang/include/clang/AST/Type.h:1366
Parameters
- clang::QualType type
- const clang::ASTContext& C
¶clang::SplitQualType getSplitDesugaredType() const
clang::SplitQualType getSplitDesugaredType() const
Declared at: clang/include/clang/AST/Type.h:1047
¶static clang::SplitQualType getSplitDesugaredType(
clang::QualType T)
static clang::SplitQualType getSplitDesugaredType(
clang::QualType T)
Declared at: clang/include/clang/AST/Type.h:1364
Parameters
¶inline clang::SplitQualType
getSplitUnqualifiedType() const
inline clang::SplitQualType
getSplitUnqualifiedType() const
Description
Retrieve the unqualified variant of the given type, removing as little sugar as possible. Like getUnqualifiedType(), but also returns the set of qualifiers that were built up. The resulting type might still be qualified if it's sugar for an array type. To strip qualifiers even from within a sugared array type, use ASTContext::getUnqualifiedArrayType.
Declared at: clang/include/clang/AST/Type.h:1007
¶static clang::SplitQualType
getSplitUnqualifiedTypeImpl(clang::QualType type)
static clang::SplitQualType
getSplitUnqualifiedTypeImpl(clang::QualType type)
Declared at: clang/include/clang/AST/Type.h:1365
Parameters
- clang::QualType type
¶const clang::Type* getTypePtr() const
const clang::Type* getTypePtr() const
Description
Retrieves a pointer to the underlying (unqualified) type. This function requires that the type not be NULL. If the type might be NULL, use the (slightly less efficient) \c getTypePtrOrNull().
Declared at: clang/include/clang/AST/Type.h:765
¶const clang::Type* getTypePtrOrNull() const
const clang::Type* getTypePtrOrNull() const
Declared at: clang/include/clang/AST/Type.h:767
¶const clang::Type* getTypePtrUnsafe() const
const clang::Type* getTypePtrUnsafe() const
Declared at: clang/include/clang/AST/Type.h:742
¶inline clang::QualType getUnqualifiedType() const
inline clang::QualType getUnqualifiedType() const
Description
Retrieve the unqualified variant of the given type, removing as little sugar as possible. This routine looks through various kinds of sugar to find the least-desugared type that is unqualified. For example, given: Executing \c getUnqualifiedType() on the type \c DifferenceType will desugar until we hit the type \c Integer, which has no qualifiers on it. The resulting type might still be qualified if it's sugar for an array type. To strip qualifiers even from within a sugared array type, use ASTContext::getUnqualifiedArrayType. Note: In C, the _Atomic qualifier is special (see C2x 6.2.5p29 for details), and it is not stripped by this function. Use getAtomicUnqualifiedType() to strip qualifiers including _Atomic.
Declared at: clang/include/clang/AST/Type.h:996
¶inline bool hasAddressSpace() const
inline bool hasAddressSpace() const
Description
Check if this type has any address space qualifier.
Declared at: clang/include/clang/AST/Type.h:1150
¶bool hasLocalNonFastQualifiers() const
bool hasLocalNonFastQualifiers() const
Description
Determine whether this particular QualType instance has any "non-fast" qualifiers, e.g., those that are stored in an ExtQualType instance.
Declared at: clang/include/clang/AST/Type.h:843
¶bool hasLocalQualifiers() const
bool hasLocalQualifiers() const
Description
Determine whether this particular QualType instance has any qualifiers, without looking through any typedefs that might add qualifiers at a different level.
Declared at: clang/include/clang/AST/Type.h:833
¶bool hasNonTrivialObjCLifetime() const
bool hasNonTrivialObjCLifetime() const
Declared at: clang/include/clang/AST/Type.h:1188
¶static bool hasNonTrivialToPrimitiveCopyCUnion(
const clang::RecordDecl* RD)
static bool hasNonTrivialToPrimitiveCopyCUnion(
const clang::RecordDecl* RD)
Declared at: clang/include/clang/AST/Type.h:1374
Parameters
- const clang::RecordDecl* RD
¶bool hasNonTrivialToPrimitiveCopyCUnion() const
bool hasNonTrivialToPrimitiveCopyCUnion() const
Description
Check if this is or contains a C union that is non-trivial to copy, which is a union that has a member that is non-trivial to copy. If this returns true, isNonTrivialToPrimitiveCopy returns PCK_Struct.
Declared at: clang/include/clang/AST/Type.h:1296
¶bool hasNonTrivialToPrimitiveDefaultInitializeCUnion()
const
bool hasNonTrivialToPrimitiveDefaultInitializeCUnion()
const
Description
Check if this is or contains a C union that is non-trivial to default-initialize, which is a union that has a member that is non-trivial to default-initialize. If this returns true, isNonTrivialToPrimitiveDefaultInitialize returns PDIK_Struct.
Declared at: clang/include/clang/AST/Type.h:1286
¶static bool
hasNonTrivialToPrimitiveDefaultInitializeCUnion(
const clang::RecordDecl* RD)
static bool
hasNonTrivialToPrimitiveDefaultInitializeCUnion(
const clang::RecordDecl* RD)
Description
Check if
Declared at: clang/include/clang/AST/Type.h:1372
Parameters
- const clang::RecordDecl* RD
- is or contains a non-trivial C union.
¶bool hasNonTrivialToPrimitiveDestructCUnion()
const
bool hasNonTrivialToPrimitiveDestructCUnion()
const
Description
Check if this is or contains a C union that is non-trivial to destruct, which is a union that has a member that is non-trivial to destruct. If this returns true, isDestructedType returns DK_nontrivial_c_struct.
Declared at: clang/include/clang/AST/Type.h:1291
¶static bool
hasNonTrivialToPrimitiveDestructCUnion(
const clang::RecordDecl* RD)
static bool
hasNonTrivialToPrimitiveDestructCUnion(
const clang::RecordDecl* RD)
Declared at: clang/include/clang/AST/Type.h:1373
Parameters
- const clang::RecordDecl* RD
¶bool hasQualifiers() const
bool hasQualifiers() const
Description
Determine whether this type has any qualifiers.
Declared at: clang/include/clang/AST/Type.h:838
¶bool hasStrongOrWeakObjCLifetime() const
bool hasStrongOrWeakObjCLifetime() const
Declared at: clang/include/clang/AST/Type.h:1192
¶bool isAddressSpaceOverlapping(
clang::QualType T) const
bool isAddressSpaceOverlapping(
clang::QualType T) const
Description
Returns true if address space qualifiers overlap with T address space qualifiers. OpenCL C defines conversion rules for pointers to different address spaces and notion of overlapping address spaces. CL1.1 or CL1.2: address spaces overlap iff they are they same. OpenCL C v2.0 s6.5.5 adds: __generic overlaps with any address space except for __constant.
Declared at: clang/include/clang/AST/Type.h:1163
Parameters
¶bool isAtLeastAsQualifiedAs(
clang::QualType Other) const
bool isAtLeastAsQualifiedAs(
clang::QualType Other) const
Description
Determine whether this type is at least as qualified as the other given type, requiring exact equality for non-CVR qualifiers.
Declared at: clang/include/clang/AST/Type.h:1015
Parameters
- clang::QualType Other
¶bool isCForbiddenLValueType() const
bool isCForbiddenLValueType() const
Description
Determine whether expressions of the given type are forbidden from being lvalues in C. The expression types that are forbidden to be lvalues are: - 'void', but not qualified void - function types The exact rule here is C99 6.3.2.1: An lvalue is an expression with an object type or an incomplete type other than void.
Declared at: clang/include/clang/AST/Type.h:1308
¶bool isCXX11PODType(
const clang::ASTContext& Context) const
bool isCXX11PODType(
const clang::ASTContext& Context) const
Description
Return true if this is a POD type according to the more relaxed rules of the C++11 standard, regardless of the current compilation's language. (C++0x [basic.types]p9). Note that, unlike CXXRecordDecl::isCXX11StandardLayout, this takes DRs into account.
Declared at: clang/include/clang/AST/Type.h:881
Parameters
- const clang::ASTContext& Context
¶bool isCXX98PODType(
const clang::ASTContext& Context) const
bool isCXX98PODType(
const clang::ASTContext& Context) const
Description
Return true if this is a POD type according to the rules of the C++98 standard, regardless of the current compilation's language.
Declared at: clang/include/clang/AST/Type.h:875
Parameters
- const clang::ASTContext& Context
¶bool isCanonical() const
bool isCanonical() const
Declared at: clang/include/clang/AST/Type.h:792
¶bool isCanonicalAsParam() const
bool isCanonicalAsParam() const
Declared at: clang/include/clang/AST/Type.h:793
¶bool isConstQualified() const
bool isConstQualified() const
Description
Determine whether this type is const-qualified.
Declared at: clang/include/clang/AST/Type.h:808
¶bool isConstant(
const clang::ASTContext& Ctx) const
bool isConstant(
const clang::ASTContext& Ctx) const
Declared at: clang/include/clang/AST/Type.h:866
Parameters
- const clang::ASTContext& Ctx
¶static bool isConstant(
clang::QualType T,
const clang::ASTContext& Ctx)
static bool isConstant(
clang::QualType T,
const clang::ASTContext& Ctx)
Declared at: clang/include/clang/AST/Type.h:1362
Parameters
- clang::QualType T
- const clang::ASTContext& Ctx
¶clang::QualType::DestructionKind
isDestructedType() const
clang::QualType::DestructionKind
isDestructedType() const
Description
Returns a nonzero value if objects of this type require non-trivial work to clean up after. Non-zero because it's conceivable that qualifiers (objc_gc(weak)?) could make something require destruction.
Declared at: clang/include/clang/AST/Type.h:1278
¶static clang::QualType::DestructionKind
isDestructedTypeImpl(clang::QualType type)
static clang::QualType::DestructionKind
isDestructedTypeImpl(clang::QualType type)
Declared at: clang/include/clang/AST/Type.h:1369
Parameters
- clang::QualType type
¶bool isLocalConstQualified() const
bool isLocalConstQualified() const
Description
Determine whether this particular QualType instance has the "const" qualifier set, without looking through typedefs that may have added "const" at a different level.
Declared at: clang/include/clang/AST/Type.h:803
¶bool isLocalRestrictQualified() const
bool isLocalRestrictQualified() const
Description
Determine whether this particular QualType instance has the "restrict" qualifier set, without looking through typedefs that may have added "restrict" at a different level.
Declared at: clang/include/clang/AST/Type.h:813
¶bool isLocalVolatileQualified() const
bool isLocalVolatileQualified() const
Description
Determine whether this particular QualType instance has the "volatile" qualifier set, without looking through typedefs that may have added "volatile" at a different level.
Declared at: clang/include/clang/AST/Type.h:823
¶bool isMoreQualifiedThan(
clang::QualType Other) const
bool isMoreQualifiedThan(
clang::QualType Other) const
Description
Determine whether this type is more qualified than the other given type, requiring exact equality for non-CVR qualifiers.
Declared at: clang/include/clang/AST/Type.h:1011
Parameters
- clang::QualType Other
¶clang::QualType::PrimitiveCopyKind
isNonTrivialToPrimitiveCopy() const
clang::QualType::PrimitiveCopyKind
isNonTrivialToPrimitiveCopy() const
Description
Check if this is a non-trivial type that would cause a C struct transitively containing this type to be non-trivial to copy and return the kind.
Declared at: clang/include/clang/AST/Type.h:1256
¶clang::QualType::PrimitiveDefaultInitializeKind
isNonTrivialToPrimitiveDefaultInitialize() const
clang::QualType::PrimitiveDefaultInitializeKind
isNonTrivialToPrimitiveDefaultInitialize() const
Description
Check if this is a non-trivial type that would cause a C struct transitively containing this type to be non-trivial to default initialize and return the kind.
Declared at: clang/include/clang/AST/Type.h:1223
¶clang::QualType::PrimitiveCopyKind
isNonTrivialToPrimitiveDestructiveMove() const
clang::QualType::PrimitiveCopyKind
isNonTrivialToPrimitiveDestructiveMove() const
Description
Check if this is a non-trivial type that would cause a C struct transitively containing this type to be non-trivial to destructively move and return the kind. Destructive move in this context is a C++-style move in which the source object is placed in a valid but unspecified state after it is moved, as opposed to a truly destructive move in which the source object is placed in an uninitialized state.
Declared at: clang/include/clang/AST/Type.h:1264
¶bool isNonWeakInMRRWithObjCWeak(
const clang::ASTContext& Context) const
bool isNonWeakInMRRWithObjCWeak(
const clang::ASTContext& Context) const
Declared at: clang/include/clang/AST/Type.h:1197
Parameters
- const clang::ASTContext& Context
¶bool isNull() const
bool isNull() const
Description
Return true if this QualType doesn't point to a type yet.
Declared at: clang/include/clang/AST/Type.h:796
¶bool isObjCGCStrong() const
bool isObjCGCStrong() const
Description
true when Type is objc's strong.
Declared at: clang/include/clang/AST/Type.h:1179
¶bool isObjCGCWeak() const
bool isObjCGCWeak() const
Description
true when Type is objc's weak.
Declared at: clang/include/clang/AST/Type.h:1174
¶bool isPODType(
const clang::ASTContext& Context) const
bool isPODType(
const clang::ASTContext& Context) const
Description
Determine whether this is a Plain Old Data (POD) type (C++ 3.9p10).
Declared at: clang/include/clang/AST/Type.h:871
Parameters
- const clang::ASTContext& Context
¶bool isRestrictQualified() const
bool isRestrictQualified() const
Description
Determine whether this type is restrict-qualified.
Declared at: clang/include/clang/AST/Type.h:818
¶bool isTrivialType(
const clang::ASTContext& Context) const
bool isTrivialType(
const clang::ASTContext& Context) const
Description
Return true if this is a trivial type per (C++0x [basic.types]p9)
Declared at: clang/include/clang/AST/Type.h:884
Parameters
- const clang::ASTContext& Context
¶bool isTriviallyCopyableType(
const clang::ASTContext& Context) const
bool isTriviallyCopyableType(
const clang::ASTContext& Context) const
Description
Return true if this is a trivially copyable type (C++0x [basic.types]p9)
Declared at: clang/include/clang/AST/Type.h:887
Parameters
- const clang::ASTContext& Context
¶bool isTriviallyRelocatableType(
const clang::ASTContext& Context) const
bool isTriviallyRelocatableType(
const clang::ASTContext& Context) const
Description
Return true if this is a trivially relocatable type.
Declared at: clang/include/clang/AST/Type.h:890
Parameters
- const clang::ASTContext& Context
¶bool isVolatileQualified() const
bool isVolatileQualified() const
Description
Determine whether this type is volatile-qualified.
Declared at: clang/include/clang/AST/Type.h:828
¶bool mayBeDynamicClass() const
bool mayBeDynamicClass() const
Description
Returns true if it is a class and it might be dynamic.
Declared at: clang/include/clang/AST/Type.h:893
¶bool mayBeNotDynamicClass() const
bool mayBeNotDynamicClass() const
Description
Returns true if it is not a class or if the class might not be dynamic.
Declared at: clang/include/clang/AST/Type.h:896
¶void print(llvm::raw_ostream& OS,
const clang::PrintingPolicy& Policy,
const llvm::Twine& PlaceHolder =
llvm::Twine(),
unsigned int Indentation = 0) const
void print(llvm::raw_ostream& OS,
const clang::PrintingPolicy& Policy,
const llvm::Twine& PlaceHolder =
llvm::Twine(),
unsigned int Indentation = 0) const
Declared at: clang/include/clang/AST/Type.h:1089
Parameters
- llvm::raw_ostream& OS
- const clang::PrintingPolicy& Policy
- const llvm::Twine& PlaceHolder = llvm::Twine()
- unsigned int Indentation = 0
¶static void print(
clang::SplitQualType split,
llvm::raw_ostream& OS,
const clang::PrintingPolicy& policy,
const llvm::Twine& PlaceHolder,
unsigned int Indentation = 0)
static void print(
clang::SplitQualType split,
llvm::raw_ostream& OS,
const clang::PrintingPolicy& policy,
const llvm::Twine& PlaceHolder,
unsigned int Indentation = 0)
Declared at: clang/include/clang/AST/Type.h:1093
Parameters
- clang::SplitQualType split
- llvm::raw_ostream& OS
- const clang::PrintingPolicy& policy
- const llvm::Twine& PlaceHolder
- unsigned int Indentation = 0
¶static void print(
const clang::Type* ty,
clang::Qualifiers qs,
llvm::raw_ostream& OS,
const clang::PrintingPolicy& policy,
const llvm::Twine& PlaceHolder,
unsigned int Indentation = 0)
static void print(
const clang::Type* ty,
clang::Qualifiers qs,
llvm::raw_ostream& OS,
const clang::PrintingPolicy& policy,
const llvm::Twine& PlaceHolder,
unsigned int Indentation = 0)
Declared at: clang/include/clang/AST/Type.h:1099
Parameters
- const clang::Type* ty
- clang::Qualifiers qs
- llvm::raw_ostream& OS
- const clang::PrintingPolicy& policy
- const llvm::Twine& PlaceHolder
- unsigned int Indentation = 0
¶void removeLocalCVRQualifiers(unsigned int Mask)
void removeLocalCVRQualifiers(unsigned int Mask)
Declared at: clang/include/clang/AST/Type.h:938
Parameters
- unsigned int Mask
¶void removeLocalConst()
void removeLocalConst()
Declared at: clang/include/clang/AST/Type.h:935
¶void removeLocalFastQualifiers()
void removeLocalFastQualifiers()
Declared at: clang/include/clang/AST/Type.h:940
¶void removeLocalFastQualifiers(unsigned int Mask)
void removeLocalFastQualifiers(unsigned int Mask)
Declared at: clang/include/clang/AST/Type.h:941
Parameters
- unsigned int Mask
¶void removeLocalRestrict()
void removeLocalRestrict()
Declared at: clang/include/clang/AST/Type.h:937
¶void removeLocalVolatile()
void removeLocalVolatile()
Declared at: clang/include/clang/AST/Type.h:936
¶void setLocalFastQualifiers(unsigned int Quals)
void setLocalFastQualifiers(unsigned int Quals)
Declared at: clang/include/clang/AST/Type.h:759
Parameters
- unsigned int Quals
¶clang::SplitQualType split() const
clang::SplitQualType split() const
Description
Divides a QualType into its unqualified type and a set of local qualifiers.
Declared at: clang/include/clang/AST/Type.h:774
¶clang::QualType::StreamedQualTypeHelper stream(
const clang::PrintingPolicy& Policy,
const llvm::Twine& PlaceHolder =
llvm::Twine(),
unsigned int Indentation = 0) const
clang::QualType::StreamedQualTypeHelper stream(
const clang::PrintingPolicy& Policy,
const llvm::Twine& PlaceHolder =
llvm::Twine(),
unsigned int Indentation = 0) const
Declared at: clang/include/clang/AST/Type.h:1135
Parameters
- const clang::PrintingPolicy& Policy
- const llvm::Twine& PlaceHolder = llvm::Twine()
- unsigned int Indentation = 0
¶clang::QualType stripObjCKindOfType(
const clang::ASTContext& ctx) const
clang::QualType stripObjCKindOfType(
const clang::ASTContext& ctx) const
Description
Strip Objective-C "__kindof" types from the given type.
Declared at: clang/include/clang/AST/Type.h:1353
Parameters
- const clang::ASTContext& ctx
¶clang::QualType substObjCMemberType(
clang::QualType objectType,
const clang::DeclContext* dc,
clang::ObjCSubstitutionContext context) const
clang::QualType substObjCMemberType(
clang::QualType objectType,
const clang::DeclContext* dc,
clang::ObjCSubstitutionContext context) const
Description
Substitute type arguments from an object type for the Objective-C type parameters used in the subject type. This operation combines the computation of type arguments for substitution (\c Type::getObjCSubstitutions) with the actual process of substitution (\c QualType::substObjCTypeArgs) for the convenience of callers that need to perform a single substitution in isolation.
Declared at: clang/include/clang/AST/Type.h:1348
Parameters
- clang::QualType objectType
- The type of the object whose member type we're substituting into. For example, this might be the receiver of a message or the base of a property access.
- const clang::DeclContext* dc
- The declaration context from which the subject type was retrieved, which indicates (for example) which type parameters should be substituted.
- clang::ObjCSubstitutionContext context
- The context in which the subject type was written.
Returns
the subject type after replacing all of the Objective-C type parameters with their corresponding arguments.
¶clang::QualType substObjCTypeArgs(
clang::ASTContext& ctx,
ArrayRef<clang::QualType> typeArgs,
clang::ObjCSubstitutionContext context) const
clang::QualType substObjCTypeArgs(
clang::ASTContext& ctx,
ArrayRef<clang::QualType> typeArgs,
clang::ObjCSubstitutionContext context) const
Description
Substitute type arguments for the Objective-C type parameters used in the subject type.
Declared at: clang/include/clang/AST/Type.h:1324
Parameters
- clang::ASTContext& ctx
- ASTContext in which the type exists.
- ArrayRef<clang::QualType> typeArgs
- The type arguments that will be substituted for the Objective-C type parameters in the subject type, which are generally computed via \c Type::getObjCSubstitutions. If empty, the type parameters will be replaced with their bounds or id/Class, as appropriate for the context.
- clang::ObjCSubstitutionContext context
- The context in which the subject type was written.
Returns
the resulting type.
¶clang::QualType withCVRQualifiers(
unsigned int CVR) const
clang::QualType withCVRQualifiers(
unsigned int CVR) const
Declared at: clang/include/clang/AST/Type.h:925
Parameters
- unsigned int CVR
¶clang::QualType withConst() const
clang::QualType withConst() const
Declared at: clang/include/clang/AST/Type.h:905
¶clang::QualType withExactLocalFastQualifiers(
unsigned int TQs) const
clang::QualType withExactLocalFastQualifiers(
unsigned int TQs) const
Declared at: clang/include/clang/AST/Type.h:956
Parameters
- unsigned int TQs
¶clang::QualType withFastQualifiers(
unsigned int TQs) const
clang::QualType withFastQualifiers(
unsigned int TQs) const
Declared at: clang/include/clang/AST/Type.h:948
Parameters
- unsigned int TQs
¶clang::QualType withRestrict() const
clang::QualType withRestrict() const
Declared at: clang/include/clang/AST/Type.h:921
¶clang::QualType withVolatile() const
clang::QualType withVolatile() const
Declared at: clang/include/clang/AST/Type.h:913
¶clang::QualType withoutLocalFastQualifiers() const
clang::QualType withoutLocalFastQualifiers() const
Declared at: clang/include/clang/AST/Type.h:961