clang 19.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::QualType Class Reference

A (possibly-)qualified type. More...

#include "clang/AST/Type.h"

Classes

class  StreamedQualTypeHelper
 

Public Types

enum class  NonConstantStorageReason { MutableField , NonConstNonReferenceType , NonTrivialCtor , NonTrivialDtor }
 
enum  PrimitiveDefaultInitializeKind { PDIK_Trivial , PDIK_ARCStrong , PDIK_ARCWeak , PDIK_Struct }
 
enum  PrimitiveCopyKind {
  PCK_Trivial , PCK_VolatileTrivial , PCK_ARCStrong , PCK_ARCWeak ,
  PCK_Struct
}
 
enum  DestructionKind {
  DK_none , DK_cxx_destructor , DK_objc_strong_lifetime , DK_objc_weak_lifetime ,
  DK_nontrivial_c_struct
}
 

Public Member Functions

 QualType ()=default
 
 QualType (const Type *Ptr, unsigned Quals)
 
 QualType (const ExtQuals *Ptr, unsigned Quals)
 
unsigned getLocalFastQualifiers () const
 
void setLocalFastQualifiers (unsigned Quals)
 
bool UseExcessPrecision (const ASTContext &Ctx)
 
const TypegetTypePtr () const
 Retrieves a pointer to the underlying (unqualified) type.
 
const TypegetTypePtrOrNull () const
 
const IdentifierInfogetBaseTypeIdentifier () const
 Retrieves a pointer to the name of the base type.
 
SplitQualType split () const
 Divides a QualType into its unqualified type and a set of local qualifiers.
 
void * getAsOpaquePtr () const
 
const Typeoperator* () const
 
const Typeoperator-> () const
 
bool isCanonical () const
 
bool isCanonicalAsParam () const
 
bool isNull () const
 Return true if this QualType doesn't point to a type yet.
 
bool isReferenceable () const
 
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 isConstQualified () const
 Determine whether this type is const-qualified.
 
std::optional< NonConstantStorageReasonisNonConstantStorage (const ASTContext &Ctx, bool ExcludeCtor, bool ExcludeDtor)
 Determine whether instances of this type can be placed in immutable storage.
 
bool isConstantStorage (const ASTContext &Ctx, bool ExcludeCtor, bool ExcludeDtor)
 
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.
 
bool isRestrictQualified () const
 Determine whether this type is restrict-qualified.
 
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.
 
bool isVolatileQualified () const
 Determine whether this type is volatile-qualified.
 
bool hasLocalQualifiers () const
 Determine whether this particular QualType instance has any qualifiers, without looking through any typedefs that might add qualifiers at a different level.
 
bool hasQualifiers () const
 Determine whether this type has any qualifiers.
 
bool hasLocalNonFastQualifiers () const
 Determine whether this particular QualType instance has any "non-fast" qualifiers, e.g., those that are stored in an ExtQualType instance.
 
Qualifiers getLocalQualifiers () const
 Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifiers acquired through typedefs or other sugar.
 
Qualifiers getQualifiers () const
 Retrieve the set of qualifiers applied to this type.
 
unsigned getLocalCVRQualifiers () const
 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.
 
unsigned getCVRQualifiers () const
 Retrieve the set of CVR (const-volatile-restrict) qualifiers applied to this type.
 
bool isConstant (const ASTContext &Ctx) const
 
bool isPODType (const ASTContext &Context) const
 Determine whether this is a Plain Old Data (POD) type (C++ 3.9p10).
 
bool isCXX98PODType (const ASTContext &Context) const
 Return true if this is a POD type according to the rules of the C++98 standard, regardless of the current compilation's language.
 
bool isCXX11PODType (const ASTContext &Context) const
 Return true if this is a POD type according to the more relaxed rules of the C++11 standard, regardless of the current compilation's language.
 
bool isTrivialType (const ASTContext &Context) const
 Return true if this is a trivial type per (C++0x [basic.types]p9)
 
bool isTriviallyCopyableType (const ASTContext &Context) const
 Return true if this is a trivially copyable type (C++0x [basic.types]p9)
 
bool isTriviallyCopyConstructibleType (const ASTContext &Context) const
 Return true if this is a trivially copyable type.
 
bool isTriviallyRelocatableType (const ASTContext &Context) const
 Return true if this is a trivially relocatable type.
 
bool isTriviallyEqualityComparableType (const ASTContext &Context) const
 Return true if this is a trivially equality comparable type.
 
bool mayBeDynamicClass () const
 Returns true if it is a class and it might be dynamic.
 
bool mayBeNotDynamicClass () const
 Returns true if it is not a class or if the class might not be dynamic.
 
bool isWebAssemblyReferenceType () const
 Returns true if it is a WebAssembly Reference Type.
 
bool isWebAssemblyExternrefType () const
 Returns true if it is a WebAssembly Externref Type.
 
bool isWebAssemblyFuncrefType () const
 Returns true if it is a WebAssembly Funcref Type.
 
void addConst ()
 Add the const type qualifier to this QualType.
 
QualType withConst () const
 
void addVolatile ()
 Add the volatile type qualifier to this QualType.
 
QualType withVolatile () const
 
void addRestrict ()
 Add the restrict qualifier to this QualType.
 
QualType withRestrict () const
 
QualType withCVRQualifiers (unsigned CVR) const
 
void addFastQualifiers (unsigned TQs)
 
void removeLocalConst ()
 
void removeLocalVolatile ()
 
void removeLocalRestrict ()
 
void removeLocalFastQualifiers ()
 
void removeLocalFastQualifiers (unsigned Mask)
 
QualType withFastQualifiers (unsigned TQs) const
 
QualType withExactLocalFastQualifiers (unsigned TQs) const
 
QualType withoutLocalFastQualifiers () const
 
QualType getCanonicalType () const
 
QualType getLocalUnqualifiedType () const
 Return this type with all of the instance-specific qualifiers removed, but without removing any qualifiers that may have been applied through typedefs.
 
QualType getUnqualifiedType () const
 Retrieve the unqualified variant of the given type, removing as little sugar as possible.
 
SplitQualType getSplitUnqualifiedType () const
 Retrieve the unqualified variant of the given type, removing as little sugar as possible.
 
bool isMoreQualifiedThan (QualType Other) const
 Determine whether this type is more qualified than the other given type, requiring exact equality for non-CVR qualifiers.
 
bool isAtLeastAsQualifiedAs (QualType Other) const
 Determine whether this type is at least as qualified as the other given type, requiring exact equality for non-CVR qualifiers.
 
QualType getNonReferenceType () const
 If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const int").
 
QualType getNonLValueExprType (const ASTContext &Context) const
 Determine the type of a (typically non-lvalue) expression with the specified result type.
 
QualType getNonPackExpansionType () const
 Remove an outer pack expansion type (if any) from this type.
 
QualType getDesugaredType (const ASTContext &Context) const
 Return the specified type with any "sugar" removed from the type.
 
SplitQualType getSplitDesugaredType () const
 
QualType getSingleStepDesugaredType (const ASTContext &Context) const
 Return the specified type with one level of "sugar" removed from the type.
 
QualType IgnoreParens () const
 Returns the specified type after dropping any outer-level parentheses.
 
std::string getAsString () const
 
std::string getAsString (const PrintingPolicy &Policy) const
 
void print (raw_ostream &OS, const PrintingPolicy &Policy, const Twine &PlaceHolder=Twine(), unsigned Indentation=0) const
 
void getAsStringInternal (std::string &Str, const PrintingPolicy &Policy) const
 
StreamedQualTypeHelper stream (const PrintingPolicy &Policy, const Twine &PlaceHolder=Twine(), unsigned Indentation=0) const
 
void dump (const char *s) const
 
void dump () const
 
void dump (llvm::raw_ostream &OS, const ASTContext &Context) const
 
void Profile (llvm::FoldingSetNodeID &ID) const
 
bool hasAddressSpace () const
 Check if this type has any address space qualifier.
 
LangAS getAddressSpace () const
 Return the address space of this type.
 
bool isAddressSpaceOverlapping (QualType T) const
 Returns true if address space qualifiers overlap with T address space qualifiers.
 
Qualifiers::GC getObjCGCAttr () const
 Returns gc attribute of this type.
 
bool isObjCGCWeak () const
 true when Type is objc's weak.
 
bool isObjCGCStrong () const
 true when Type is objc's strong.
 
Qualifiers::ObjCLifetime getObjCLifetime () const
 Returns lifetime attribute of this type.
 
bool hasNonTrivialObjCLifetime () const
 
bool hasStrongOrWeakObjCLifetime () const
 
bool isNonWeakInMRRWithObjCWeak (const ASTContext &Context) const
 
PrimitiveDefaultInitializeKind isNonTrivialToPrimitiveDefaultInitialize () const
 Functions to query basic properties of non-trivial C struct types.
 
PrimitiveCopyKind isNonTrivialToPrimitiveCopy () const
 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.
 
PrimitiveCopyKind isNonTrivialToPrimitiveDestructiveMove () const
 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.
 
DestructionKind isDestructedType () const
 Returns a nonzero value if objects of this type require non-trivial work to clean up after.
 
bool hasNonTrivialToPrimitiveDefaultInitializeCUnion () const
 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.
 
bool hasNonTrivialToPrimitiveDestructCUnion () const
 Check if this is or contains a C union that is non-trivial to destruct, which is a union that has a member that is non-trivial to destruct.
 
bool hasNonTrivialToPrimitiveCopyCUnion () const
 Check if this is or contains a C union that is non-trivial to copy, which is a union that has a member that is non-trivial to copy.
 
bool isCForbiddenLValueType () const
 Determine whether expressions of the given type are forbidden from being lvalues in C.
 
QualType substObjCTypeArgs (ASTContext &ctx, ArrayRef< QualType > typeArgs, ObjCSubstitutionContext context) const
 Substitute type arguments for the Objective-C type parameters used in the subject type.
 
QualType substObjCMemberType (QualType objectType, const DeclContext *dc, ObjCSubstitutionContext context) const
 Substitute type arguments from an object type for the Objective-C type parameters used in the subject type.
 
QualType stripObjCKindOfType (const ASTContext &ctx) const
 Strip Objective-C "__kindof" types from the given type.
 
QualType getAtomicUnqualifiedType () const
 Remove all qualifiers including _Atomic.
 

Static Public Member Functions

static QualType getFromOpaquePtr (const void *Ptr)
 
static std::string getAsString (SplitQualType split, const PrintingPolicy &Policy)
 
static std::string getAsString (const Type *ty, Qualifiers qs, const PrintingPolicy &Policy)
 
static void print (SplitQualType split, raw_ostream &OS, const PrintingPolicy &policy, const Twine &PlaceHolder, unsigned Indentation=0)
 
static void print (const Type *ty, Qualifiers qs, raw_ostream &OS, const PrintingPolicy &policy, const Twine &PlaceHolder, unsigned Indentation=0)
 
static void getAsStringInternal (SplitQualType split, std::string &out, const PrintingPolicy &policy)
 
static void getAsStringInternal (const Type *ty, Qualifiers qs, std::string &out, const PrintingPolicy &policy)
 

Friends

class QualifierCollector
 
bool operator== (const QualType &LHS, const QualType &RHS)
 Indicate whether the specified types and qualifiers are identical.
 
bool operator!= (const QualType &LHS, const QualType &RHS)
 
bool operator< (const QualType &LHS, const QualType &RHS)
 

Detailed 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.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 737 of file Type.h.

Member Enumeration Documentation

◆ DestructionKind

Enumerator
DK_none 
DK_cxx_destructor 
DK_objc_strong_lifetime 
DK_objc_weak_lifetime 
DK_nontrivial_c_struct 

Definition at line 1311 of file Type.h.

◆ NonConstantStorageReason

Enumerator
MutableField 
NonConstNonReferenceType 
NonTrivialCtor 
NonTrivialDtor 

Definition at line 821 of file Type.h.

◆ PrimitiveCopyKind

Enumerator
PCK_Trivial 

The type does not fall into any of the following categories.

Note that this case is zero-valued so that values of this enum can be used as a boolean condition for non-triviality.

PCK_VolatileTrivial 

The type would be trivial except that it is volatile-qualified.

Types that fall into one of the other non-trivial cases may additionally be volatile-qualified.

PCK_ARCStrong 

The type is an Objective-C retainable pointer type that is qualified with the ARC __strong qualifier.

PCK_ARCWeak 

The type is an Objective-C retainable pointer type that is qualified with the ARC __weak qualifier.

PCK_Struct 

The type is a struct containing a field whose type is neither PCK_Trivial nor PCK_VolatileTrivial.

Note that a C++ struct type does not necessarily match this; C++ copying semantics are too complex to express here, in part because they depend on the exact constructor or assignment operator that is chosen by overload resolution to do the copy.

Definition at line 1270 of file Type.h.

◆ PrimitiveDefaultInitializeKind

Enumerator
PDIK_Trivial 

The type does not fall into any of the following categories.

Note that this case is zero-valued so that values of this enum can be used as a boolean condition for non-triviality.

PDIK_ARCStrong 

The type is an Objective-C retainable pointer type that is qualified with the ARC __strong qualifier.

PDIK_ARCWeak 

The type is an Objective-C retainable pointer type that is qualified with the ARC __weak qualifier.

PDIK_Struct 

The type is a struct containing a field whose type is not PCK_Trivial.

Definition at line 1244 of file Type.h.

Constructor & Destructor Documentation

◆ QualType() [1/3]

clang::QualType::QualType ( )
default

Referenced by getLocalUnqualifiedType().

◆ QualType() [2/3]

clang::QualType::QualType ( const Type Ptr,
unsigned  Quals 
)
inline

Definition at line 761 of file Type.h.

◆ QualType() [3/3]

clang::QualType::QualType ( const ExtQuals Ptr,
unsigned  Quals 
)
inline

Definition at line 762 of file Type.h.

Member Function Documentation

◆ addConst()

void clang::QualType::addConst ( )
inline

◆ addFastQualifiers()

void clang::QualType::addFastQualifiers ( unsigned  TQs)
inline

Definition at line 975 of file Type.h.

References clang::Qualifiers::FastMask.

Referenced by addConst(), addRestrict(), addVolatile(), and withFastQualifiers().

◆ addRestrict()

void clang::QualType::addRestrict ( )
inline

Add the restrict qualifier to this QualType.

Definition at line 964 of file Type.h.

References addFastQualifiers(), and clang::Qualifiers::Restrict.

Referenced by emitReduceInitFunction(), and clang::CXXMethodDecl::getThisType().

◆ addVolatile()

void clang::QualType::addVolatile ( )
inline

Add the volatile type qualifier to this QualType.

Definition at line 956 of file Type.h.

References addFastQualifiers(), and clang::Qualifiers::Volatile.

Referenced by getSubobjectType(), and clang::Sema::LookupSpecialMember().

◆ dump() [1/3]

LLVM_DUMP_METHOD void QualType::dump ( ) const

Definition at line 185 of file ASTDumper.cpp.

References clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().

Referenced by dump().

◆ dump() [2/3]

void QualType::dump ( const char *  s) const

Definition at line 179 of file ASTDumper.cpp.

References dump().

Referenced by clang::CanQual< T >::dump().

◆ dump() [3/3]

LLVM_DUMP_METHOD void QualType::dump ( llvm::raw_ostream &  OS,
const ASTContext Context 
) const

◆ getAddressSpace()

LangAS clang::QualType::getAddressSpace ( ) const
inline

Return the address space of this type.

Definition at line 7027 of file Type.h.

Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::AddInitializerToDecl(), AdjustAddressSpaceForBuiltinOperandType(), clang::Sema::BuildAddressSpaceAttr(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildCallExpr(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildObjCExceptionDecl(), clang::Sema::CheckAllocatedType(), clang::Sema::CheckAssignmentConstraints(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckFunctionReturnType(), clang::Sema::CheckParameter(), clang::Sema::CheckVariableDeclarationType(), clang::CodeGen::CodeGenTypes::ConvertType(), DeduceTemplateArgumentsByTypeMatch(), diagnoseOpenCLTypes(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalVar(), clang::CodeGen::CodeGenModule::GetAddrOfMSGuidDecl(), clang::CodeGen::CodeGenModule::GetAddrOfTemplateParamObject(), clang::CodeGen::CodeGenModule::GetAddrOfUnnamedGlobalConstantDecl(), clang::ASTContext::getAddrSpaceQualType(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), clang::CodeGen::CodeGenModule::GetGlobalVarAddressSpace(), getLambdaType(), getOpenCLKernelParameterType(), clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal(), clang::CodeGen::CodeGenModule::getOrCreateStaticVarDecl(), clang::CodeGen::CodeGenTypes::getTargetAddressSpace(), clang::ASTContext::getTargetNullPointerValue(), IsAddressSpaceConversion(), clang::Expr::isNullPointerConstant(), isValidSwiftContextType(), isValidSwiftIndirectResultType(), isWebAssemblyFuncrefType(), clang::InitializationSequence::Perform(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformImplicitObjectArgumentInitialization(), clang::Sema::PerformObjectMemberConversion(), clang::Sema::PerformQualificationConversion(), clang::Sema::PrepareScalarCast(), clang::TreeTransform< Derived >::RebuildQualifiedType(), clang::ASTContext::removePtrSizeAddrSpace(), rewriteBuiltinFunctionDecl(), clang::CodeGen::ConstantEmitter::tryEmitForInitializer(), and TryReinterpretCast().

◆ getAsOpaquePtr()

void * clang::QualType::getAsOpaquePtr ( ) const
inline

Definition at line 784 of file Type.h.

Referenced by clang::Sema::ActOnTemplateTypeArgument(), clang::CodeGen::CGDebugInfo::completeClass(), clang::CodeGen::CGDebugInfo::completeType(), clang::CodeGen::CGDebugInfo::completeUnusedClass(), clang::CodeGen::CGDebugInfo::EmitGlobalVariable(), clang::CodeGen::CGDebugInfo::finalize(), clang::CanQual< T >::getAsOpaquePtr(), llvm::DenseMapInfo< clang::QualType >::getHashValue(), clang::serialization::UnsafeQualTypeDenseMapInfo::getHashValue(), clang::CodeGen::CGDebugInfo::getOrCreateStandaloneType(), clang::Sema::LookupQualifiedName(), clang::QualTypeOrdering::operator()(), clang::operator<<(), ProcessAPINotes(), Profile(), clang::AutoType::Profile(), clang::DependentVectorType::Profile(), clang::DependentSizedMatrixType::Profile(), clang::DependentSizedExtVectorType::Profile(), clang::DependentSizedArrayType::Profile(), clang::DependentAddressSpaceType::Profile(), clang::ConstantArrayType::Profile(), clang::ObjCTypeParamType::Profile(), clang::AttributedType::Profile(), clang::ObjCObjectTypeImpl::Profile(), clang::DependentUnaryTransformType::Profile(), clang::VectorType::Profile(), clang::ConstantMatrixType::Profile(), clang::IncompleteArrayType::Profile(), clang::AdjustedType::Profile(), clang::PackExpansionType::Profile(), clang::PointerType::Profile(), clang::BlockPointerType::Profile(), clang::MemberPointerType::Profile(), clang::ReferenceType::Profile(), clang::FunctionNoProtoType::Profile(), clang::ObjCObjectPointerType::Profile(), clang::AtomicType::Profile(), clang::PipeType::Profile(), clang::TemplateParamObjectDecl::Profile(), clang::BTFTagAttributedType::Profile(), clang::DeducedTemplateSpecializationType::Profile(), clang::StandardConversionSequence::setAllToTypes(), clang::AmbiguousConversionSequence::setFromType(), clang::BadConversionSequence::setFromType(), clang::TemplateArgument::setIntegralType(), clang::ObjCMessageExpr::setSuper(), clang::AmbiguousConversionSequence::setToType(), clang::BadConversionSequence::setToType(), clang::StandardConversionSequence::setToType(), clang::JSONNodeDumper::Visit(), and clang::TextNodeDumper::Visit().

◆ getAsString() [1/4]

std::string QualType::getAsString ( ) const

◆ getAsString() [2/4]

std::string QualType::getAsString ( const PrintingPolicy Policy) const

Definition at line 2461 of file TypePrinter.cpp.

References getAsStringInternal().

◆ getAsString() [3/4]

std::string QualType::getAsString ( const Type ty,
Qualifiers  qs,
const PrintingPolicy Policy 
)
static

Definition at line 2467 of file TypePrinter.cpp.

References getAsStringInternal().

◆ getAsString() [4/4]

static std::string clang::QualType::getAsString ( SplitQualType  split,
const PrintingPolicy Policy 
)
inlinestatic

◆ getAsStringInternal() [1/3]

void QualType::getAsStringInternal ( const Type ty,
Qualifiers  qs,
std::string &  out,
const PrintingPolicy policy 
)
static

Definition at line 2495 of file TypePrinter.cpp.

◆ getAsStringInternal() [2/3]

static void clang::QualType::getAsStringInternal ( SplitQualType  split,
std::string &  out,
const PrintingPolicy policy 
)
inlinestatic

◆ getAsStringInternal() [3/3]

void QualType::getAsStringInternal ( std::string &  Str,
const PrintingPolicy Policy 
) const

◆ getAtomicUnqualifiedType()

QualType QualType::getAtomicUnqualifiedType ( ) const

◆ getBaseTypeIdentifier()

const IdentifierInfo * QualType::getBaseTypeIdentifier ( ) const

◆ getCanonicalType()

QualType clang::QualType::getCanonicalType ( ) const
inline

Definition at line 6954 of file Type.h.

References withFastQualifiers().

Referenced by clang::Sema::ActOnCXXTryBlock(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnOpenMPAlignedClause(), clang::Sema::ActOnOpenMPDeclareMapperDirective(), adjustReturnValue(), clang::CodeGen::CGOpenMPRuntimeGPU::adjustTargetSpecificDataForLambdas(), appendType(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P2(), clang::Sema::BuildExprRequirement(), clang::Sema::BuildReturnStmt(), buildUserDefinedMapperRef(), clang::ento::SymbolManager::canSymbolicate(), checkMappableExpressionList(), checkNoThrow(), checkOpenCLBlockArgs(), checkOpenCLEnqueueVariadicArgs(), clang::Sema::CheckSizelessVectorConditionalTypes(), clang::Sema::checkTypeSupport(), ConvertTypeToDiagnosticString(), clang::dataflow::copyRecord(), create_call_once(), clang::ConstructionContext::createFromLayers(), clang::Sema::CreateGenericSelectionExpr(), DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateSpecArguments(), diagnoseOpenCLTypes(), DiagnoseRecursiveConstFields(), clang::ento::SMTConv::doTypeConversion(), dumpMicrosoftThunkAdjustment(), emitBadConversionNotes(), emitReadOnlyPlacementAttrWarning(), EvaluateBuiltinClassifyType(), findSubobject(), fixVarDeclWithArray(), fixVariable(), clang::index::generateUSRForType(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), getAArch64LS(), getAArch64MTV(), getAArch64PBV(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getCanonicalType(), clang::ento::StoreManager::getLValueElement(), getNaiveStrategy(), getNDSWDS(), getOpenCLKernelParameterType(), clang::dataflow::DataflowAnalysisContext::getOrCreateNullPointerValue(), clang::ento::ObjCMethodCall::getRuntimeDefinition(), clang::ASTContext::getUnconstrainedType(), handleComplexFloatConversion(), handleDiagnoseAsBuiltinAttr(), handleMIGServerRoutineAttr(), clang::RecordType::hasConstFields(), clang::Sema::inferGslPointerAttribute(), clang::CFGCXXRecordTypedCall::isCXXRecordTypedCall(), clang::Decl::isFunctionPointerType(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), clang::ento::RetainSummaryManager::isKnownSmartPointer(), isLayoutCompatible(), clang::Sema::isOpenMPPrivateDecl(), IsOverloadOrOverrideImpl(), isPointerToConst(), IsStringInit(), isSubstitutedType(), clang::InitListExpr::isTransparent(), isTriviallyEqualityComparableType(), isValidSizelessVectorForConditionalCondition(), isValidVectorForConditionalCondition(), clang::Sema::LookupQualifiedName(), maybeRecoverWithZeroInitialization(), clang::CodeGen::CodeGenModule::MayDropFunctionReturn(), processImplicitMapsWithDefaultMappers(), clang::TemplateParamObjectDecl::Profile(), clang::DeducedTemplateSpecializationType::Profile(), clang::dataflow::recordsEqual(), REGISTER_MAP_WITH_PROGRAMSTATE(), clang::Sema::SemaBuiltinVectorMath(), SemaOpenCLBuiltinEnqueueKernel(), splitAccordingToPolicy(), SuggestInitializationFixit(), tryExtractInitializerFromList(), clang::Value::Value(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), and clang::ento::SValExplainer::VisitSymbolicRegion().

◆ getCVRQualifiers()

unsigned clang::QualType::getCVRQualifiers ( ) const
inline

◆ getDesugaredType()

QualType clang::QualType::getDesugaredType ( const ASTContext Context) const
inline

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.

Definition at line 1088 of file Type.h.

References getDesugaredType().

Referenced by clang::Sema::ActOnFields(), clang::Sema::DiagnoseInvalidExplicitObjectParameterInLambda(), clang::ento::TypedRegion::getDesugaredLocationType(), getDesugaredType(), clang::ento::TypedValueRegion::getDesugaredValueType(), clang::Sema::getMessageSendResultType(), isGRealloc(), isStandardRealloc(), and IsStructurallyEquivalent().

◆ getFromOpaquePtr()

static QualType clang::QualType::getFromOpaquePtr ( const void *  Ptr)
inlinestatic

◆ getLocalCVRQualifiers()

unsigned clang::QualType::getLocalCVRQualifiers ( ) const
inline

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.

Definition at line 889 of file Type.h.

References getLocalFastQualifiers().

Referenced by clang::Sema::CheckOverridingFunctionReturnType(), diagnoseRedundantReturnTypeQualifiers(), clang::CanQual< T >::getCVRQualifiers(), and TryObjectArgumentInitialization().

◆ getLocalFastQualifiers()

unsigned clang::QualType::getLocalFastQualifiers ( ) const
inline

◆ getLocalQualifiers()

Qualifiers clang::QualType::getLocalQualifiers ( ) const
inline

◆ getLocalUnqualifiedType()

QualType clang::QualType::getLocalUnqualifiedType ( ) const
inline

Return this type with all of the instance-specific qualifiers removed, but without removing any qualifiers that may have been applied through typedefs.

Definition at line 1017 of file Type.h.

References getTypePtr(), and QualType().

Referenced by clang::Sema::AttachBaseSpecifiers(), BuildSimilarlyQualifiedPointerType(), clang::ento::StoreManager::castRegion(), DiagnoseNarrowingInInitList(), handleObjCExternallyRetainedAttr(), IsStandardConversion(), clang::ProgramPoint::printJson(), and TryObjectArgumentInitialization().

◆ getNonLValueExprType()

QualType QualType::getNonLValueExprType ( const ASTContext Context) const

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).

Definition at line 3403 of file Type.cpp.

References clang::ASTContext::getLangOpts(), clang::Type::getPointeeType(), getTypePtr(), getUnqualifiedType(), and isRecordType().

Referenced by clang::Sema::ActOnOpenMPLoopInitialization(), clang::Sema::AddConversionCandidate(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildCXXMemberCallExpr(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildLiteralOperatorCall(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildVAArgExpr(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckTemplateArgument(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), EvaluateBinaryTypeTrait(), EvaluateBooleanTypeTrait(), findOMPAllocatorHandleT(), clang::FunctionType::getCallResultType(), clang::ObjCMethodDecl::getSendResultType(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), clang::Sema::PerformImplicitConversion(), TryClassUnification(), and TryRefInitWithConversionFunction().

◆ getNonPackExpansionType()

QualType QualType::getNonPackExpansionType ( ) const

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.

Definition at line 3396 of file Type.cpp.

References getTypePtr().

◆ getNonReferenceType()

QualType clang::QualType::getNonReferenceType ( ) const
inline

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.

Definition at line 7102 of file Type.h.

References clang::Type::getPointeeType().

Referenced by actOnOMPReductionKindClause(), clang::Sema::ActOnOpenMPAlignedClause(), clang::Sema::ActOnOpenMPCopyinClause(), clang::Sema::ActOnOpenMPDependClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnOpenMPLastprivateClause(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::ActOnParamDefaultArgumentError(), clang::Sema::ActOnPropertyImplDecl(), clang::Sema::AddConversionCandidate(), AddObjCKeyValueCompletions(), clang::CodeGen::CGOpenMPRuntimeGPU::adjustTargetSpecificDataForLambdas(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCallToObjectOfClassType(), buildCapture(), clang::Sema::BuildCXXForRangeStmt(), clang::Sema::BuildCXXTypeConstructExpr(), buildDeclareReductionRef(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), clang::Sema::BuildMemberReferenceExpr(), buildPromiseCall(), clang::Sema::BuiltinAddPointer(), clang::Sema::BuiltinDecay(), clang::Sema::BuiltinRemoveReference(), canCaptureVariableByCopy(), captureInBlock(), captureInLambda(), castToBase(), clang::CodeGen::CGOpenMPRuntime::checkAndEmitSharedLastprivateConditional(), checkCastFunctionType(), clang::Sema::CheckCompleteDecompositionDeclaration(), clang::Sema::CheckConditionVariable(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), checkMapConflicts(), checkOpenMPIterationSpace(), clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), CompleteNonViableCandidate(), clang::Sema::ConstantFoldAttrArgs(), create_call_once(), create_call_once_funcptr_call(), createObjCPropertyGetter(), createPrivatesRecordDecl(), DeduceNonTypeTemplateArgument(), clang::InitializationSequence::Diagnose(), diagnoseAmbiguousConversion(), clang::Sema::diagnoseARCUnbridgedCast(), DiagnoseBadConversion(), DiagnoseForRangeReferenceVariableCopies(), clang::Sema::DiagnoseInvalidExplicitObjectParameterInLambda(), DiagnoseNarrowingInInitList(), diagnoseNoViableConversion(), clang::Sema::DiagnosePropertyAccessorMismatch(), DiagnoseUninitializedReference(), emitBadConversionNotes(), emitCPPObjectAtomicSetterCall(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalFinalUpdate(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalInit(), emitPreCond(), clang::Sema::EmitRelatedResultTypeNote(), emitStructSetterCall(), emitTaskPrivateMappingFunction(), clang::Sema::EndOpenMPDSABlock(), EvaluateBinaryTypeTrait(), EvaluateBooleanTypeTrait(), FindConversionForRefInit(), GetAlignOfType(), getAsRecordDecl(), getCanonicalParamType(), clang::CFGImplicitDtor::getDestructorDecl(), clang::CXXMethodDecl::getFunctionObjectParameterType(), clang::Sema::getNamedReturnInfo(), clang::UnresolvedMemberExpr::getNamingClass(), clang::CodeGen::CodeGenModule::getOMPAllocateAlignment(), getParamType(), clang::dataflow::DataflowAnalysisContext::getStableStorageLocation(), clang::CXXTypeidExpr::getTypeOperand(), clang::CXXUuidofExpr::getTypeOperand(), getVariableCategoryFromDecl(), clang::Sema::HandleFunctionTypeMismatch(), handleTrivialCopy(), hasCopyOrMoveCtorParam(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::interp::InterpretOffsetOf(), isAllowableExplicitConversion(), isFirstArgumentCompatibleWithType(), clang::Sema::isOpenMPCapturedByRef(), clang::Sema::isOpenMPCapturedDecl(), clang::Sema::isOpenMPPrivateDecl(), IsTypeModifiable(), clang::Sema::isValidPointerAttrType(), isVariableAlreadyCapturedInScopeInfo(), loadToBegin(), clang::InitializationSequence::Perform(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformImplicitConversion(), clang::APValue::printPretty(), clang::Sema::ProcessPropertyDecl(), recordConversion(), clang::Sema::tryCaptureVariable(), and TryObjectArgumentInitialization().

◆ getObjCGCAttr()

Qualifiers::GC clang::QualType::getObjCGCAttr ( ) const
inline

Returns gc attribute of this type.

Return the gc attribute of this type.

Definition at line 7032 of file Type.h.

Referenced by clang::ASTContext::getObjCGCAttrKind(), clang::ASTContext::getObjCGCQualType(), isObjCGCStrong(), and isObjCGCWeak().

◆ getObjCLifetime()

Qualifiers::ObjCLifetime clang::QualType::getObjCLifetime ( ) const
inline

Returns lifetime attribute of this type.

Definition at line 1229 of file Type.h.

References clang::Qualifiers::getObjCLifetime(), and getQualifiers().

Referenced by clang::Sema::ActOnFields(), clang::Sema::ActOnProperty(), clang::Sema::ActOnPropertyImplDecl(), clang::Sema::AddInitializerToDecl(), clang::Sema::AdjustParameterTypeForObjCAutoRefCount(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildDeclRefExpr(), clang::Sema::BuildInstanceMessage(), clang::Sema::BuildIvarRefExpr(), clang::Sema::BuildPseudoDestructorExpr(), captureInBlock(), captureInLambda(), checkAllAtProps(), clang::Sema::CheckAllocatedType(), checkARCPropertyImpl(), clang::Sema::CheckAssignmentOperands(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::checkIllFormedTrivialABIStruct(), clang::Sema::CheckObjCARCUnavailableWeakConversion(), clang::Sema::CheckObjCConversion(), clang::Sema::CheckParameter(), clang::Sema::CheckTemplateTypeArgument(), checkTrivialClassMembers(), clang::Sema::checkUnsafeAssigns(), clang::Sema::checkUnsafeExprAssigns(), considerVariable(), deducePropertyOwnershipFromType(), clang::Sema::DefaultLvalueConversion(), DiagnoseRetainableFlexibleArrayMember(), EmitObjectDelete(), EvaluateUnaryTypeTrait(), findRetainCycleOwner(), clang::ASTContext::getByrefLifetime(), GetGCAttrTypeForType(), clang::ASTContext::getInnerObjCOwnership(), handleObjCPreciseLifetimeAttr(), clang::Sema::HandlePropertyInClassExtension(), inferARCWriteback(), isCanonicalResultType(), isInvalidICRSource(), isNonTrivialToPrimitiveDefaultInitialize(), isNonWeakInMRRWithObjCWeak(), LookupMemberExpr(), PropertyMemoryAttribute(), pushTemporaryCleanup(), clang::TreeTransform< Derived >::RebuildQualifiedType(), setImpliedPropertyAttributeForReadOnlyProperty(), shouldExtendReceiverForInnerPointerMessage(), transferARCOwnershipToDeclSpec(), and tryEmitARCCopyWeakInit().

◆ getQualifiers()

Qualifiers clang::QualType::getQualifiers ( ) const
inline

Retrieve the set of qualifiers applied to this type.

Definition at line 6942 of file Type.h.

References clang::Qualifiers::addFastQualifiers().

Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnFields(), clang::Sema::actOnObjCTypeParam(), AddRecordMembersCompletionResults(), AdoptQualifiers(), applyObjCTypeArgs(), clang::ASTContext::BlockRequiresCopying(), clang::Sema::BuildCallExpr(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildDeclRefExpr(), clang::Sema::BuildFieldReferenceExpr(), BuildImplicitBaseInitializer(), clang::Sema::BuildMemberExpr(), BuildSimilarlyQualifiedPointerType(), clang::Sema::BuiltinChangeSignedness(), clang::Sema::CheckAllocatedType(), checkComplexDecomposition(), checkConditionalObjectPointersCompatibility(), checkConditionalPointerCompatibility(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), checkMemberDecomposition(), CheckOriginalCallArgDeduction(), clang::Sema::CheckPointerToMemberOperands(), checkVectorDecomposition(), computeCopyInfoForBlockCapture(), computeDestroyInfoForBlockCapture(), clang::CodeGen::CodeGenFunction::CreateAggTemp(), clang::Sema::CreateBuiltinArraySubscriptExpr(), createPlaceholderSlot(), decomposeTypeForEH(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), clang::InitializationSequence::Diagnose(), clang::Sema::DiagnoseAssignmentResult(), DiagnoseUninitializedUse(), emitBadConversionNotes(), EmitDeclDestroy(), clang::CodeGen::CGObjCRuntime::EmitInitOfCatchParam(), emitInitWithReductionInitializer(), EmitOMPAggregateInit(), EmitValToTemp(), clang::Sema::FindCompositeObjCPointerType(), fixParamWithSpan(), GetAlignOfType(), getCommonArrayElementType(), clang::ASTContext::getDeclAlign(), GetFullTypeForDeclarator(), clang::TypeName::getFullyQualifiedType(), clang::CodeGen::CodeGenModule::getNaturalTypeAlignment(), getObjCLifetime(), getPointeeTypeText(), clang::ASTContext::getUnconstrainedType(), handleObjCExternallyRetainedAttr(), hasInconsistentOrSupersetQualifiersOf(), hasMangledSubstitutionQualifiers(), hasNonTrivialObjCLifetime(), hasStrongOrWeakObjCLifetime(), isAddressSpaceOverlapping(), isAtLeastAsQualifiedAs(), isMoreQualifiedThan(), isNonTrivialToPrimitiveCopy(), isNonTrivialToPrimitiveDefaultInitialize(), clang::Expr::isNullPointerConstant(), clang::Sema::isObjCPointerConversion(), clang::Sema::isObjCWritebackConversion(), isQualificationConversionStep(), IsStructurallyEquivalent(), isSubstitutedType(), isValidSwiftErrorResultType(), clang::ASTContext::mergeTypes(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformImplicitObjectArgumentInitialization(), clang::TreeTransform< Derived >::RebuildQualifiedType(), clang::Sema::RefersToMemberWithReducedAlignment(), RemoveAddressSpaceFromPtr(), ResolveConstructorOverload(), rewriteToObjCProperty(), StoreAnyExprIntoOneUnit(), TryDefaultInitialization(), tryMakeVariablePseudoStrong(), TryObjectArgumentInitialization(), TryReferenceInit(), TryReferenceInitializationCore(), TryRefInitWithConversionFunction(), TryReinterpretCast(), TryStaticCast(), TryUserDefinedConversion(), TypeInfoIsInStandardLibrary(), and withoutUnaligned().

◆ getSingleStepDesugaredType()

QualType clang::QualType::getSingleStepDesugaredType ( const ASTContext Context) const
inline

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.

Definition at line 1101 of file Type.h.

Referenced by captureVariablyModifiedType(), computeConditionalNullability(), isOpenCLSizeDependentType(), and clang::ASTContext::removeAddrSpaceQualType().

◆ getSplitDesugaredType()

SplitQualType clang::QualType::getSplitDesugaredType ( ) const
inline

◆ getSplitUnqualifiedType()

SplitQualType clang::QualType::getSplitUnqualifiedType ( ) const
inline

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.

Definition at line 7002 of file Type.h.

Referenced by clang::Sema::BuildQualifiedType(), and clang::Sema::BuiltinDecay().

◆ getTypePtr()

const Type * clang::QualType::getTypePtr ( ) const
inline

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) getTypePtrOrNull().

Definition at line 6902 of file Type.h.

Referenced by clang::Sema::ActOnCastExpr(), clang::Sema::ActOnFields(), clang::Sema::ActOnOpenMPDependClause(), clang::Sema::ActOnPseudoDestructorExpr(), addAssociatedClassesAndNamespaces(), clang::ASTContext::adjustObjCTypeParamBoundType(), clang::interp::ByteCodeExprGen< Emitter >::allocateLocal(), BuildConvertedConstantExpression(), clang::Sema::BuildCXXNamedCast(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), buildSingleCopyAssignRecursively(), captureVariablyModifiedType(), clang::Sema::CheckAddressOfOperand(), checkArrayExpressionDoesNotReferToUnitySize(), checkArrayExpressionDoesNotReferToWholeSize(), clang::Sema::CheckCXXThrowOperand(), CheckImplicitConversion(), checkIsValidOpenCLKernelParameter(), checkNoThrow(), CheckNullabilityTypeSpecifier(), clang::Sema::CheckObjCConversion(), clang::Sema::checkOpenMPDeclareVariantFunction(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::CodeCompleteMemberReferenceExpr(), clang::EnumDecl::completeDefinition(), clang::LinkageComputer::computeTypeLinkageInfo(), clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::ObjCTypeParamDecl::Create(), clang::TemplateTypeParmDecl::Create(), clang::interp::Program::createDescriptor(), clang::CodeGen::CodeGenModule::createOpenCLIntToSamplerConversion(), clang::Sema::DiagnoseUnusedButSetDecl(), clang::CodeGen::CodeGenModule::EmitVTableTypeMetadata(), clang::TypePropertyCache< Private >::ensure(), FindVA(), clang::Sema::FixOverloadedFunctionReference(), clang::TypePropertyCache< Private >::get(), clang::ASTContext::getAlignOfGlobalVar(), GetAlignOfType(), getAtomicUnqualifiedType(), getBaseTypeIdentifier(), clang::ASTContext::getCanonicalParamType(), clang::ASTContext::getCanonicalType(), clang::CodeGen::CodeGenTypes::getCGRecordLayout(), getCommonNonSugarTypeNode(), clang::ASTContext::getCommonSugaredType(), getCurrentInstantiationOf(), clang::ASTContext::getDeclAlign(), clang::TypeName::getFullyQualifiedTemplateType(), clang::TypeName::getFullyQualifiedType(), clang::InjectedClassNameType::getInjectedTST(), getIntegerTypeForEnum(), getLocalUnqualifiedType(), clang::Sema::getMessageSendResultType(), getNonLValueExprType(), getNonPackExpansionType(), clang::interp::Program::getOrCreateRecord(), clang::ASTContext::getPreferredTypeAlign(), GetPrototypeLoc(), getRequiredQualification(), llvm::simplify_type< ::clang::QualType >::getSimplifiedValue(), getTypeAlignIfRequired(), clang::ASTContext::getTypeInfo(), clang::ASTContext::getTypeInfoInChars(), clang::LinkageComputer::getTypeLinkageAndVisibility(), GetTypeOfFunction(), clang::CanQual< T >::getTypePtr(), clang::TypeLoc::getTypePtr(), clang::ASTContext::getTypeUnadjustedAlign(), clang::ASTContext::getUsingType(), getUuidAttrOfType(), handleCallbackAttr(), clang::ASTNodeImporter::hasAutoReturnTypeDeclaredInside(), clang::ASTImporter::Import(), clang::Sema::inferGslPointerAttribute(), clang::ASTContext::isAlignmentRequired(), isCXX11PODType(), isCXX98PODType(), clang::CodeGen::ABIInfo::isHomogeneousAggregate(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), clang::Sema::IsMemberPointerConversion(), isNonTrivialToPrimitiveCopy(), isNonTrivialToPrimitiveDefaultInitialize(), clang::Type::isObjCARCImplicitlyUnretainedType(), IsOverloadOrOverrideImpl(), IsPossiblyOpaquelyQualifiedType(), clang::CodeGen::isSingleElementStruct(), IsStandardConversion(), clang::ASTImporter::IsStructurallyEquivalent(), isTrivialType(), isWebAssemblyExternrefType(), isWebAssemblyFuncrefType(), lookupPromiseType(), clang::serialization::MakeTypeID(), MarkUsedTemplateParameters(), clang::Sema::MaybeBindToTemporary(), mayBeDynamicClass(), mayBeNotDynamicClass(), maybeTailCall(), clang::ASTContext::mergeObjCGCQualifiers(), clang::Sema::MergeTypedefNameDecl(), clang::ASTContext::mergeTypes(), clang::StmtIteratorBase::NextVA(), operator*(), operator->(), clang::InitializationSequence::Perform(), printIntegral(), processImplicitMapsWithDefaultMappers(), rebuildAttributedTypeWithoutNullability(), clang::CodeGen::CodeGenTypes::RefreshTypeCacheForClass(), clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition(), typeIsPostfix(), UnwrapTypeForDebugInfo(), clang::CodeGen::CodeGenTypes::UpdateCompletedType(), UseExcessPrecision(), and clang::Value::Value().

◆ getTypePtrOrNull()

const Type * clang::QualType::getTypePtrOrNull ( ) const
inline

◆ getUnqualifiedType()

QualType clang::QualType::getUnqualifiedType ( ) const
inline

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:

typedef int Integer;
typedef const Integer CInteger;
typedef CInteger DifferenceType;

Executing getUnqualifiedType() on the type DifferenceType will desugar until we hit the type 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 C23 6.2.5p32 for details), and it is not stripped by this function. Use getAtomicUnqualifiedType() to strip qualifiers including _Atomic.

Definition at line 6995 of file Type.h.

Referenced by clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnCXXTryBlock(), clang::Sema::actOnObjCTypeParam(), clang::Sema::ActOnOpenMPAlignedClause(), clang::Sema::ActOnOpenMPCopyinClause(), clang::Sema::ActOnOpenMPCopyprivateClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::ActOnStmtExprResult(), clang::Sema::AddConversionCandidate(), AdjustFunctionParmAndArgTypesForDeduction(), AdoptQualifiers(), applyObjCTypeArgs(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildBinOp(), clang::Sema::BuildCallToMemberFunction(), buildDeclareReductionRef(), BuildImplicitBaseInitializer(), BuildSimilarlyQualifiedPointerType(), buildUserDefinedMapperRef(), canConvertIntToOtherIntTy(), canConvertIntTyToFloatTy(), captureInCapturedRegion(), clang::Sema::CheckAllocatedType(), clang::Sema::CheckAssignmentOperands(), checkBlockPointerTypesForAssignment(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckConditionalOperands(), checkConditionalPointerCompatibility(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), CheckIncrementDecrementOperand(), clang::Sema::CheckLiteralOperatorDeclaration(), clang::Sema::CheckMatrixElementwiseOperands(), clang::Sema::CheckMatrixMultiplyOperands(), clang::Sema::CheckNonTypeTemplateParameterType(), clang::Sema::checkOpenMPDeclareVariantFunction(), CheckOriginalCallArgDeduction(), checkPointerAuthValue(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckSizelessVectorConditionalTypes(), clang::Sema::CheckSizelessVectorOperands(), clang::Sema::CheckSubtractionOperands(), clang::Sema::CheckTemplateArgument(), checkTrivialSubobjectCall(), clang::Sema::checkTypeSupport(), clang::Sema::CheckVectorConditionalTypes(), clang::Sema::CheckVectorOperands(), CompareDerivedToBaseConversions(), CompareStandardConversionSequences(), clang::dataflow::copyRecord(), decomposeTypeForEH(), DeduceNonTypeTemplateArgument(), clang::Sema::DeduceTemplateArguments(), DeduceTemplateArguments(), clang::Sema::DefaultLvalueConversion(), clang::Sema::DiagnoseAssignmentEnum(), clang::Sema::DiagnoseAssignmentResult(), DiagnoseBadFunctionCast(), DiagnoseCastOfObjCSEL(), DiagnoseFloatingImpCast(), clang::Sema::DiagnoseInvalidExplicitObjectParameterInLambda(), FindConversionForRefInit(), FormatFunctionParameter(), getAtomicUnqualifiedType(), clang::Sema::getDecltypeForExpr(), clang::ASTContext::getExceptionObjectType(), getNonLValueExprType(), clang::SubstNonTypeTemplateParmExpr::getParameterType(), clang::ASTContext::getSignatureParameterType(), clang::CXXBaseSpecifier::getType(), handleDiagnoseAsBuiltinAttr(), HandleDynamicCast(), clang::Sema::IsBlockPointerConversion(), clang::Sema::isInitListConstructor(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), isLayoutCompatible(), clang::Sema::isObjCWritebackConversion(), isOpenCLSizeDependentType(), clang::Sema::IsQualificationConversion(), clang::ento::cocoa::isRefType(), IsStandardConversion(), isValidInteropVariable(), IsVoidStarType(), maybeAdjustInterfaceForSubscriptingCheck(), clang::ASTContext::mergeFunctionTypes(), clang::ASTContext::mergeTypes(), OpenCLConvertScalarsToVectors(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformImplicitConversion(), print_elem(), clang::TemplateParamObjectDecl::printAsExpr(), clang::TreeTransform< Derived >::RebuildQualifiedType(), clang::dataflow::recordsEqual(), RemoveAddressSpaceFromPtr(), ResolveOverloadedFunctionForReferenceBinding(), rewriteToObjCProperty(), SemaOpenCLBuiltinEnqueueKernel(), SemaOpenCLBuiltinNDRangeAndBlock(), clang::Sema::tryCaptureVariable(), TryLValueToRValueCast(), TryRefInitWithConversionFunction(), TryStaticDowncast(), TryUserDefinedConversion(), TypeIsInnerPointer(), and clang::Sema::UsualArithmeticConversions().

◆ hasAddressSpace()

bool clang::QualType::hasAddressSpace ( ) const
inline

◆ hasLocalNonFastQualifiers()

bool clang::QualType::hasLocalNonFastQualifiers ( ) const
inline

Determine whether this particular QualType instance has any "non-fast" qualifiers, e.g., those that are stored in an ExtQualType instance.

Definition at line 874 of file Type.h.

Referenced by hasLocalQualifiers(), and clang::serialization::MakeTypeID().

◆ hasLocalQualifiers()

bool clang::QualType::hasLocalQualifiers ( ) const
inline

◆ hasNonTrivialObjCLifetime()

bool clang::QualType::hasNonTrivialObjCLifetime ( ) const
inline

◆ hasNonTrivialToPrimitiveCopyCUnion()

bool clang::QualType::hasNonTrivialToPrimitiveCopyCUnion ( ) const
inline

◆ hasNonTrivialToPrimitiveDefaultInitializeCUnion()

bool clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion ( ) const
inline

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.

Definition at line 7036 of file Type.h.

References getAsRecordDecl().

Referenced by clang::Sema::ActOnFields(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::checkNonTrivialCUnion(), and clang::Sema::checkNonTrivialCUnionInInitializer().

◆ hasNonTrivialToPrimitiveDestructCUnion()

bool clang::QualType::hasNonTrivialToPrimitiveDestructCUnion ( ) const
inline

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.

Definition at line 7042 of file Type.h.

References getAsRecordDecl().

Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnFields(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::CheckFunctionReturnType(), clang::Sema::CheckLValueToRValueConversionOperand(), clang::Sema::checkNonTrivialCUnion(), clang::Sema::CheckParameter(), and markEscapingByrefs().

◆ hasQualifiers()

bool clang::QualType::hasQualifiers ( ) const
inline

◆ hasStrongOrWeakObjCLifetime()

bool clang::QualType::hasStrongOrWeakObjCLifetime ( ) const
inline

Definition at line 1237 of file Type.h.

References getQualifiers(), and clang::Qualifiers::hasStrongOrWeakObjCLifetime().

◆ IgnoreParens()

QualType clang::QualType::IgnoreParens ( ) const
inline

Returns the specified type after dropping any outer-level parentheses.

Definition at line 1107 of file Type.h.

References IgnoreParens().

Referenced by checkQualifiedFunction(), and IgnoreParens().

◆ isAddressSpaceOverlapping()

bool clang::QualType::isAddressSpaceOverlapping ( QualType  T) const
inline

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.

Definition at line 1208 of file Type.h.

References getQualifiers(), and clang::Qualifiers::isAddressSpaceSupersetOf().

Referenced by checkArithmeticBinOpPointerOperands(), and clang::Sema::CheckCompareOperands().

◆ isAtLeastAsQualifiedAs()

bool clang::QualType::isAtLeastAsQualifiedAs ( QualType  other) const
inline

Determine whether this type is at least as qualified as the other given type, requiring exact equality for non-CVR qualifiers.

Determine whether this type is at last as qualified as the Other type.

For example, "const volatile int" is at least as qualified as "const int", "volatile int", "int", and "const volatile int".

Definition at line 7083 of file Type.h.

References getQualifiers(), and clang::Qualifiers::removeUnaligned().

Referenced by checkObjCPointerTypesForAssignment(), clang::CanQual< T >::isAtLeastAsQualifiedAs(), clang::Sema::isObjCPointerConversion(), TryClassUnification(), and TryObjectArgumentInitialization().

◆ isCanonical()

bool clang::QualType::isCanonical ( ) const
inline

◆ isCanonicalAsParam()

bool clang::QualType::isCanonicalAsParam ( ) const
inline

◆ isCForbiddenLValueType()

bool clang::QualType::isCForbiddenLValueType ( ) const
inline

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.

Definition at line 7109 of file Type.h.

Referenced by clang::Sema::CreateBuiltinArraySubscriptExpr(), and clang::ento::ExprEngine::VisitArraySubscriptExpr().

◆ isConstant()

bool clang::QualType::isConstant ( const ASTContext Ctx) const
inline

◆ isConstantStorage()

bool clang::QualType::isConstantStorage ( const ASTContext Ctx,
bool  ExcludeCtor,
bool  ExcludeDtor 
)
inline

◆ isConstQualified()

bool clang::QualType::isConstQualified ( ) const
inline

Determine whether this type is const-qualified.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 6974 of file Type.h.

Referenced by clang::Sema::ActOnEndOfTranslationUnit(), clang::Sema::ActOnFinishFunctionBody(), clang::Sema::ActOnObjCForCollectionStmt(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::AddInitializerToDecl(), clang::Sema::AdjustParameterTypeForObjCAutoRefCount(), alignReferenceTypes(), clang::interp::ByteCodeExprGen< Emitter >::allocateLocal(), appendQualifier(), basicGVALinkageForVariable(), clang::Sema::BuildAtomicExpr(), BuildImplicitMemberInitializer(), buildSingleCopyAssign(), clang::Sema::BuiltinRemoveReference(), captureInCapturedRegion(), clang::Sema::CheckCompleteVariableDeclaration(), clang::interp::CheckConstant(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), clang::Sema::CheckFieldDecl(), CheckForModifiableLvalue(), clang::Sema::CheckLiteralOperatorDeclaration(), clang::Sema::CheckParameter(), CheckTemporary(), clang::Sema::CheckVariableDeclarationType(), decomposeTypeForEH(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseForRangeVariableCopies(), diagnoseOpenCLTypes(), DiagnoseRecursiveConstFields(), clang::Sema::DiagnoseSwiftName(), emitReadOnlyPlacementAttrWarning(), clang::ento::ExprEngine::evalCall(), evaluateLValueAsAllocSize(), EvaluateUnaryTypeTrait(), findSubobject(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), clang::CodeGen::CodeGenModule::GetGlobalVarAddressSpace(), clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal(), clang::interp::Program::getOrCreateRecord(), getSubobjectType(), clang::ento::MemRegionManager::getVarRegion(), clang::consumed::ConsumedStmtVisitor::handleCall(), clang::Sema::handlerCanCatch(), clang::RecordType::hasConstFields(), clang::Sema::IdentifyCUDATarget(), isPointerToConst(), isReferenceToNonConstCapture(), IsTypeModifiable(), isVoidPointerToNonConst(), lifetimeStartedInEvaluation(), MarkVarDeclODRUsed(), clang::analyze_format_string::ArgType::matchesType(), clang::Sema::MaybeAddCUDAConstantAttr(), ShouldDiagnoseSwitchCaseNotInEnum(), clang::Sema::SpecialMemberIsTrivial(), clang::Sema::tryCaptureVariable(), TryConstructorInitialization(), TryDefaultInitialization(), TryListConversion(), TryReferenceInit(), tryRemoveRetainOfSelf(), visitLocalsRetainedByInitializer(), clang::ento::UndefOrNullArgVisitor::VisitNode(), and clang::interp::ByteCodeExprGen< Emitter >::visitVarDecl().

◆ isCXX11PODType()

bool QualType::isCXX11PODType ( const ASTContext Context) const

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.

Definition at line 2946 of file Type.cpp.

References clang::Type::getAs(), clang::Type::getBaseElementTypeUnsafe(), getTypePtr(), hasNonTrivialObjCLifetime(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Type::isScalarType(), clang::Type::isSizelessBuiltinType(), and clang::Type::isVectorType().

Referenced by isPODType().

◆ isCXX98PODType()

bool QualType::isCXX98PODType ( const ASTContext Context) const

Return true if this is a POD type according to the rules of the C++98 standard, regardless of the current compilation's language.

Definition at line 2518 of file Type.cpp.

References clang::ASTContext::getBaseElementType(), clang::Type::getTypeClass(), getTypePtr(), hasNonTrivialObjCLifetime(), isCXX98PODType(), and isNull().

Referenced by isCXX98PODType(), isPODType(), and clang::Sema::isValidVarArgType().

◆ isDestructedType()

DestructionKind clang::QualType::isDestructedType ( ) const
inline

◆ isLocalConstQualified()

bool clang::QualType::isLocalConstQualified ( ) const
inline

Determine whether this particular QualType instance has the "const" qualifier set, without looking through typedefs that may have added "const" at a different level.

Definition at line 814 of file Type.h.

References clang::Qualifiers::Const, and getLocalFastQualifiers().

Referenced by clang::CanQual< T >::isConstQualified().

◆ isLocalRestrictQualified()

bool clang::QualType::isLocalRestrictQualified ( ) const
inline

Determine whether this particular QualType instance has the "restrict" qualifier set, without looking through typedefs that may have added "restrict" at a different level.

Definition at line 844 of file Type.h.

References getLocalFastQualifiers(), and clang::Qualifiers::Restrict.

Referenced by clang::CanQual< T >::isRestrictQualified().

◆ isLocalVolatileQualified()

bool clang::QualType::isLocalVolatileQualified ( ) const
inline

Determine whether this particular QualType instance has the "volatile" qualifier set, without looking through typedefs that may have added "volatile" at a different level.

Definition at line 854 of file Type.h.

References getLocalFastQualifiers(), and clang::Qualifiers::Volatile.

Referenced by clang::CanQual< T >::isVolatileQualified().

◆ isMoreQualifiedThan()

bool clang::QualType::isMoreQualifiedThan ( QualType  other) const
inline

Determine whether this type is more qualified than the other given type, requiring exact equality for non-CVR qualifiers.

Determine whether this type is more qualified than the Other type.

For example, "const volatile int" is more qualified than "const int", "volatile int", and "int". However, it is not more qualified than "const volatile int".

Definition at line 7073 of file Type.h.

References clang::Qualifiers::compatiblyIncludes(), and getQualifiers().

Referenced by buildDeclareReductionRef(), clang::Sema::CheckOverridingFunctionReturnType(), CompareStandardConversionSequences(), and clang::CanQual< T >::isMoreQualifiedThan().

◆ isNonConstantStorage()

std::optional< QualType::NonConstantStorageReason > QualType::isNonConstantStorage ( const ASTContext Ctx,
bool  ExcludeCtor,
bool  ExcludeDtor 
)

Determine whether instances of this type can be placed in immutable storage.

If ExcludeCtor is true, the duration when the object's constructor runs will not be considered. The caller will need to verify that the object is not written to during its construction. ExcludeDtor works similarly.

Definition at line 116 of file Type.cpp.

References clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), clang::ASTContext::getLangOpts(), isConstant(), MutableField, NonConstNonReferenceType, NonTrivialCtor, and NonTrivialDtor.

Referenced by clang::Sema::CheckCompleteVariableDeclaration(), and isConstantStorage().

◆ isNonTrivialToPrimitiveCopy()

QualType::PrimitiveCopyKind QualType::isNonTrivialToPrimitiveCopy ( ) const

◆ isNonTrivialToPrimitiveDefaultInitialize()

QualType::PrimitiveDefaultInitializeKind QualType::isNonTrivialToPrimitiveDefaultInitialize ( ) const

Functions to query basic properties of non-trivial C struct types.

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.

Definition at line 2791 of file Type.cpp.

References getObjCLifetime(), getQualifiers(), getTypePtr(), clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, PDIK_ARCStrong, PDIK_ARCWeak, PDIK_Struct, and PDIK_Trivial.

Referenced by clang::Sema::ActOnFields(), and clang::DefaultInitializedTypeVisitor< Derived, RetTy >::visit().

◆ isNonTrivialToPrimitiveDestructiveMove()

QualType::PrimitiveCopyKind QualType::isNonTrivialToPrimitiveDestructiveMove ( ) const

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.

Definition at line 2825 of file Type.cpp.

References isNonTrivialToPrimitiveCopy().

Referenced by clang::ASTContext::BlockRequiresCopying(), isTriviallyRelocatableType(), and clang::CopiedTypeVisitor< Derived, IsMove, RetTy >::visit().

◆ isNonWeakInMRRWithObjCWeak()

bool QualType::isNonWeakInMRRWithObjCWeak ( const ASTContext Context) const

◆ isNull()

bool clang::QualType::isNull ( ) const
inline

Return true if this QualType doesn't point to a type yet.

Examples
/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp.

Definition at line 804 of file Type.h.

Referenced by clang::Sema::ActOnArraySubscriptExpr(), clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnBuiltinOffsetOf(), clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnClassMessage(), clang::Sema::ActOnClassPropertyRefExpr(), clang::Sema::ActOnConditionalOp(), clang::Sema::ActOnCXXNestedNameSpecifier(), clang::Sema::ActOnCXXNestedNameSpecifierDecltype(), clang::Sema::ActOnCXXThis(), clang::Sema::ActOnCXXTypeid(), clang::Sema::ActOnCXXUuidof(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnGCCAsmStmt(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), clang::Sema::ActOnMethodDeclaration(), clang::Sema::ActOnNonTypeTemplateParameter(), clang::Sema::ActOnNumericConstant(), clang::Sema::ActOnObjCForCollectionStmt(), clang::Sema::actOnObjCTypeArgsAndProtocolQualifiers(), clang::Sema::actOnObjCTypeArgsOrProtocolQualifiers(), clang::Sema::ActOnOMPArraySectionExpr(), clang::Sema::ActOnOpenMPCall(), clang::Sema::ActOnOpenMPDeclareMapperType(), clang::Sema::ActOnOpenMPDeclareReductionType(), clang::Sema::ActOnOpenMPDependClause(), clang::Sema::ActOnOpenMPUsesAllocatorClause(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(), clang::Sema::ActOnSuperClassOfClassInterface(), clang::Sema::ActOnSuperMessage(), clang::Sema::ActOnSYCLUniqueStableNameExpr(), clang::Sema::ActOnTemplatedFriendTag(), clang::Sema::ActOnTemplateIdType(), clang::Sema::ActOnTemplateTypeArgument(), clang::Sema::ActOnTypenameType(), clang::Sema::ActOnTypeRequirement(), clang::Sema::ActOnUsingEnumDeclaration(), AddClassMessageCompletions(), addFlexibleArrayMemberInitSize(), clang::Sema::AddFunctionCandidates(), clang::Sema::AddInitializerToDecl(), clang::Sema::AddMethodCandidate(), clang::Sema::AddMethodTemplateCandidate(), clang::Sema::AddModeAttr(), AddObjCKeyValueCompletions(), AddOrdinaryNameResults(), clang::ODRHash::AddQualType(), AddResultTypeChunk(), addThisCompletion(), clang::Sema::adjustCCAndNoReturn(), AdjustFunctionParmAndArgTypesForDeduction(), allowAmbiguity(), clang::TreeTransform< Derived >::AlreadyTransformed(), clang::ASTContext::areCommonBaseCompatible(), assertEqualBitWidths(), clang::ento::ProgramState::assumeInBoundDual(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P_OVERLOAD(), clang::Sema::BuildClassMessageImplicit(), buildCoroutineHandle(), clang::Sema::buildCoroutinePromise(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildDeclaratorGroup(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildInstanceMessage(), clang::Sema::buildLambdaInitCaptureInitialization(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildObjCDictionaryLiteral(), clang::Sema::BuildObjCEncodeExpression(), clang::Sema::BuildObjCStringLiteral(), clang::Sema::BuildQualifiedType(), clang::Sema::BuildReturnStmt(), BuildSimilarlyQualifiedPointerType(), clang::Sema::BuildVAArgExpr(), clang::Sema::BuiltinChangeSignedness(), clang::arcmt::trans::canApplyWeak(), clang::Sema::canDelayFunctionBody(), clang::Sema::canThrow(), captureVariablyModifiedType(), clang::Sema::CheckAdditionOperands(), checkAllAtProps(), clang::Sema::CheckAssignmentOperands(), clang::Sema::CheckBitwiseOperands(), clang::Sema::CheckConditionalOperands(), checkConditionalPointerCompatibility(), checkDeducedTemplateArguments(), clang::Sema::CheckDestructorAccess(), clang::Sema::CheckEnumConstant(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::Sema::CheckFieldDecl(), CheckIncrementDecrementOperand(), clang::Sema::checkInitMethod(), CheckKeyForObjCARCConversion(), clang::Sema::CheckMultiplyDivideOperands(), clang::Sema::CheckNonDependentConversions(), clang::Sema::checkOpenMPDeclareVariantFunction(), clang::Sema::CheckOverridingFunctionReturnType(), clang::Sema::CheckRemainderOperands(), clang::Sema::CheckSizelessVectorCompareOperands(), clang::Sema::CheckSubtractionOperands(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateIdType(), checkTupleLikeDecomposition(), clang::Sema::CheckTypenameType(), clang::Sema::checkTypeSupport(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::CheckVectorCompareOperands(), clang::Sema::CheckVectorLogicalOperands(), chooseRecoveryType(), ClassifyImplicitMemberAccess(), clang::Sema::CodeCompleteDeclSpec(), clang::Sema::CodeCompleteDesignator(), clang::Sema::CodeCompleteMemberReferenceExpr(), clang::Sema::CodeCompleteObjCClassMessage(), clang::Sema::CodeCompleteObjCInstanceMessage(), clang::Sema::CodeCompleteObjCMethodDecl(), clang::Sema::CodeCompleteQualifiedId(), clang::Sema::containsUnexpandedParameterPacks(), convertPointersToCompositeType(), ConvertTypeToDiagnosticString(), create_call_once(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CreateBuiltinUnaryOp(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), clang::Sema::CreateRecoveryExpr(), clang::Sema::CXXCheckConditionalOperands(), decomposeTypeForEH(), clang::Sema::DeduceAutoType(), clang::Sema::deduceClosureReturnType(), clang::Sema::DeduceTemplateArguments(), clang::Sema::deduceVarTypeFromInitializer(), clang::Sema::DefaultArgumentPromotion(), clang::Sema::DefaultFunctionArrayConversion(), clang::Sema::DefaultLvalueConversion(), determineEndOffset(), clang::Sema::DiagnoseAlwaysNonNullPointer(), DiagnoseBadDeduction(), DiagnoseForRangeReferenceVariableCopies(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::ento::SMTConv::doIntTypeConversion(), clang::ento::SMTConv::doTypeConversion(), clang::TextNodeDumper::dumpBareType(), EmitAsmStores(), clang::CodeGen::CGOpenMPRuntime::emitDoacrossInit(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), clang::ento::StoreManager::evalBaseToDerived(), clang::ento::retaincountchecker::RetainCountChecker::evalCall(), clang::ento::ExprEngine::evalCall(), clang::ento::ExprEngine::evalLoad(), EvaluateAsRValue(), evaluateCDTSize(), FastEvaluateAsRValue(), clang::Sema::FindCompositePointerType(), FindDesignatorMismatch(), FindImplementableMethods(), clang::Sema::FindInstantiatedDecl(), findOMPAllocatorHandleT(), findOMPAlloctraitT(), findOMPDependT(), findOMPEventHandleT(), FinishForRangeVarDecl(), clang::Sema::FinishTemplateArgumentDeduction(), fixVarDeclWithArray(), clang::FunctionDecl::FunctionDecl(), generateDiagnosticsForCallLike(), clang::index::generateUSRForType(), clang::ASTContext::getAutoDeductType(), clang::ASTContext::getAutoRRefDeductType(), clang::CallExpr::getCallReturnType(), clang::ASTContext::getCommentForDecl(), getCurrentInstantiationOf(), clang::Sema::getCurrentThisType(), GetDeclSpecTypeForDeclarator(), clang::Sema::getDecltypeForExpr(), clang::getDeclUsageType(), clang::ASTContext::getDependentNameType(), getDependTypes(), getDesignatedType(), clang::Sema::getDestructorName(), clang::Sema::getDestructorTypeForDecltype(), clang::Sema::getElaboratedType(), clang::ento::StoreManager::GetElementZeroRegion(), GetEnumUnderlyingType(), getExistingLazyBinding(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForEnum(), GetFullTypeForDeclarator(), clang::ClassTemplateDecl::getInjectedClassNameSpecialization(), clang::ASTContext::getInnerObjCOwnership(), getKmpAffinityType(), getLambdaType(), clang::ento::StoreManager::getLValueElement(), getMostInformativeDerivedClassImpl(), clang::Sema::getMostSpecialized(), clang::Sema::GetNameFromUnqualifiedId(), clang::NSAPI::GetNSIntegralKind(), getNSNumberFactoryMethod(), clang::CodeGen::CodeGenModule::getObjCFastEnumerationStateType(), clang::Type::getObjCSubstitutions(), clang::ASTContext::getObjCSuperType(), clang::dataflow::DataflowAnalysisContext::getOrCreateNullPointerValue(), clang::CodeGen::CGDebugInfo::getOrCreateStandaloneType(), clang::ASTWriter::GetOrCreateTypeID(), getParamType(), getPreferredArgumentTypeForMessageSend(), getPrettyTypeName(), getPrivateItem(), clang::ASTContext::getPromotedIntegerType(), clang::ento::CXXInstanceCall::getRuntimeDefinition(), clang::ento::ObjCMethodCall::getRuntimeDefinition(), clang::ObjCObjectPointerType::getSuperClassType(), clang::ento::ProgramState::getSVal(), clang::ASTContext::getTemplateSpecializationType(), clang::Sema::getTrivialTemplateArgumentLoc(), clang::ASTReader::GetType(), clang::ASTContext::getTypedefType(), clang::Sema::GetTypeFromParser(), clang::ASTWriter::getTypeID(), clang::Sema::getTypeName(), clang::ASTContext::getUsingType(), clang::ento::MemRegionManager::getVarRegion(), HandleAddressSpaceTypeAttribute(), clang::Sema::HandleDependentAccessCheck(), HandleExtVectorTypeAttr(), clang::Sema::HandleFunctionTypeMismatch(), clang::CompletionContextHandler::handleKeyword(), HandleMatrixTypeAttr(), HandleVectorSizeAttr(), handleXReturnsXRetainedAttr(), hasBPFPreserveStaticOffset(), hasNonTrivialConstructorCall(), clang::ASTContext::hasUniqueObjectRepresentations(), HelperIsMethodInObjCType(), clang::ASTImporter::Import(), clang::ASTReader::InitializeContext(), clang::InitializationSequence::InitializeFrom(), instantiateOMPDeclareVariantAttr(), clang::comments::DeclInfo::involvesFunctionType(), IsAcceptableNonMemberOperatorCandidate(), isCXX98PODType(), clang::Declarator::isDeclarationOfFunction(), clang::DeducedType::isDeduced(), clang::DeclarationName::isDependentName(), clang::arcmt::trans::MigrationContext::isGCOwnedNonObjC(), isIndirectPointerType(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), isLayoutCompatible(), clang::CanQual< T >::isNull(), clang::Sema::isOpenMPCapturedDecl(), isOSObjectRelated(), isOverflowingIntegerType(), isPointerToConst(), isPointerToObject(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), IsStructurallyEquivalent(), isSubstitutedType(), clang::DeducedType::isSugared(), clang::Sema::isThisOutsideMemberFunctionBody(), isTrivialType(), clang::ento::DynamicTypeInfo::isValid(), isValidOSObjectOutParameter(), isValidSubjectOfOSAttribute(), clang::ento::SymExpr::isValidTypeForSymbol(), isVoidPointer(), clang::Sema::LazilyCreateBuiltin(), lookupCoroutineHandleType(), clang::ComparisonCategories::lookupInfoForType(), LookupMemberExpr(), lookupPromiseType(), lookupStdTypeTraitMember(), clang::Sema::LookupTemplateName(), clang::serialization::MakeTypeID(), clang::analyze_format_string::ArgType::makeVectorType(), MarkUsedTemplateParameters(), clang::Sema::MatchTemplateParametersToScopeSpecifier(), maybeAdjustInterfaceForSubscriptingCheck(), mergeEnumWithInteger(), clang::Sema::MergeFunctionDecl(), clang::ASTContext::mergeFunctionParameterTypes(), clang::ASTContext::mergeFunctionTypes(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTransparentUnionType(), clang::ASTContext::mergeTypes(), clang::Sema::MergeVarDeclTypes(), OpenCLCheckVectorConditional(), OpenCLConvertScalarsToVectors(), clang::Sema::ParseObjCProtocolExpression(), clang::Sema::ParseTypedefDecl(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformImplicitObjectArgumentInitialization(), clang::ento::retaincountchecker::RefVal::print(), clang::APValue::printPretty(), ProcessAPINotes(), clang::ento::ExprEngine::processCallExit(), processImplicitMapsWithDefaultMappers(), clang::Sema::ProduceCallSignatureHelp(), clang::TypedefType::Profile(), clang::DeducedTemplateSpecializationType::Profile(), clang::ASTRecordReader::readTypeSourceInfo(), RebuildDeclaratorInCurrentInstantiation(), clang::TreeTransform< Derived >::RebuildDependentTemplateSpecializationType(), clang::TreeTransform< Derived >::RebuildUnresolvedUsingType(), recoverFromMSUnqualifiedLookup(), REGISTER_MAP_WITH_PROGRAMSTATE(), ResolveOverloadForDeduction(), rewriteToNSMacroDecl(), clang::Sema::SelectorsForTypoCorrection(), SemaBuiltinAddressof(), clang::Sema::SemaBuiltinVectorMath(), clang::InitializationSequence::SetFailed(), clang::ASTContext::setObjCConstantStringInterface(), clang::Expr::setType(), shouldNotPrintDirectly(), clang::Sema::SubstituteExplicitTemplateArguments(), clang::Sema::SubstType(), throwEscapes(), clang::TreeTransform< Derived >::TransformAttributedType(), clang::TreeTransform< Derived >::TransformDeclarationNameInfo(), clang::TreeTransform< Derived >::TransformFunctionProtoType(), clang::TreeTransform< Derived >::TransformFunctionTypeParams(), clang::TreeTransform< Derived >::TransformReferenceType(), clang::TreeTransform< Derived >::TransformTemplateArgument(), clang::TreeTransform< Derived >::TransformTemplateName(), clang::RecursiveASTVisitor< Derived >::TraverseType(), clang::Sema::tryCaptureOpenMPLambdas(), TryDeconstructFunctionLike(), clang::Sema::tryExprAsCall(), TryOrBuildParenListInitialization(), tryRearrange(), TryReinterpretCast(), TryToFixInvalidVariablyModifiedType(), TryToFixInvalidVariablyModifiedTypeSourceInfo(), clang::Sema::tryToRecoverWithCall(), clang::ASTContext::typesAreBlockPointerCompatible(), clang::ASTContext::typesAreCompatible(), UnwrapTypeForDebugInfo(), clang::Sema::UsualArithmeticConversions(), clang::Sema::UsualUnaryConversions(), clang::FunctionCallFilterCCC::ValidateCandidate(), clang::UsedDeclVisitor< Derived >::VisitCXXDeleteExpr(), clang::ASTDeclReader::VisitDeclaratorDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), and clang::interp::ByteCodeExprGen< Emitter >::visitVarDecl().

◆ isObjCGCStrong()

bool clang::QualType::isObjCGCStrong ( ) const
inline

true when Type is objc's strong.

Definition at line 1224 of file Type.h.

References getObjCGCAttr(), and clang::Qualifiers::Strong.

Referenced by clang::Sema::ActOnFields(), clang::Sema::ActOnPropertyImplDecl(), and GetGCAttrTypeForType().

◆ isObjCGCWeak()

bool clang::QualType::isObjCGCWeak ( ) const
inline

◆ isPODType()

bool QualType::isPODType ( const ASTContext Context) const

◆ isReferenceable()

bool clang::QualType::isReferenceable ( ) const
inline

◆ isRestrictQualified()

bool clang::QualType::isRestrictQualified ( ) const
inline

Determine whether this type is restrict-qualified.

Definition at line 6979 of file Type.h.

Referenced by appendQualifier(), CheckC23ConstexprVarType(), CollectVRQualifiers(), and clang::CodeGen::CodeGenModule::GenKernelArgMetadata().

◆ isTriviallyCopyableType()

bool QualType::isTriviallyCopyableType ( const ASTContext Context) const

◆ isTriviallyCopyConstructibleType()

bool QualType::isTriviallyCopyConstructibleType ( const ASTContext Context) const

Return true if this is a trivially copyable type.

Definition at line 2670 of file Type.cpp.

References isTriviallyCopyableTypeImpl().

Referenced by DiagnoseForRangeConstVariableCopies().

◆ isTriviallyEqualityComparableType()

bool QualType::isTriviallyEqualityComparableType ( const ASTContext Context) const

◆ isTriviallyRelocatableType()

bool QualType::isTriviallyRelocatableType ( const ASTContext Context) const

◆ isTrivialType()

bool QualType::isTrivialType ( const ASTContext Context) const

◆ isVolatileQualified()

bool clang::QualType::isVolatileQualified ( ) const
inline

◆ isWebAssemblyExternrefType()

bool QualType::isWebAssemblyExternrefType ( ) const

Returns true if it is a WebAssembly Externref Type.

Definition at line 2781 of file Type.cpp.

References getTypePtr(), and clang::Type::isWebAssemblyExternrefType().

Referenced by isWebAssemblyReferenceType().

◆ isWebAssemblyFuncrefType()

bool QualType::isWebAssemblyFuncrefType ( ) const

Returns true if it is a WebAssembly Funcref Type.

Definition at line 2785 of file Type.cpp.

References getAddressSpace(), getTypePtr(), clang::Type::isFunctionPointerType(), and clang::wasm_funcref.

Referenced by isWebAssemblyReferenceType().

◆ isWebAssemblyReferenceType()

bool QualType::isWebAssemblyReferenceType ( ) const

◆ mayBeDynamicClass()

bool QualType::mayBeDynamicClass ( ) const

Returns true if it is a class and it might be dynamic.

Definition at line 95 of file Type.cpp.

References clang::Type::getPointeeCXXRecordDecl(), getTypePtr(), and clang::CXXRecordDecl::mayBeDynamicClass().

◆ mayBeNotDynamicClass()

bool QualType::mayBeNotDynamicClass ( ) const

Returns true if it is not a class or if the class might not be dynamic.

Definition at line 100 of file Type.cpp.

References clang::Type::getPointeeCXXRecordDecl(), getTypePtr(), and clang::CXXRecordDecl::mayBeNonDynamicClass().

◆ operator*()

const Type & clang::QualType::operator* ( ) const
inline

Definition at line 792 of file Type.h.

References getTypePtr().

◆ operator->()

const Type * clang::QualType::operator-> ( ) const
inline

Definition at line 796 of file Type.h.

References getTypePtr().

◆ print() [1/3]

void QualType::print ( const Type ty,
Qualifiers  qs,
raw_ostream &  OS,
const PrintingPolicy policy,
const Twine &  PlaceHolder,
unsigned  Indentation = 0 
)
static

Definition at line 2480 of file TypePrinter.cpp.

◆ print() [2/3]

void QualType::print ( raw_ostream &  OS,
const PrintingPolicy Policy,
const Twine &  PlaceHolder = Twine(),
unsigned  Indentation = 0 
) const

◆ print() [3/3]

static void clang::QualType::print ( SplitQualType  split,
raw_ostream &  OS,
const PrintingPolicy policy,
const Twine &  PlaceHolder,
unsigned  Indentation = 0 
)
inlinestatic

Definition at line 1138 of file Type.h.

References print(), clang::SplitQualType::Quals, split(), and clang::SplitQualType::Ty.

◆ Profile()

void clang::QualType::Profile ( llvm::FoldingSetNodeID &  ID) const
inline

◆ removeLocalConst()

void clang::QualType::removeLocalConst ( )
inline

◆ removeLocalFastQualifiers() [1/2]

void clang::QualType::removeLocalFastQualifiers ( )
inline

Definition at line 985 of file Type.h.

Referenced by clang::serialization::MakeTypeID(), and withoutLocalFastQualifiers().

◆ removeLocalFastQualifiers() [2/2]

void clang::QualType::removeLocalFastQualifiers ( unsigned  Mask)
inline

Definition at line 986 of file Type.h.

References clang::Qualifiers::FastMask.

◆ removeLocalRestrict()

void clang::QualType::removeLocalRestrict ( )
inline

Definition at line 7013 of file Type.h.

Referenced by clang::CXXMethodDecl::getThisType().

◆ removeLocalVolatile()

void clang::QualType::removeLocalVolatile ( )
inline

Definition at line 7017 of file Type.h.

Referenced by clang::Sema::BuildAtomicExpr(), and findSubobject().

◆ setLocalFastQualifiers()

void clang::QualType::setLocalFastQualifiers ( unsigned  Quals)
inline

Definition at line 765 of file Type.h.

◆ split()

SplitQualType clang::QualType::split ( ) const
inline

◆ stream()

StreamedQualTypeHelper clang::QualType::stream ( const PrintingPolicy Policy,
const Twine &  PlaceHolder = Twine(),
unsigned  Indentation = 0 
) const
inline

◆ stripObjCKindOfType()

QualType QualType::stripObjCKindOfType ( const ASTContext ctx) const

Strip Objective-C "__kindof" types from the given type.

Definition at line 1560 of file Type.cpp.

Referenced by clang::Sema::CodeCompleteObjCMethodDecl().

◆ substObjCMemberType()

QualType QualType::substObjCMemberType ( QualType  objectType,
const DeclContext dc,
ObjCSubstitutionContext  context 
) const

Substitute type arguments from an object type for the Objective-C type parameters used in the subject type.

This operation combines the computation of type arguments for substitution (Type::getObjCSubstitutions) with the actual process of substitution (QualType::substObjCTypeArgs) for the convenience of callers that need to perform a single substitution in isolation.

Parameters
objectTypeThe 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.
dcThe declaration context from which the subject type was retrieved, which indicates (for example) which type parameters should be substituted.
contextThe 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.

Definition at line 1551 of file Type.cpp.

References clang::Type::getObjCSubstitutions(), clang::DeclContext::getParentASTContext(), and substObjCTypeArgs().

Referenced by clang::ObjCMethodDecl::getSendResultType(), clang::ObjCPropertyDecl::getUsageType(), and clang::ObjCIvarDecl::getUsageType().

◆ substObjCTypeArgs()

QualType QualType::substObjCTypeArgs ( ASTContext ctx,
ArrayRef< QualType typeArgs,
ObjCSubstitutionContext  context 
) const

Substitute type arguments for the Objective-C type parameters used in the subject type.

Substitute the given type arguments for Objective-C type parameters within the given type, recursively.

Parameters
ctxASTContext in which the type exists.
typeArgsThe type arguments that will be substituted for the Objective-C type parameters in the subject type, which are generally computed via Type::getObjCSubstitutions. If empty, the type parameters will be replaced with their bounds or id/Class, as appropriate for the context.
contextThe context in which the subject type was written.
Returns
the resulting type.

Definition at line 1544 of file Type.cpp.

Referenced by clang::Sema::CheckMessageArgumentTypes(), clang::Sema::CodeCompleteObjCMethodDecl(), clang::ObjCObjectType::computeSuperClassTypeSlow(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), formatBlockPlaceholder(), getReturnTypeForMethod(), clang::ObjCMethodDecl::getSendResultType(), and substObjCMemberType().

◆ UseExcessPrecision()

bool QualType::UseExcessPrecision ( const ASTContext Ctx)

◆ withConst()

QualType clang::QualType::withConst ( ) const
inline

◆ withCVRQualifiers()

QualType clang::QualType::withCVRQualifiers ( unsigned  CVR) const
inline

◆ withExactLocalFastQualifiers()

QualType clang::QualType::withExactLocalFastQualifiers ( unsigned  TQs) const
inline

Definition at line 1001 of file Type.h.

References withFastQualifiers(), and withoutLocalFastQualifiers().

◆ withFastQualifiers()

QualType clang::QualType::withFastQualifiers ( unsigned  TQs) const
inline

◆ withoutLocalFastQualifiers()

QualType clang::QualType::withoutLocalFastQualifiers ( ) const
inline

◆ withRestrict()

QualType clang::QualType::withRestrict ( ) const
inline

◆ withVolatile()

QualType clang::QualType::withVolatile ( ) const
inline

Definition at line 959 of file Type.h.

References clang::Qualifiers::Volatile, and withFastQualifiers().

Referenced by callSpecialFunction(), and getSpecialFunction().

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const QualType LHS,
const QualType RHS 
)
friend

Definition at line 1117 of file Type.h.

◆ operator<

bool operator< ( const QualType LHS,
const QualType RHS 
)
friend

Definition at line 1120 of file Type.h.

◆ operator==

bool operator== ( const QualType LHS,
const QualType RHS 
)
friend

Indicate whether the specified types and qualifiers are identical.

Definition at line 1114 of file Type.h.

◆ QualifierCollector

friend class QualifierCollector
friend

Definition at line 738 of file Type.h.


The documentation for this class was generated from the following files: