clang 22.0.0git
|
A (possibly-)qualified type. More...
#include "clang/AST/TypeBase.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_PtrAuth , 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 Type * | getTypePtr () const |
Retrieves a pointer to the underlying (unqualified) type. | |
const Type * | getTypePtrOrNull () const |
const IdentifierInfo * | getBaseTypeIdentifier () 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 Type & | operator* () const |
const Type * | operator-> () 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< NonConstantStorageReason > | isNonConstantStorage (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 | isBitwiseCloneableType (const ASTContext &Context) const |
Return true if the type is safe to bitwise copy using memcpy/memmove. | |
bool | isTriviallyCopyConstructibleType (const ASTContext &Context) const |
Return true if this is a trivially copyable 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 ASTContext &Ctx) 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 ASTContext &Ctx) 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 ASTContext &Ctx) 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 |
PointerAuthQualifier | getPointerAuth () const |
bool | hasAddressDiscriminatedPointerAuth () 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) |
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.
Definition at line 937 of file TypeBase.h.
Enumerator | |
---|---|
DK_none | |
DK_cxx_destructor | |
DK_objc_strong_lifetime | |
DK_objc_weak_lifetime | |
DK_nontrivial_c_struct |
Definition at line 1533 of file TypeBase.h.
|
strong |
Enumerator | |
---|---|
MutableField | |
NonConstNonReferenceType | |
NonTrivialCtor | |
NonTrivialDtor |
Definition at line 1021 of file TypeBase.h.
Definition at line 1489 of file TypeBase.h.
Definition at line 1463 of file TypeBase.h.
|
default |
Referenced by getAtomicUnqualifiedType(), getCanonicalType(), getDesugaredType(), getFromOpaquePtr(), getLocalUnqualifiedType(), getNonLValueExprType(), getNonPackExpansionType(), getNonReferenceType(), getSingleStepDesugaredType(), getUnqualifiedType(), IgnoreParens(), isAddressSpaceOverlapping(), isAtLeastAsQualifiedAs(), isCXX98PODType(), isMoreQualifiedThan(), isTrivialType(), operator!=, operator<, operator==, clang::QualType::StreamedQualTypeHelper::StreamedQualTypeHelper(), stripObjCKindOfType(), substObjCMemberType(), substObjCTypeArgs(), UseExcessPrecision(), withConst(), withCVRQualifiers(), withExactLocalFastQualifiers(), withFastQualifiers(), withoutLocalFastQualifiers(), withRestrict(), and withVolatile().
Definition at line 961 of file TypeBase.h.
Definition at line 962 of file TypeBase.h.
|
inline |
Add the const type qualifier to this QualType.
Definition at line 1156 of file TypeBase.h.
References addFastQualifiers(), and clang::Qualifiers::Const.
Referenced by clang::Sema::ActOnCXXUuidof(), clang::hlsl::BuiltinTypeDeclBuilder::addHandleAccessFunction(), adjustCVQualifiersForCXXThisWithinLambda(), alignReferenceTypes(), builtinCommonTypeImpl(), captureInCapturedRegion(), captureInLambda(), clang::SemaARM::CheckARMBuiltinExclusiveCall(), clang::Sema::CheckExplicitlyDefaultedComparison(), checkTrivialSubobjectCall(), findOMPAllocatorHandleT(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), getSubobjectType(), isVariableAlreadyCapturedInScopeInfo(), clang::Sema::LookupSpecialMember(), and clang::Sema::tryCaptureVariable().
|
inline |
Definition at line 1183 of file TypeBase.h.
References clang::Qualifiers::FastMask.
Referenced by addConst(), addRestrict(), and addVolatile().
|
inline |
Add the restrict qualifier to this QualType.
Definition at line 1172 of file TypeBase.h.
References addFastQualifiers(), and clang::Qualifiers::Restrict.
Referenced by emitReduceInitFunction(), clang::SemaHLSL::getInoutParameterType(), and clang::CXXMethodDecl::getThisType().
|
inline |
Add the volatile type qualifier to this QualType.
Definition at line 1164 of file TypeBase.h.
References addFastQualifiers(), and clang::Qualifiers::Volatile.
Referenced by getSubobjectType(), and clang::Sema::LookupSpecialMember().
LLVM_DUMP_METHOD void QualType::dump | ( | ) | const |
Definition at line 185 of file ASTDumper.cpp.
References clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
Referenced by dump().
void QualType::dump | ( | const char * | s | ) | const |
Definition at line 179 of file ASTDumper.cpp.
References dump().
LLVM_DUMP_METHOD void QualType::dump | ( | llvm::raw_ostream & | OS, |
const ASTContext & | Context ) const |
Definition at line 190 of file ASTDumper.cpp.
References clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
|
inline |
Return the address space of this type.
Definition at line 8411 of file TypeBase.h.
References getAddressSpace(), and getQualifiers().
Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaHLSL::ActOnUninitializedVarDecl(), clang::Sema::AddInitializerToDecl(), AdjustAddressSpaceForBuiltinOperandType(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildCallExpr(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::CheckAllocatedType(), clang::Sema::CheckAssignmentConstraints(), clang::Sema::CheckCompareOperands(), clang::CodeGen::CodeGenTypes::ConvertType(), createHostLayoutStructForBuffer(), DeduceTemplateArgumentsByTypeMatch(), diagnoseOpenCLTypes(), clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CIRGen::CIRGenFunction::emitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), clang::CIRGen::CIRGenFunction::emitVarDecl(), fillPackoffsetLayout(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), getAddressSpace(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalVar(), clang::CodeGen::CodeGenModule::GetAddrOfMSGuidDecl(), clang::CodeGen::CodeGenModule::GetAddrOfTemplateParamObject(), clang::CodeGen::CodeGenModule::GetAddrOfUnnamedGlobalConstantDecl(), clang::ASTContext::getAddrSpaceQualType(), clang::ento::MemRegionManager::getElementRegion(), clang::CodeGen::CodeGenModule::GetGlobalVarAddressSpace(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), getLambdaType(), getOpenCLKernelParameterType(), clang::CIRGen::CIRGenModule::getOrCreateCIRGlobal(), clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal(), clang::CodeGen::CodeGenModule::getOrCreateStaticVarDecl(), clang::ASTContext::getTargetNullPointerValue(), IsAddressSpaceConversion(), IsDefaultBufferConstantDecl(), clang::Expr::isNullPointerConstant(), clang::isValidSwiftContextType(), clang::isValidSwiftIndirectResultType(), isWebAssemblyFuncrefType(), clang::InitializationSequence::Perform(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformImplicitObjectArgumentInitialization(), clang::Sema::PerformObjectMemberConversion(), clang::Sema::PerformQualificationConversion(), clang::Sema::PrepareScalarCast(), clang::ASTContext::removePtrSizeAddrSpace(), clang::CodeGen::ConstantEmitter::tryEmitForInitializer(), and TryReinterpretCast().
|
inline |
Definition at line 984 of file TypeBase.h.
Referenced by clang::CodeGen::CGDebugInfo::finalize(), llvm::PointerLikeTypeTraits< clang::QualType >::getAsVoidPointer(), llvm::DenseMapInfo< clang::QualType >::getHashValue(), clang::CodeGen::CGDebugInfo::getOrCreateStandaloneType(), clang::QualTypeOrdering::operator()(), ProcessAPINotes(), clang::AdjustedType::Profile(), clang::BlockPointerType::Profile(), clang::ComplexType::Profile(), clang::ConstantArrayType::Profile(), clang::DependentSizedArrayType::Profile(), clang::IncompleteArrayType::Profile(), clang::MemberPointerType::Profile(), clang::PointerType::Profile(), Profile(), and clang::ReferenceType::Profile().
std::string QualType::getAsString | ( | ) | const |
Definition at line 2801 of file TypePrinter.cpp.
References clang::getAsString(), and split().
Referenced by clang::TextNodeDumper::dumpBareType(), getAsString(), printIndicesOfElementsToConstructJson(), printPendingInitLoopJson(), clang::Sema::ProcessAPINotes(), and clang::TextNodeDumper::VisitFunctionDecl().
std::string QualType::getAsString | ( | const PrintingPolicy & | Policy | ) | const |
Definition at line 2805 of file TypePrinter.cpp.
References getAsStringInternal().
|
static |
Definition at line 2811 of file TypePrinter.cpp.
References getAsStringInternal().
|
inlinestatic |
Definition at line 1332 of file TypeBase.h.
References getAsString(), and split().
Referenced by clang::data_collection::addDataToConsumer(), addFixitForObjCARCConversion(), clang::SemaOpenCL::checkBuiltinEnqueueKernel(), clang::SemaOpenCL::checkBuiltinNDRangeAndBlock(), checkTypeParamListConsistency(), ConvertTypeToDiagnosticString(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), clang::Sema::diagnoseUnavailableAlignedAllocation(), clang::Sema::getAmbiguousPathsDisplayString(), clang::diff::SyntaxTree::Impl::getDeclValue(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForFunction(), clang::GetFullTypeName(), clang::TypeName::getFullyQualifiedName(), clang::diff::getInitializerValue(), getNonTaintMsgs(), getNoteTag(), getPrettyTypeName(), clang::analyze_format_string::ArgType::getRepresentativeTypeName(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), isISLObjectRef(), isNullPointerValueTemplateArgument(), isOpenCLSizeDependentType(), clang::ASTContext::isTypeIgnoredBySanitizer(), NoteBuiltinOperatorCandidate(), OpenCLConvertScalarsToVectors(), QualTypeToString(), TryStaticDowncast(), clang::TextNodeDumper::VisitCXXFunctionalCastExpr(), clang::TextNodeDumper::VisitCXXNamedCastExpr(), clang::ento::SValExplainer::VisitSymbolConjured(), and clang::ento::SValExplainer::VisitSymbolMetadata().
|
static |
Definition at line 2839 of file TypePrinter.cpp.
|
inlinestatic |
Definition at line 1360 of file TypeBase.h.
References getAsStringInternal(), clang::out, and split().
void QualType::getAsStringInternal | ( | std::string & | Str, |
const PrintingPolicy & | Policy ) const |
Definition at line 2833 of file TypePrinter.cpp.
References getAsStringInternal(), and splitAccordingToPolicy().
Referenced by clang::Sema::CheckVirtualDtorCall(), clang::PredefinedExpr::ComputeName(), diagnoseNoViableConversion(), formatBlockPlaceholder(), getAsString(), getAsString(), getAsStringInternal(), and getAsStringInternal().
QualType QualType::getAtomicUnqualifiedType | ( | ) | const |
Remove all qualifiers including _Atomic.
Like getUnqualifiedType(), the type may still be qualified if it is a sugared array type. To strip qualifiers even from within a sugared array type, use in conjunction with ASTContext::getUnqualifiedArrayType.
Definition at line 1670 of file Type.cpp.
References QualType(), and clang::T.
Referenced by clang::Sema::ActOnStmtExprResult(), clang::Sema::ActOnTag(), clang::Sema::CheckAssignmentOperands(), and clang::Sema::CheckSingleAssignmentConstraints().
const IdentifierInfo * QualType::getBaseTypeIdentifier | ( | ) | const |
Retrieves a pointer to the name of the base type.
Definition at line 109 of file Type.cpp.
References clang::Type::castAs(), clang::Type::castAsArrayTypeUnsafe(), clang::Type::getAs(), getBaseTypeIdentifier(), clang::ArrayType::getElementType(), clang::NamedDecl::getIdentifier(), clang::Type::getPointeeType(), clang::Type::getTypeClass(), getTypePtr(), clang::Type::isArrayType(), and clang::Type::isPointerOrReferenceType().
Referenced by appendType(), getBaseTypeIdentifier(), and hasSimilarParameters().
|
inline |
Definition at line 8337 of file TypeBase.h.
References getCanonicalType(), getLocalFastQualifiers(), QualType(), and withFastQualifiers().
Referenced by clang::Sema::ActOnCXXTryBlock(), clang::Sema::ActOnFunctionDeclarator(), clang::SemaOpenMP::ActOnOpenMPAlignedClause(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperDirective(), clang::SemaObjC::ActOnPropertyImplDecl(), adjustReturnValue(), clang::CodeGen::CGOpenMPRuntimeGPU::adjustTargetSpecificDataForLambdas(), appendType(), clang::Sema::BuildReturnStmt(), BuildSimilarlyQualifiedPointerType(), buildUserDefinedMapperRef(), clang::SemaPPC::BuiltinPPCMMACall(), BuiltinTriviallyRelocate(), clang::checkBlockArgs(), clang::SemaOpenCL::checkBuiltinEnqueueKernel(), clang::SemaRISCV::CheckBuiltinFunctionCall(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckCompatibleReinterpretCast(), CheckDeductionConsistency(), checkMapConflicts(), checkNoThrow(), clang::SemaObjC::CheckObjCARCUnavailableWeakConversion(), clang::SemaObjC::CheckObjCMethodOverrides(), clang::checkOpenCLEnqueueVariadicArgs(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckSizelessVectorConditionalTypes(), clang::Sema::CheckTemplateArgument(), clang::Sema::checkTypeSupport(), CollectVRQualifiers(), clang::ento::ExprEngine::ConstructInitList(), ConvertTypeToDiagnosticString(), clang::dataflow::copyRecord(), create_call_once(), clang::ConstructionContext::createFromLayers(), clang::Sema::CreateGenericSelectionExpr(), DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateSpecArguments(), diagnoseOpenCLTypes(), clang::SemaObjC::DiagnosePropertyAccessorMismatch(), clang::SemaObjC::DiagnosePropertyMismatch(), DiagnoseRecursiveConstFields(), clang::ento::SMTConv::doTypeConversion(), dumpMicrosoftThunkAdjustment(), clang::CodeGen::CodeGenFunction::EmitAsmStmt(), emitBadConversionNotes(), clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), emitReadOnlyPlacementAttrWarning(), encodeTypeForFunctionPointerAuth(), fixVarDeclWithArray(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), getAArch64LS(), getAArch64MTV(), getAArch64PBV(), getCanonicalType(), clang::ASTContext::getDeducedTemplateSpecializationType(), getGlobalStreamPointerByName(), clang::ento::StoreManager::getLValueElement(), getNaiveStrategy(), getNDSWDS(), getOpenCLKernelParameterType(), clang::dataflow::DataflowAnalysisContext::getOrCreateNullPointerValue(), clang::ASTContext::getPackIndexingType(), clang::ento::ObjCMethodCall::getRuntimeDefinition(), clang::ASTContext::getUnaryTransformType(), handleComplexFloatConversion(), handleDiagnoseAsBuiltinAttr(), clang::SemaObjC::HandlePropertyInClassExtension(), handleRestrictAttr(), hasArrayType(), hasPointerType(), libc_func_matchers::hasUnsafePrintfStringArg(), clang::Sema::inferGslPointerAttribute(), isBitwiseCloneableType(), clang::CFGCXXRecordTypedCall::isCXXRecordTypedCall(), clang::Decl::isFunctionPointerType(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), clang::ento::RetainSummaryManager::isKnownSmartPointer(), isLayoutCompatible(), clang::SemaOpenMP::isOpenMPPrivateDecl(), isPointerToConst(), clang::SemaHLSL::IsScalarizedLayoutCompatible(), IsStandardConversion(), isStdStreamVar(), IsStringInit(), IsStructurallyEquivalent(), isSubstitutedType(), clang::InitListExpr::isTransparent(), clang::RetainTypeChecker::isUnretained(), isValidSizelessVectorForConditionalCondition(), isValidVectorForConditionalCondition(), clang::ast_matchers::matchEachArgumentWithParamTypeImpl(), matchesSizeTPtrdiffT(), maybeRecoverWithZeroInitialization(), clang::CodeGen::CodeGenModule::MayDropFunctionReturn(), PerformConstructorInitialization(), processImplicitMapsWithDefaultMappers(), QualTypeToString(), clang::dataflow::recordsEqual(), REGISTER_MAP_WITH_PROGRAMSTATE(), splitAccordingToPolicy(), SuggestInitializationFixit(), tryExtractInitializerFromList(), clang::Value::Value(), and clang::ento::SValExplainer::VisitSymbolicRegion().
|
inline |
Retrieve the set of CVR (const-volatile-restrict) qualifiers applied to this type.
Definition at line 8331 of file TypeBase.h.
References getCVRQualifiers(), and getLocalCVRQualifiers().
Referenced by BuiltinTriviallyRelocate(), clang::Sema::CheckPointerToMemberOperands(), checkTrivialSubobjectCall(), DeduceTemplateArgumentsByTypeMatch(), diagnoseRedundantReturnTypeQualifiers(), GeneralizeType(), getCVRQualifiers(), clang::CXXConstructorDecl::isCopyOrMoveConstructor(), clang::FunctionDecl::isUsableAsGlobalAllocationFunctionInConstantEvaluation(), clang::Sema::SpecialMemberIsTrivial(), TryObjectArgumentInitialization(), and unwrapCastAwayConstnessLevel().
|
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 1296 of file TypeBase.h.
References getDesugaredType(), and QualType().
Referenced by clang::ASTContext::getArrayParameterType(), clang::ento::TypedRegion::getDesugaredLocationType(), getDesugaredType(), clang::SemaObjC::getMessageSendResultType(), and IsStructurallyEquivalent().
|
inlinestatic |
Definition at line 986 of file TypeBase.h.
References QualType(), and clang::T.
Referenced by ConvertTypeToDiagnosticString(), clang::FormatASTNodeDiagnosticArgument(), clang::DependentDiagnostic::getAccessBaseObjectType(), clang::TemplateArgument::getAsType(), clang::APValue::LValueBase::getDynamicAllocType(), clang::serialization::UnsafeQualTypeDenseMapInfo::getEmptyKey(), clang::sema::DelayedDiagnostic::getForbiddenTypeOperand(), clang::CanQual< T >::getFromOpaquePtr(), clang::AmbiguousConversionSequence::getFromType(), clang::BadConversionSequence::getFromType(), clang::StandardConversionSequence::getFromType(), llvm::PointerLikeTypeTraits< clang::QualType >::getFromVoidPointer(), clang::TemplateArgument::getIntegralType(), clang::TemplateArgument::getNullPtrType(), clang::TemplateArgument::getParamTypeForDecl(), clang::TemplateArgument::getStructuralValueType(), clang::ObjCMessageExpr::getSuperType(), clang::serialization::UnsafeQualTypeDenseMapInfo::getTombstoneKey(), clang::AmbiguousConversionSequence::getToType(), clang::BadConversionSequence::getToType(), clang::StandardConversionSequence::getToType(), clang::APValue::LValuePathSerializationHelper::getType(), clang::TypeLoc::getType(), clang::Value::getType(), clang::APValue::LValueBase::getTypeInfoType(), and clang::TypeLoc::getTypePtr().
|
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 1089 of file TypeBase.h.
References getLocalFastQualifiers().
Referenced by clang::Sema::CheckOverridingFunctionReturnType(), diagnoseRedundantReturnTypeQualifiers(), getCVRQualifiers(), and TryObjectArgumentInitialization().
|
inline |
Definition at line 964 of file TypeBase.h.
Referenced by getCanonicalType(), getLocalCVRQualifiers(), getLocalQualifiers(), getQualifiers(), hasLocalQualifiers(), isLocalConstQualified(), isLocalRestrictQualified(), isLocalVolatileQualified(), and split().
|
inline |
Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifiers acquired through typedefs or other sugar.
Definition at line 8317 of file TypeBase.h.
References clang::Qualifiers::addFastQualifiers(), getLocalFastQualifiers(), getLocalQualifiers(), and hasLocalNonFastQualifiers().
Referenced by BuildSimilarlyQualifiedPointerType(), checkBlockPointerTypesForAssignment(), clang::TypeName::getFullyQualifiedType(), getLocalQualifiers(), clang::ASTImporter::Import(), IsStandardConversion(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), and clang::TreeTransform< Derived >::RebuildQualifiedType().
|
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 1225 of file TypeBase.h.
References getTypePtr(), and QualType().
Referenced by clang::Sema::AttachBaseSpecifiers(), BuildSimilarlyQualifiedPointerType(), clang::ento::StoreManager::castRegion(), DiagnoseNarrowingInInitList(), clang::SemaObjC::handleExternallyRetainedAttr(), IsStandardConversion(), clang::ProgramPoint::printJson(), and TryObjectArgumentInitialization().
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 3556 of file Type.cpp.
References clang::Type::getPointeeType(), getTypePtr(), getUnqualifiedType(), isRecordType(), and QualType().
Referenced by clang::SemaOpenMP::ActOnOpenMPLoopInitialization(), clang::SemaHLSL::ActOnOutParamExpr(), clang::Sema::AddConversionCandidate(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildCXXMemberCallExpr(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildLiteralOperatorCall(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildVAArgExpr(), CheckConvertibilityForTypeTraits(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckTemplateArgument(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), DiagnoseNonConstructibleReason(), EvaluateBooleanTypeTrait(), findOMPAllocatorHandleT(), clang::ObjCMethodDecl::getSendResultType(), clang::ObjCMethodDecl::getSendResultType(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), clang::Sema::PerformImplicitConversion(), TryClassUnification(), and TryRefInitWithConversionFunction().
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 3549 of file Type.cpp.
References getTypePtr(), and QualType().
Referenced by clang::Sema::AttachTypeConstraint().
|
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 8470 of file TypeBase.h.
References getNonReferenceType(), and QualType().
Referenced by actOnOMPReductionKindClause(), clang::SemaOpenMP::ActOnOpenMPAlignedClause(), clang::SemaOpenMP::ActOnOpenMPCopyinClause(), clang::SemaOpenMP::ActOnOpenMPDependClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::SemaOpenMP::ActOnOpenMPLastprivateClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::AddConversionCandidate(), AddObjCKeyValueCompletions(), clang::Sema::AddOverloadCandidate(), clang::CodeGen::CGOpenMPRuntimeGPU::adjustTargetSpecificDataForLambdas(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCallToObjectOfClassType(), buildCapture(), buildCapture(), clang::Sema::BuildCXXForRangeStmt(), clang::Sema::BuildCXXTypeConstructExpr(), buildDeclareReductionRef(), clang::Sema::BuildMemberReferenceExpr(), buildPromiseCall(), clang::Sema::BuiltinDecay(), canCaptureVariableByCopy(), captureInBlock(), captureInLambda(), castToBase(), clang::CodeGen::CGOpenMPRuntime::checkAndEmitSharedLastprivateConditional(), checkCastFunctionType(), clang::Sema::CheckCompleteDecompositionDeclaration(), clang::Sema::CheckConditionVariable(), CheckDeductionConsistency(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), checkMapConflicts(), clang::Sema::CheckNonDependentConversions(), checkOpenMPIterationSpace(), clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), clang::SemaOpenACC::CheckVarIsPointerType(), CompleteNonViableCandidate(), clang::Sema::ConstantFoldAttrArgs(), create_call_once(), create_call_once_funcptr_call(), clang::SemaOpenACC::CreateFirstPrivateInitRecipe(), createObjCPropertyGetter(), clang::SemaOpenACC::CreatePrivateInitRecipe(), createPrivatesRecordDecl(), clang::SemaOpenACC::CreateReductionInitRecipe(), determineEndOffset(), clang::InitializationSequence::Diagnose(), diagnoseAmbiguousConversion(), clang::SemaObjC::diagnoseARCUnbridgedCast(), DiagnoseBadConversion(), DiagnoseForRangeReferenceVariableCopies(), DiagnoseNarrowingInInitList(), diagnoseNoViableConversion(), clang::SemaObjC::DiagnosePropertyAccessorMismatch(), emitBadConversionNotes(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), emitCPPObjectAtomicSetterCall(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalFinalUpdate(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalInit(), clang::CodeGen::CodeGenFunction::EmitLValueForLambdaField(), clang::CodeGen::CodeGenFunction::EmitOMPCanonicalLoop(), clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPUseDeviceAddrClause(), emitPreCond(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), emitStructSetterCall(), emitTaskPrivateMappingFunction(), clang::SemaOpenMP::EndOpenMPDSABlock(), EvaluateBinaryTypeTrait(), FindConversionForRefInit(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), clang::CFGImplicitDtor::getDestructorDecl(), clang::CXXMethodDecl::getFunctionObjectParameterType(), clang::Sema::getNamedReturnInfo(), clang::Sema::getNamedReturnInfo(), clang::UnresolvedMemberExpr::getNamingClass(), getNonReferenceType(), clang::CodeGen::CodeGenModule::getOMPAllocateAlignment(), clang::CIRGen::CIRGenFunction::getOpenACCDataOperandInfo(), getParamType(), clang::dataflow::DataflowAnalysisContext::getStableStorageLocation(), getVariableCategoryFromDecl(), clang::Sema::HandleFunctionTypeMismatch(), HandleLValueBase(), handleTrivialCopy(), hasCopyOrMoveCtorParam(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::interp::InterpretOffsetOf(), isAllowableExplicitConversion(), isFirstArgumentCompatibleWithType(), clang::SemaOpenMP::isOpenMPCapturedByRef(), clang::SemaOpenMP::isOpenMPCapturedDecl(), clang::SemaOpenMP::isOpenMPPrivateDecl(), IsTypeModifiable(), isVariableAlreadyCapturedInScopeInfo(), loadToBegin(), clang::InitializationSequence::Perform(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformImplicitConversion(), clang::APValue::printPretty(), clang::SemaObjC::ProcessPropertyDecl(), QualTypeToString(), recordConversion(), clang::dataflow::transferSmartPointerLikeCachedDeref(), clang::SemaHLSL::transformInitList(), clang::Sema::tryCaptureVariable(), and TryObjectArgumentInitialization().
|
inline |
Returns gc attribute of this type.
Return the gc attribute of this type.
Definition at line 8416 of file TypeBase.h.
References getObjCGCAttr(), and getQualifiers().
Referenced by getObjCGCAttr(), clang::ASTContext::getObjCGCAttrKind(), clang::ASTContext::getObjCGCQualType(), isObjCGCStrong(), and isObjCGCWeak().
|
inline |
Returns lifetime attribute of this type.
Definition at line 1438 of file TypeBase.h.
References clang::Qualifiers::getObjCLifetime(), and getQualifiers().
Referenced by clang::Sema::ActOnFields(), clang::SemaObjC::ActOnProperty(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildCXXNew(), clang::Sema::BuildDeclRefExpr(), clang::SemaObjC::BuildInstanceMessage(), clang::SemaObjC::BuildIvarRefExpr(), clang::Sema::BuildPseudoDestructorExpr(), captureInBlock(), captureInLambda(), clang::Sema::CheckAllocatedType(), checkARCPropertyImpl(), clang::SemaARM::CheckARMBuiltinExclusiveCall(), clang::Sema::CheckAssignmentOperands(), clang::Sema::checkIllFormedTrivialABIStruct(), clang::SemaObjC::CheckObjCARCUnavailableWeakConversion(), clang::SemaObjC::CheckObjCConversion(), checkTrivialClassMembers(), clang::Sema::checkUnsafeAssigns(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::DefaultLvalueConversion(), DiagnoseRetainableFlexibleArrayMember(), clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(), clang::CIRGen::CIRGenFunction::emitBinaryOperatorLValue(), clang::CodeGen::CodeGenFunction::EmitCXXPseudoDestructorExpr(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CIRGen::CIRGenFunction::emitMaterializeTemporaryExpr(), EmitObjectDelete(), clang::findRetainCycleOwner(), clang::ASTContext::getByrefLifetime(), GetGCAttrTypeForType(), clang::SemaObjC::handlePreciseLifetimeAttr(), clang::SemaObjC::HandlePropertyInClassExtension(), inferARCWriteback(), isInvalidICRSource(), isNonTrivialToPrimitiveDefaultInitialize(), isNonWeakInMRRWithObjCWeak(), LookupMemberExpr(), pushTemporaryCleanup(), pushTemporaryCleanup(), setImpliedPropertyAttributeForReadOnlyProperty(), shouldExtendReceiverForInnerPointerMessage(), transferARCOwnershipToDeclSpec(), and tryEmitARCCopyWeakInit().
|
inline |
Definition at line 1453 of file TypeBase.h.
References clang::Qualifiers::getPointerAuth(), and getQualifiers().
Referenced by clang::Sema::ActOnFields(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildFunctionType(), clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), getBlockCaptureStr(), clang::ASTContext::getPointerAuthType(), hasAddressDiscriminatedPointerAuth(), and clang::CodeGen::ConstantEmitter::tryEmitPrivate().
|
inline |
Retrieve the set of qualifiers applied to this type.
Definition at line 8325 of file TypeBase.h.
References clang::Qualifiers::addFastQualifiers(), getLocalFastQualifiers(), and getQualifiers().
Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnFields(), clang::SemaObjC::actOnObjCTypeParam(), clang::applyObjCTypeArgs(), clang::ASTContext::BlockRequiresCopying(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildDeclRefExpr(), BuildImplicitBaseInitializer(), clang::Sema::BuildMemberExpr(), BuildSimilarlyQualifiedPointerType(), clang::Sema::BuiltinChangeSignedness(), clang::Sema::CheckAllocatedType(), clang::SemaCUDA::checkAllowedInitializer(), checkComplexDecomposition(), checkConditionalObjectPointersCompatibility(), checkConditionalPointerCompatibility(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), checkMemberDecomposition(), CheckOriginalCallArgDeduction(), clang::Sema::CheckPointerToMemberOperands(), checkVectorDecomposition(), clang::CIRGen::CIRGenFunction::createAggTemp(), clang::Sema::CreateBuiltinArraySubscriptExpr(), createPlaceholderSlot(), DeclTypeToString(), decomposeTypeForEH(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), clang::InitializationSequence::Diagnose(), clang::Sema::DiagnoseAssignmentResult(), DiagnoseUninitializedUse(), clang::CodeGen::CodeGenFunction::EmitAnyExprToExn(), emitBadConversionNotes(), clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::CodeGenFunction::EmitCompoundLiteralLValue(), clang::CIRGen::CIRGenFunction::emitCompoundLiteralLValue(), clang::CodeGen::CodeGenFunction::EmitCXXPseudoDestructorExpr(), EmitDeclDestroy(), clang::CodeGen::CGObjCRuntime::EmitInitOfCatchParam(), emitInitWithReductionInitializer(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), clang::CodeGen::CodeGenFunction::EmitObjCIvarRefLValue(), EmitOMPAggregateInit(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CGOpenMPRuntime::emitPrivateReduction(), EmitValToTemp(), emitValToTemp(), clang::SemaObjC::FindCompositeObjCPointerType(), fixParamWithSpan(), getAddressSpace(), getCommonArrayElementType(), clang::ASTContext::getDeclAlign(), clang::TypeName::getFullyQualifiedType(), clang::CIRGen::CIRGenModule::getNaturalTypeAlignment(), getObjCGCAttr(), getObjCLifetime(), getPointee2TypeText(), clang::getPointeeTypeText(), getPointerAuth(), getQualifiers(), clang::SemaObjC::handleExternallyRetainedAttr(), hasAddressSpace(), hasInconsistentOrSupersetQualifiersOf(), hasNonTrivialObjCLifetime(), hasStrongOrWeakObjCLifetime(), isAddressSpaceOverlapping(), isAtLeastAsQualifiedAs(), isMoreQualifiedThan(), isNonTrivialToPrimitiveCopy(), isNonTrivialToPrimitiveDefaultInitialize(), clang::Expr::isNullPointerConstant(), clang::Sema::isObjCPointerConversion(), clang::SemaObjC::isObjCWritebackConversion(), isQualificationConversionStep(), IsStructurallyEquivalent(), isSubstitutedType(), clang::isValidSwiftErrorResultType(), clang::CIRGen::LValue::makeAddr(), clang::CIRGen::LValue::makeVectorElt(), clang::ASTContext::mergeTypes(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformImplicitObjectArgumentInitialization(), clang::Sema::PerformObjectMemberConversion(), clang::TreeTransform< Derived >::RebuildQualifiedType(), clang::Sema::RefersToMemberWithReducedAlignment(), ResolveConstructorOverload(), StoreAnyExprIntoOneUnit(), storeAnyExprIntoOneUnit(), TryDefaultInitialization(), clang::tryMakeVariablePseudoStrong(), TryObjectArgumentInitialization(), TryReferenceInit(), TryReferenceInitializationCore(), TryRefInitWithConversionFunction(), TryReinterpretCast(), TryStaticCast(), TryUserDefinedConversion(), and TypeInfoIsInStandardLibrary().
|
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 1309 of file TypeBase.h.
References QualType().
Referenced by computeConditionalNullability(), and isOpenCLSizeDependentType().
|
inline |
Definition at line 1300 of file TypeBase.h.
References getSplitDesugaredType().
Referenced by getSplitDesugaredType().
|
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 8386 of file TypeBase.h.
References getSplitUnqualifiedType(), getTypePtr(), hasLocalQualifiers(), and split().
Referenced by clang::Sema::BuiltinDecay(), and getSplitUnqualifiedType().
|
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 8285 of file TypeBase.h.
References getTypePtr().
Referenced by clang::Sema::ActOnCastExpr(), clang::Sema::ActOnFields(), clang::SemaOpenMP::ActOnOpenMPDependClause(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::ActOnTag(), clang::Sema::ActOnTemplateIdType(), clang::SemaHLSL::ActOnUninitializedVarDecl(), addAssociatedClassesAndNamespaces(), clang::ASTContext::adjustObjCTypeParamBoundType(), clang::interp::Compiler< Emitter >::allocateLocal(), clang::interp::Compiler< Emitter >::allocateTemporary(), clang::Sema::BuildCXXNamedCast(), checkArrayExpressionDoesNotReferToUnitySize(), checkArrayExpressionDoesNotReferToWholeSize(), clang::SemaRISCV::CheckBuiltinFunctionCall(), clang::Sema::CheckCXXThrowOperand(), clang::Sema::CheckImplicitConversion(), checkIsValidOpenCLKernelParameter(), checkNoThrow(), CheckNullabilityTypeSpecifier(), clang::SemaObjC::CheckObjCConversion(), CheckResourceHandle(), clang::EnumDecl::completeDefinition(), clang::InterfaceKindVisitor::computeInterfaceKind(), clang::ObjCTypeParamDecl::Create(), clang::TemplateTypeParmDecl::Create(), createBufferHandleType(), clang::interp::Program::createDescriptor(), clang::TypeName::createNestedNameSpecifier(), clang::CodeGen::CodeGenModule::createOpenCLIntToSamplerConversion(), DiagnoseLocalRegisterBinding(), clang::Sema::DiagnoseUnusedButSetDecl(), clang::CodeGen::CGHLSLRuntime::emitResourceArraySubscriptExpr(), encodeTypeForFunctionPointerAuth(), FindVA(), clang::FunctionEffectsRef::get(), getBaseTypeIdentifier(), getCommonNNS(), clang::ASTContext::getCommonSugaredType(), clang::TypeName::getFullyQualifiedTemplateType(), clang::TypeName::getFullyQualifiedTemplateType(), clang::TypeName::getFullyQualifiedType(), getIntegerTypeForEnum(), getLastTemplateSpecType(), getLocalUnqualifiedType(), clang::CodeGen::CodeGenModule::getMemberFunctionPointer(), clang::SemaObjC::getMessageSendResultType(), getNonLValueExprType(), getNonPackExpansionType(), clang::interp::Program::getOrCreateDummy(), clang::interp::Program::getOrCreateRecord(), getRequiredQualification(), llvm::simplify_type< ::clang::QualType >::getSimplifiedValue(), getSplitUnqualifiedType(), getTupleLikeElementType(), getTypeAlignIfRequired(), getTypePtr(), clang::TypeLoc::getTypePtr(), getUnqualifiedType(), getUuidAttrOfType(), handleCallbackAttr(), hasNonTrivialToPrimitiveCopyCUnion(), hasNonTrivialToPrimitiveDefaultInitializeCUnion(), hasNonTrivialToPrimitiveDestructCUnion(), clang::ASTNodeImporter::hasReturnTypeDeclaredInside(), clang::ASTImporter::Import(), clang::Sema::inferGslPointerAttribute(), clang::interp::interp__builtin_operator_new(), isCanonical(), isCanonicalAsParam(), isCForbiddenLValueType(), isCXX11PODType(), isCXX98PODType(), IsDefaultBufferConstantDecl(), clang::Sema::IsFunctionConversion(), clang::CodeGen::ABIInfo::isHomogeneousAggregate(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), isNonTrivialToPrimitiveCopy(), isNonTrivialToPrimitiveDefaultInitialize(), clang::Type::isObjCARCImplicitlyUnretainedType(), IsOverloadOrOverrideImpl(), isResourceRecordTypeOrArrayOf(), clang::CodeGen::isSingleElementStruct(), clang::ASTImporter::IsStructurallyEquivalent(), isTrivialType(), clang::RetainTypeChecker::isUnretained(), isWebAssemblyExternrefType(), isWebAssemblyFuncrefType(), lookupPromiseType(), clang::Sema::MaybeBindToTemporary(), mayBeDynamicClass(), mayBeNotDynamicClass(), maybeTailCall(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), clang::StmtIteratorBase::NextVA(), operator*(), operator->(), clang::InitializationSequence::Perform(), printIntegral(), clang::SemaHLSL::ProcessResourceTypeAttributes(), rebuildAttributedTypeWithoutNullability(), requiresImplicitBufferLayoutStructure(), typeIsPostfix(), UseExcessPrecision(), clang::Value::Value(), clang::interp::Compiler< Emitter >::VisitCastExpr(), clang::interp::Compiler< Emitter >::VisitCXXNewExpr(), clang::interp::Compiler< Emitter >::VisitCXXReinterpretCastExpr(), clang::interp::Compiler< Emitter >::VisitCXXTypeidExpr(), and clang::RetainTypeChecker::visitTypedef().
|
inline |
Definition at line 8289 of file TypeBase.h.
References getTypePtrOrNull(), and isNull().
Referenced by clang::SemaOpenMP::ActOnOpenMPAlignedClause(), clang::SemaOpenMP::ActOnOpenMPDeclareSimdDirective(), clang::getArmStreamingFnType(), clang::ASTContext::getCommonSugaredType(), getTypePtrOrNull(), handleLifetimeCategoryAttr(), clang::isUnretained(), and clang::RetainTypeChecker::isUnretained().
|
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:
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 8379 of file TypeBase.h.
References getTypePtr(), getUnqualifiedType(), hasLocalQualifiers(), and QualType().
Referenced by clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnCXXTryBlock(), clang::SemaObjC::actOnObjCTypeParam(), clang::SemaOpenMP::ActOnOpenMPAlignedClause(), clang::SemaOpenMP::ActOnOpenMPCopyinClause(), clang::SemaOpenMP::ActOnOpenMPCopyprivateClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPPrivateClause(), clang::SemaObjC::ActOnPropertyImplDecl(), clang::Sema::AddConversionCandidate(), AdjustFunctionParmAndArgTypesForDeduction(), clang::applyObjCTypeArgs(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildBinOp(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCXXTypeConstructExpr(), buildDeclareReductionRef(), BuildImplicitBaseInitializer(), BuildSimilarlyQualifiedPointerType(), buildUserDefinedMapperRef(), clang::SemaPPC::BuiltinPPCMMACall(), captureInCapturedRegion(), clang::Sema::CheckAllocatedType(), clang::SemaARM::CheckARMBuiltinExclusiveCall(), clang::Sema::CheckAssignmentOperands(), checkBlockPointerTypesForAssignment(), clang::SemaOpenCL::checkBuiltinEnqueueKernel(), clang::SemaRISCV::CheckBuiltinFunctionCall(), clang::SemaOpenCL::checkBuiltinNDRangeAndBlock(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckConditionalOperands(), checkConditionalPointerCompatibility(), CheckIncrementDecrementOperand(), clang::Sema::CheckLiteralOperatorDeclaration(), clang::Sema::CheckMatrixElementwiseOperands(), clang::Sema::CheckMatrixMultiplyOperands(), clang::SemaObjC::CheckObjCARCUnavailableWeakConversion(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), CheckOperatorNewDeleteTypes(), CheckOriginalCallArgDeduction(), checkPointerAuthValue(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckSizelessVectorConditionalTypes(), clang::Sema::CheckSizelessVectorOperands(), clang::Sema::CheckSubtractionOperands(), clang::Sema::CheckTemplateArgument(), checkTrivialSubobjectCall(), clang::Sema::checkTypeSupport(), CheckUnicodeArithmeticConversions(), clang::SemaOpenACC::CheckVarIsPointerType(), clang::Sema::CheckVectorConditionalTypes(), clang::Sema::CheckVectorOperands(), CompareDerivedToBaseConversions(), CompareStandardConversionSequences(), clang::dataflow::copyRecord(), clang::SemaOpenACC::CreateFirstPrivateInitRecipe(), clang::SemaOpenACC::CreatePrivateInitRecipe(), clang::SemaOpenACC::CreateReductionInitRecipe(), decomposeTypeForEH(), clang::Sema::deduceClosureReturnType(), DeduceForEachType(), clang::Sema::DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::DiagnoseAssignmentEnum(), clang::Sema::DiagnoseAssignmentResult(), DiagnoseBadFunctionCast(), DiagnoseCastOfObjCSEL(), DiagnoseMixedUnicodeImplicitConversion(), clang::SemaObjC::DiagnosePropertyAccessorMismatch(), clang::CodeGen::CodeGenFunction::EmitAndRegisterVariableArrayDimensions(), clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), clang::CIRGen::CIRGenFunction::emitAtomicExpr(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), FindConversionForRefInit(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), getNonLValueExprType(), clang::CIRGen::CIRGenFunction::getOpenACCDataOperandInfo(), getUnqualifiedType(), handleDiagnoseAsBuiltinAttr(), HandleDynamicCast(), hasUserDefinedMapper(), isAtLeastAsQualifiedAs(), clang::Sema::IsBlockPointerConversion(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), isLayoutCompatible(), clang::SemaObjC::isObjCWritebackConversion(), isOpenCLSizeDependentType(), clang::Sema::IsQualificationConversion(), clang::ento::cocoa::isRefType(), clang::SemaHLSL::IsScalarizedLayoutCompatible(), IsStandardConversion(), IsStringInit(), clang::ASTContext::isTypeIgnoredBySanitizer(), isValidInteropVariable(), maybeAdjustInterfaceForSubscriptingCheck(), clang::ASTContext::mergeFunctionTypes(), clang::ASTContext::mergeTypes(), OpenCLConvertScalarsToVectors(), clang::InitializationSequence::Perform(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformImplicitConversion(), clang::TemplateParamObjectDecl::printAsExpr(), clang::TreeTransform< Derived >::RebuildQualifiedType(), clang::dataflow::recordsEqual(), ResolveOverloadedFunctionForReferenceBinding(), clang::Sema::tryCaptureVariable(), clang::CodeGen::CodeGenFunction::tryEmitAsConstant(), TryLValueToRValueCast(), TryRefInitWithConversionFunction(), TryStaticDowncast(), TryUserDefinedConversion(), TryUserDefinedConversion(), and clang::Sema::UsualArithmeticConversions().
|
inline |
Definition at line 1457 of file TypeBase.h.
References getPointerAuth().
Referenced by clang::ASTContext::BlockRequiresCopying(), clang::Sema::checkIllFormedTrivialABIStruct(), clang::ASTContext::hasUniqueObjectRepresentations(), isNonTrivialToPrimitiveCopy(), and isTriviallyCopyableTypeImpl().
|
inline |
Check if this type has any address space qualifier.
Definition at line 8406 of file TypeBase.h.
References getQualifiers(), and hasAddressSpace().
Referenced by builtinAllocaAddrSpace(), deduceOpenCLPointeeAddrSpace(), DiagnoseImpCast(), hasAddressSpace(), clang::InitializationSequence::Perform(), clang::SemaHLSL::transformInitList(), and TryObjectArgumentInitialization().
|
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 1074 of file TypeBase.h.
References clang::isa().
Referenced by getLocalQualifiers(), hasLocalQualifiers(), and split().
|
inline |
Determine whether this particular QualType instance has any qualifiers, without looking through any typedefs that might add qualifiers at a different level.
Definition at line 1064 of file TypeBase.h.
References getLocalFastQualifiers(), and hasLocalNonFastQualifiers().
Referenced by clang::ASTContext::getConstantArrayType(), clang::ASTContext::getIncompleteArrayType(), getSplitUnqualifiedType(), getUnqualifiedType(), clang::ASTContext::getUsingType(), clang::ASTContext::getVariableArrayType(), hasQualifiers(), and isCanonicalAsParam().
|
inline |
Definition at line 1442 of file TypeBase.h.
References getQualifiers(), and clang::Qualifiers::hasNonTrivialObjCLifetime().
Referenced by clang::Sema::ActOnFields(), BuildImplicitMemberInitializer(), checkTrivialClassMembers(), EvaluateBinaryTypeTrait(), isCXX11PODType(), isCXX98PODType(), clang::Sema::IsCXXTriviallyRelocatableType(), and isTrivialType().
|
inline |
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.
Definition at line 87 of file Type.h.
References getAsRecordDecl(), getTypePtr(), and hasNonTrivialToPrimitiveCopyCUnion().
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnFields(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::CheckLValueToRValueConversionOperand(), clang::Sema::checkNonTrivialCUnion(), clang::Sema::checkNonTrivialCUnionInInitializer(), clang::Sema::CreateBuiltinBinOp(), hasNonTrivialToPrimitiveCopyCUnion(), and markEscapingByrefs().
|
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 75 of file Type.h.
References getAsRecordDecl(), getTypePtr(), and hasNonTrivialToPrimitiveDefaultInitializeCUnion().
Referenced by clang::Sema::ActOnFields(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::checkNonTrivialCUnion(), clang::Sema::checkNonTrivialCUnionInInitializer(), and hasNonTrivialToPrimitiveDefaultInitializeCUnion().
|
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 81 of file Type.h.
References getAsRecordDecl(), getTypePtr(), and hasNonTrivialToPrimitiveDestructCUnion().
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnFields(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::CheckLValueToRValueConversionOperand(), clang::Sema::checkNonTrivialCUnion(), hasNonTrivialToPrimitiveDestructCUnion(), and markEscapingByrefs().
|
inline |
Determine whether this type has any qualifiers.
Definition at line 8374 of file TypeBase.h.
References hasLocalQualifiers(), and hasQualifiers().
Referenced by clang::SemaObjC::actOnObjCTypeParam(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionType(), AdjustFunctionParmAndArgTypesForDeduction(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckTemplateArgument(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::CreateGenericSelectionExpr(), DeclTypeToString(), DeduceTemplateArgumentsByTypeMatch(), fixParamWithSpan(), GetFullTypeForDeclarator(), getPointee2TypeText(), clang::getPointeeTypeText(), hasQualifiers(), clang::Sema::IsBlockPointerConversion(), isCForbiddenLValueType(), clang::ASTContext::mergeFunctionTypes(), and TryUserDefinedConversion().
|
inline |
Definition at line 1446 of file TypeBase.h.
References getQualifiers(), and clang::Qualifiers::hasStrongOrWeakObjCLifetime().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXPseudoDestructorExpr(), and clang::CIRGen::CIRGenFunction::emitCXXPseudoDestructorExpr().
|
inline |
Returns the specified type after dropping any outer-level parentheses.
Definition at line 1315 of file TypeBase.h.
References IgnoreParens(), clang::isa(), and QualType().
Referenced by IgnoreParens().
|
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 1416 of file TypeBase.h.
References getQualifiers(), clang::Qualifiers::isAddressSpaceSupersetOf(), QualType(), and clang::T.
Referenced by checkArithmeticBinOpPointerOperands(), and clang::Sema::CheckCompareOperands().
|
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 8450 of file TypeBase.h.
References getQualifiers(), getUnqualifiedType(), isAtLeastAsQualifiedAs(), QualType(), and clang::Qualifiers::removeUnaligned().
Referenced by clang::SemaARM::CheckARMBuiltinExclusiveCall(), checkObjCPointerTypesForAssignment(), clang::Sema::CheckOverridingFunctionReturnType(), isAtLeastAsQualifiedAs(), clang::Sema::isObjCPointerConversion(), TryClassUnification(), and TryObjectArgumentInitialization().
bool QualType::isBitwiseCloneableType | ( | const ASTContext & | Context | ) | const |
Return true if the type is safe to bitwise copy using memcpy/memmove.
This is an extension in clang: bitwise cloneable types act as trivially copyable types, meaning their underlying bytes can be safely copied by memcpy or memmove. After the copy, the destination object has the same object representation.
However, there are cases where it is not safe to copy:
Definition at line 2873 of file Type.cpp.
References getCanonicalType().
|
inline |
Definition at line 8342 of file TypeBase.h.
References getTypePtr(), and isCanonical().
Referenced by checkBlockPointerTypesForAssignment(), checkObjCPointerTypesForAssignment(), checkPointerTypesForAssignment(), clang::ASTContext::getArrayParameterType(), clang::ASTContext::getCommonSugaredType(), clang::ASTContext::getConstantArrayType(), clang::ASTContext::getConstantMatrixType(), clang::ASTContext::getDependentNameType(), clang::ASTContext::getExtVectorType(), clang::ASTContext::getIncompleteArrayType(), clang::ASTContext::getMacroQualifiedType(), clang::ASTContext::getObjCObjectPointerType(), clang::ASTContext::getObjCObjectType(), clang::ASTContext::getPackExpansionType(), clang::ASTContext::getParenType(), clang::ASTContext::getUnaryTransformType(), clang::ASTContext::getVariableArrayType(), clang::ASTContext::getVectorType(), isCanonical(), isCanonicalAsParam(), isCanonicalExceptionSpecification(), and clang::Sema::MergeFunctionDecl().
|
inline |
Definition at line 8346 of file TypeBase.h.
References getTypePtr(), hasLocalQualifiers(), clang::isa(), isCanonical(), isCanonicalAsParam(), and clang::T.
Referenced by isCanonicalAsParam().
|
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:
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 8477 of file TypeBase.h.
References getTypePtr(), hasQualifiers(), and isCForbiddenLValueType().
Referenced by clang::Sema::CreateBuiltinArraySubscriptExpr(), and isCForbiddenLValueType().
|
inline |
Definition at line 1097 of file TypeBase.h.
References isConstant().
Referenced by clang::SemaOpenMP::ActOnOpenMPDetachClause(), clang::SemaOpenMP::ActOnOpenMPFirstprivateClause(), clang::SemaOpenMP::ActOnOpenMPUsesAllocatorClause(), areAllValuesNoReturn(), clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal(), clang::CodeGen::CodeGenModule::getOrCreateStaticVarDecl(), isConstant(), isNonConstantStorage(), clang::MaterializeTemporaryExpr::isUsableInConstantExpressions(), reportOriginalDsa(), and clang::interp::Compiler< Emitter >::visitDeclRef().
|
inline |
Definition at line 1036 of file TypeBase.h.
References isNonConstantStorage().
Referenced by clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(), createReferenceTemporary(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitCXXGlobalVarDeclInit(), clang::CIRGen::CIRGenModule::emitGlobalVarDefinition(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalTemporary(), clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal(), and clang::CIRGen::CIRGenModule::mayBeEmittedEagerly().
|
inline |
Determine whether this type is const-qualified.
Definition at line 8358 of file TypeBase.h.
References isConstQualified(), and isLocalConstQualified().
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), clang::Sema::ActOnFinishFunctionBody(), clang::SemaObjC::ActOnObjCForCollectionStmt(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::AddInitializerToDecl(), alignReferenceTypes(), clang::interp::Compiler< Emitter >::allocateLocal(), clang::interp::Compiler< Emitter >::allocateTemporary(), appendQualifier(), basicGVALinkageForVariable(), clang::Sema::BuildAtomicExpr(), BuildImplicitMemberInitializer(), captureInCapturedRegion(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), clang::Sema::CheckLiteralOperatorDeclaration(), decomposeTypeForEH(), DiagnoseForRangeVariableCopies(), clang::SemaSwift::DiagnoseName(), diagnoseOpenCLTypes(), DiagnoseRecursiveConstFields(), diagnoseUnknownDecl(), emitReadOnlyPlacementAttrWarning(), clang::ento::ExprEngine::evalCall(), evaluateLValueAsAllocSize(), findSubobject(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), getConstField(), clang::CodeGen::CodeGenModule::GetGlobalVarAddressSpace(), getInnermostEnclosingConstDeclRegion(), clang::interp::Program::getOrCreateDummy(), clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal(), clang::interp::Program::getOrCreateRecord(), getSubobjectType(), clang::ento::MemRegionManager::getVarRegion(), clang::consumed::ConsumedStmtVisitor::handleCall(), clang::Sema::handlerCanCatch(), libc_func_matchers::hasUnsafePrintfStringArg(), libc_func_matchers::hasUnsafeSnprintfBuffer(), clang::SemaCUDA::IdentifyTarget(), isConstQualified(), isEffectivelyConstRegion(), isPointerToConst(), isPointerToConst(), isPointerToConst(), isReferenceToNonConstCapture(), IsTypeModifiable(), isVoidPointerToNonConst(), MarkVarDeclODRUsed(), clang::analyze_format_string::ArgType::matchesType(), clang::SemaCUDA::MaybeAddConstantAttr(), resolveAllocationOverloadInterior(), ShouldDiagnoseSwitchCaseNotInEnum(), clang::Sema::SpecialMemberIsTrivial(), clang::Sema::tryCaptureVariable(), TryConstructorInitialization(), TryDefaultInitialization(), TryListConversion(), TryReferenceInit(), tryRemoveRetainOfSelf(), clang::interp::Compiler< Emitter >::VisitMaterializeTemporaryExpr(), and clang::interp::Compiler< Emitter >::visitVarDecl().
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 3112 of file Type.cpp.
References clang::Type::getAsRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), getTypePtr(), hasNonTrivialObjCLifetime(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Type::isScalarType(), clang::Type::isSizelessBuiltinType(), and clang::Type::isVectorType().
Referenced by isPODType().
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 2703 of file Type.cpp.
References clang::cast(), clang::Type::getTypeClass(), getTypePtr(), hasNonTrivialObjCLifetime(), isNull(), and QualType().
Referenced by isPODType(), and clang::Sema::isValidVarArgType().
|
inline |
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.
Definition at line 1545 of file TypeBase.h.
Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnFields(), clang::ASTContext::BlockRequiresCopying(), clang::Sema::BuildCompoundLiteralExpr(), checkDestructorsRequired(), CheckLValueConstantExpression(), checkNoThrow(), clang::Sema::checkVariadicArgument(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), clang::Sema::DefaultLvalueConversion(), clang::CodeGen::CGObjCRuntime::destroyCalleeDestroyedArguments(), EmitArrayDelete(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::ReductionCodeGen::emitCleanups(), clang::CodeGen::CodeGenFunction::EmitCompoundLiteralLValue(), clang::CIRGen::CIRGenFunction::emitCompoundLiteralLValue(), clang::CodeGen::CodeGenFunction::EmitInitializerForField(), clang::CIRGen::CIRGenFunction::emitInitializerForField(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), EmitMemberInitializer(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), clang::CodeGen::CGOpenMPRuntime::emitThreadPrivateVarDefinition(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::Sema::isValidVarArgType(), clang::Sema::MaybeBindToTemporary(), clang::CodeGen::ReductionCodeGen::needCleanups(), clang::VarDecl::needsDestruction(), clang::InitializationSequence::Perform(), pushCaptureCleanup(), pushTemporaryCleanup(), pushTemporaryCleanup(), clang::CodeGen::CGCXXABI::requiresArrayCookie(), and clang::DestructedTypeVisitor< GenDestructorFuncName >::visit().
|
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 1014 of file TypeBase.h.
References clang::Qualifiers::Const, and getLocalFastQualifiers().
Referenced by isConstQualified().
|
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 1044 of file TypeBase.h.
References getLocalFastQualifiers(), and clang::Qualifiers::Restrict.
Referenced by isRestrictQualified().
|
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 1054 of file TypeBase.h.
References getLocalFastQualifiers(), and clang::Qualifiers::Volatile.
Referenced by isVolatileQualified().
|
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 8439 of file TypeBase.h.
References clang::Qualifiers::compatiblyIncludes(), getQualifiers(), isMoreQualifiedThan(), and QualType().
Referenced by buildDeclareReductionRef(), CompareStandardConversionSequences(), and isMoreQualifiedThan().
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 151 of file Type.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), clang::ASTContext::getLangOpts(), isConstant(), MutableField, NonConstNonReferenceType, NonTrivialCtor, and NonTrivialDtor.
Referenced by isConstantStorage().
QualType::PrimitiveCopyKind QualType::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.
Definition at line 2970 of file Type.cpp.
References getAsRecordDecl(), clang::Qualifiers::getObjCLifetime(), getQualifiers(), getTypePtr(), hasAddressDiscriminatedPointerAuth(), clang::Qualifiers::hasVolatile(), clang::RecordDecl::isNonTrivialToPrimitiveCopy(), clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, PCK_ARCStrong, PCK_ARCWeak, PCK_PtrAuth, PCK_Struct, PCK_Trivial, and PCK_VolatileTrivial.
Referenced by clang::Sema::ActOnFields(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), isNonTrivialToPrimitiveDestructiveMove(), and clang::CopiedTypeVisitor< SearchNonTrivialToCopyField, false >::visit().
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 2954 of file Type.cpp.
References getAsRecordDecl(), getObjCLifetime(), getQualifiers(), getTypePtr(), clang::RecordDecl::isNonTrivialToPrimitiveDefaultInitialize(), 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< GenDefaultInitializeFuncName >::visit().
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 2990 of file Type.cpp.
References isNonTrivialToPrimitiveCopy().
Referenced by clang::ASTContext::BlockRequiresCopying(), and clang::CopiedTypeVisitor< SearchNonTrivialToCopyField, false >::visit().
bool QualType::isNonWeakInMRRWithObjCWeak | ( | const ASTContext & | Context | ) | const |
Definition at line 2921 of file Type.cpp.
References getObjCLifetime(), and clang::Qualifiers::OCL_Weak.
Referenced by clang::Sema::AddInitializerToDecl(), and clang::Sema::CheckAssignmentOperands().
|
inline |
Return true if this QualType doesn't point to a type yet.
Definition at line 1004 of file TypeBase.h.
Referenced by clang::SemaOpenACC::ActOnArraySectionExpr(), clang::Sema::ActOnArraySubscriptExpr(), clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnBuiltinOffsetOf(), clang::Sema::ActOnCapScopeReturnStmt(), clang::SemaObjC::ActOnClassMessage(), clang::SemaObjC::ActOnClassPropertyRefExpr(), clang::Sema::ActOnConditionalOp(), clang::Sema::ActOnDependentIdExpression(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), clang::Sema::ActOnNumericConstant(), clang::SemaObjC::ActOnObjCForCollectionStmt(), clang::SemaObjC::actOnObjCTypeArgsAndProtocolQualifiers(), clang::SemaObjC::actOnObjCTypeArgsOrProtocolQualifiers(), clang::SemaOpenMP::ActOnOMPArraySectionExpr(), clang::SemaOpenMP::ActOnOpenMPCall(), clang::SemaOpenMP::ActOnOpenMPDeclareMapperType(), clang::SemaOpenMP::ActOnOpenMPDeclareReductionType(), clang::SemaOpenMP::ActOnOpenMPDependClause(), clang::SemaOpenMP::ActOnOpenMPUsesAllocatorClause(), clang::Sema::ActOnPseudoDestructorExpr(), clang::SemaOpenACC::ActOnRoutineName(), clang::SemaOpenMP::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(), clang::SemaObjC::ActOnSuperClassOfClassInterface(), clang::SemaObjC::ActOnSuperMessage(), clang::Sema::ActOnTemplateIdType(), clang::Sema::ActOnTypeRequirement(), clang::SemaSYCL::ActOnUniqueStableNameExpr(), clang::Sema::ActOnUsingEnumDeclaration(), clang::SemaOpenACC::ActOnVariableInit(), clang::Sema::AddFunctionCandidates(), clang::Sema::AddInitializerToDecl(), clang::Sema::AddMethodCandidate(), AddMethodTemplateCandidateImmediately(), clang::Sema::AddModeAttr(), AddObjCKeyValueCompletions(), AddOrdinaryNameResults(), addThisCompletion(), clang::hlsl::TemplateParameterListBuilder::addTypeParameter(), clang::Sema::adjustCCAndNoReturn(), AdjustingCFIUncheckedCallee(), clang::interp::Compiler< Emitter >::allocateLocal(), allowAmbiguity(), clang::ASTContext::areCommonBaseCompatible(), assertEqualBitWidths(), clang::ento::ProgramState::assumeInBoundDual(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P_OVERLOAD(), clang::ast_matchers::AST_POLYMORPHIC_MATCHER_P_OVERLOAD(), clang::SemaObjC::BuildClassMessageImplicit(), buildCoroutineHandle(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildCXXNew(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildDeclaratorGroup(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::buildLambdaInitCaptureInitialization(), clang::SemaObjC::BuildObjCEncodeExpression(), clang::SemaObjC::BuildObjCStringLiteral(), clang::Sema::BuildReturnStmt(), BuildSimilarlyQualifiedPointerType(), clang::Sema::BuildTypeAwareUsualDelete(), clang::Sema::BuildVAArgExpr(), BuiltinAddressof(), clang::Sema::BuiltinChangeSignedness(), clang::hlsl::BuiltinTypeMethodBuilder::callBuiltin(), clang::Sema::canDelayFunctionBody(), clang::Sema::canThrow(), clang::Sema::CheckAdditionOperands(), clang::Sema::CheckAssignmentOperands(), clang::Sema::CheckBitwiseOperands(), checkBuiltinTemplateIdType(), clang::Sema::CheckConditionalOperands(), checkConditionalPointerCompatibility(), checkDeducedTemplateArguments(), CheckDeductionConsistency(), clang::Sema::CheckDestructorAccess(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), CheckIncrementDecrementOperand(), clang::SemaObjC::checkInitMethod(), CheckKeyForObjCARCConversion(), clang::Sema::CheckMultiplyDivideOperands(), clang::Sema::CheckNonDependentConversions(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), clang::Sema::CheckOverridingFunctionReturnType(), clang::Sema::CheckPlaceholderExpr(), clang::Sema::CheckRemainderOperands(), clang::Sema::CheckSizelessVectorCompareOperands(), clang::Sema::CheckSizelessVectorConditionalTypes(), clang::Sema::CheckSubtractionOperands(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTemplateIdType(), checkTupleLikeDecomposition(), clang::Sema::checkTypeSupport(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::CheckVectorCompareOperands(), clang::Sema::CheckVectorLogicalOperands(), ClassifyImplicitMemberAccess(), clang::SemaCodeCompletion::CodeCompleteObjCClassMessage(), clang::SemaCodeCompletion::CodeCompleteObjCInstanceMessage(), clang::SemaCodeCompletion::CodeCompleteObjCMethodDecl(), clang::SemaCodeCompletion::CodeCompleteQualifiedId(), clang::Sema::containsUnexpandedParameterPacks(), ConvertTypeToDiagnosticString(), clang::dataflow::copyRecord(), create_call_once(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CreateBuiltinUnaryOp(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), clang::CreateHLSLAttributedResourceType(), clang::Sema::CXXCheckConditionalOperands(), decomposeTypeForEH(), clang::Sema::DeduceAutoType(), clang::Sema::deduceClosureReturnType(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::DeduceVariableDeclarationType(), clang::Sema::deduceVarTypeFromInitializer(), clang::Sema::DefaultArgumentPromotion(), clang::Sema::DefaultFunctionArrayConversion(), determineEndOffset(), clang::Sema::DiagnoseAlwaysNonNullPointer(), DiagnoseBadDeduction(), DiagnoseForRangeReferenceVariableCopies(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::ento::SMTConv::doIntTypeConversion(), clang::ento::SMTConv::doTypeConversion(), EmitAsmStores(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CIRGen::CIRGenFunction::emitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitPromotedScalarExpr(), clang::CIRGen::CIRGenFunction::emitPromotedScalarExpr(), clang::CIRGen::CIRGenFunction::emitUnaryOpLValue(), encodeTypeForFunctionPointerAuth(), clang::ento::StoreManager::evalBaseToDerived(), clang::ento::ExprEngine::evalCall(), clang::ento::retaincountchecker::RetainCountChecker::evalCall(), clang::ento::ExprEngine::evalLoad(), EvaluateAsRValue(), evaluateCDTSize(), EvaluateInPlace(), FastEvaluateAsRValue(), clang::Sema::FindAllocationFunctions(), clang::Sema::FindCompositePointerType(), FindDesignatorMismatch(), FindImplementableMethods(), findOMPAllocatorHandleT(), findOMPAlloctraitT(), findOMPDependT(), findOMPEventHandleT(), FinishForRangeVarDecl(), clang::Sema::FinishTemplateArgumentDeduction(), clang::ento::SMTConv::fixAPSInt(), fixVarDeclWithArray(), generateDiagnosticsForCallLike(), clang::FunctionEffectsRef::get(), clang::ento::SMTConv::getAPSIntType(), clang::CodeGen::CodeGenFunction::getAsNaturalAddressOf(), clang::ASTContext::getAutoType(), clang::CallExpr::getCallReturnType(), clang::ASTContext::getCommentForDecl(), clang::Sema::getCurrentThisType(), clang::ento::CXXInstanceCall::getDeclForDynamicType(), clang::ASTContext::getDecltypeType(), clang::ASTContext::getDeducedTemplateSpecializationType(), getDependTypes(), clang::Sema::getDestructorName(), clang::Sema::getDestructorTypeForDecltype(), GetEnumUnderlyingType(), getExistingLazyBinding(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForEnum(), GetFullTypeForDeclarator(), clang::Decl::getFunctionType(), getGlobalStreamPointerByName(), getKmpAffinityType(), getLambdaType(), clang::ento::StoreManager::getLValueElement(), clang::Sema::getMostSpecialized(), clang::Sema::GetNameFromUnqualifiedId(), getNSNumberFactoryMethod(), clang::Type::getObjCSubstitutions(), clang::interp::Program::getOrCreateDummy(), clang::dataflow::DataflowAnalysisContext::getOrCreateNullPointerValue(), clang::CodeGen::CGDebugInfo::getOrCreateStandaloneType(), getParamType(), getPointerAuthInfoForPointeeType(), getPreferredArgumentTypeForMessageSend(), getPrettyTypeName(), getPrivateItem(), clang::ASTContext::getPromotedIntegerType(), clang::ento::ObjCMethodCall::getRuntimeDefinition(), getStdTrait(), clang::ObjCObjectPointerType::getSuperClassType(), clang::ASTContext::getTemplateSpecializationType(), getTemplateSpecializationTypeDependence(), clang::Sema::getTrivialTemplateArgumentLoc(), getTupleLikeElementType(), clang::ASTContext::getTypedefType(), clang::Sema::GetTypeFromParser(), getTypePtrOrNull(), clang::ASTContext::getUnaryTransformType(), clang::ASTContext::getUsingType(), clang::ento::MemRegionManager::getVarRegion(), HandleAddressSpaceTypeAttribute(), clang::Sema::HandleDependentAccessCheck(), clang::Sema::HandleFunctionTypeMismatch(), clang::SemaObjC::handleXReturnsXRetainedAttr(), hasBPFPreserveStaticOffset(), hasNonTrivialConstructorCall(), clang::ASTContext::hasUniqueObjectRepresentations(), libc_func_matchers::hasUnsafePrintfStringArg(), HelperIsMethodInObjCType(), clang::ASTImporter::Import(), clang::ASTReader::InitializeContext(), clang::InitializationSequence::InitializeFrom(), instantiateOMPDeclareVariantAttr(), IsAcceptableNonMemberOperatorCandidate(), clang::IsArmStreamingFunction(), isCXX98PODType(), clang::Declarator::isDeclarationOfFunction(), isImplicitMapperNeeded(), isIndirectPointerType(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), isLayoutCompatible(), isOSObjectRelated(), isPointerToConst(), isPointerToObject(), clang::SemaHLSL::IsScalarizedLayoutCompatible(), isStdStreamVar(), IsStructurallyEquivalent(), isSubstitutedType(), isTrivialType(), isTupleLike(), clang::SemaHLSL::IsTypedResourceElementCompatible(), clang::FunctionDecl::isUsableAsGlobalAllocationFunctionInConstantEvaluation(), clang::SemaObjC::isValidOSObjectOutParameter(), clang::isValidSubjectOfOSAttribute(), clang::Sema::LazilyCreateBuiltin(), lookupCoroutineHandleType(), clang::ComparisonCategories::lookupInfoForType(), LookupMemberExpr(), clang::Sema::LookupParsedName(), lookupPromiseType(), clang::Sema::LookupQualifiedName(), clang::Sema::LookupTemplateName(), 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::SemaObjC::ParseObjCProtocolExpression(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformImplicitObjectArgumentInitialization(), clang::APValue::printPretty(), ProcessAPINotes(), clang::ento::ExprEngine::processCallExit(), processImplicitMapsWithDefaultMappers(), clang::TypedefType::Profile(), clang::ASTRecordReader::readTypeSourceInfo(), clang::TreeTransform< Derived >::RebuildUnresolvedUsingType(), recoverFromMSUnqualifiedLookup(), REGISTER_MAP_WITH_PROGRAMSTATE(), clang::CodeGen::SanitizerMetadata::reportGlobal(), clang::SemaObjC::SelectorsForTypoCorrection(), clang::Expr::setType(), shouldNotPrintDirectly(), clang::Sema::SubstituteExplicitTemplateArguments(), clang::Sema::SubstType(), throwEscapes(), clang::interp::Pointer::toRValue(), 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::SemaOpenMP::tryCaptureOpenMPLambdas(), clang::Sema::tryExprAsCall(), TryOrBuildParenListInitialization(), tryRearrange(), TryReinterpretCast(), TryToFixInvalidVariablyModifiedType(), TryToFixInvalidVariablyModifiedTypeSourceInfo(), tryToInvalidateFReadBufferByElements(), clang::Sema::tryToRecoverWithCall(), clang::ASTContext::typesAreBlockPointerCompatible(), clang::ASTContext::typesAreCompatible(), UnwrapTypeForDebugInfo(), clang::Sema::UsualArithmeticConversions(), clang::Sema::UsualUnaryConversions(), clang::Sema::UsualUnaryFPConversions(), clang::FunctionCallFilterCCC::ValidateCandidate(), clang::interp::Compiler< Emitter >::visit(), clang::interp::Compiler< Emitter >::VisitCastExpr(), clang::UsedDeclVisitor< DeferredDiagnosticsEmitter >::VisitCXXDeleteExpr(), clang::ASTDeclReader::VisitDeclaratorDecl(), clang::ASTNodeTraverser< Derived, NodeDelegateType >::VisitHLSLAttributedResourceType(), clang::ASTNodeImporter::VisitTypedefNameDecl(), and clang::interp::Compiler< Emitter >::visitVarDecl().
|
inline |
true when Type is objc's strong.
Definition at line 1433 of file TypeBase.h.
References getObjCGCAttr(), and clang::Qualifiers::Strong.
Referenced by clang::Sema::ActOnFields(), clang::SemaObjC::ActOnPropertyImplDecl(), and GetGCAttrTypeForType().
|
inline |
true when Type is objc's weak.
Definition at line 1428 of file TypeBase.h.
References getObjCGCAttr(), and clang::Qualifiers::Weak.
Referenced by clang::SemaObjC::ActOnPropertyImplDecl(), clang::CodeGen::CodeGenFunction::EmitAutoVarCleanups(), and GetGCAttrTypeForType().
bool QualType::isPODType | ( | const ASTContext & | Context | ) | const |
Determine whether this is a Plain Old Data (POD) type (C++ 3.9p10).
Definition at line 2695 of file Type.cpp.
References isCXX11PODType(), and isCXX98PODType().
Referenced by clang::Sema::BuildVAArgExpr(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::DiagnoseSizeOfParametersAndReturnValue(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), clang::CIRGen::CIRGenFunction::emitCXXNewExpr(), EmitMemberInitializer(), and getOpenCLKernelParameterType().
|
inline |
Definition at line 8293 of file TypeBase.h.
References isReferenceable(), clang::RQ_None, and clang::Self.
Referenced by isReferenceable().
|
inline |
Determine whether this type is restrict-qualified.
Definition at line 8363 of file TypeBase.h.
References isLocalRestrictQualified(), and isRestrictQualified().
Referenced by appendQualifier(), clang::SemaPPC::BuiltinPPCMMACall(), CheckC23ConstexprVarType(), CollectVRQualifiers(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), and isRestrictQualified().
bool QualType::isTriviallyCopyableType | ( | const ASTContext & | Context | ) | const |
Return true if this is a trivially copyable type (C++0x [basic.types]p9)
Definition at line 2867 of file Type.cpp.
References isTriviallyCopyableTypeImpl().
Referenced by clang::Sema::BuildAtomicExpr(), checkTypeMappable(), createObjCPropertyGetter(), clang::ASTContext::hasUniqueObjectRepresentations(), clang::interp::interp__builtin_memcpy(), clang::SemaOpenMP::isOpenMPPrivateDecl(), IsTriviallyRelocatableType(), clang::CodeGen::CodeGenModule::MayDropFunctionReturn(), and clang::CIRGen::mayDropFunctionReturn().
bool QualType::isTriviallyCopyConstructibleType | ( | const ASTContext & | Context | ) | const |
Return true if this is a trivially copyable type.
Definition at line 2915 of file Type.cpp.
References isTriviallyCopyableTypeImpl().
Referenced by DiagnoseForRangeConstVariableCopies().
bool QualType::isTrivialType | ( | const ASTContext & | Context | ) | const |
Return true if this is a trivial type per (C++0x [basic.types]p9)
Definition at line 2758 of file Type.cpp.
References clang::Type::getAsCXXRecordDecl(), getTypePtr(), hasNonTrivialObjCLifetime(), clang::isa(), clang::Type::isDependentType(), isNull(), clang::Type::isScalarType(), clang::Type::isVectorType(), and QualType().
Referenced by clang::cross_tu::shouldImport().
|
inline |
Determine whether this type is volatile-qualified.
Definition at line 8369 of file TypeBase.h.
References isLocalVolatileQualified(), and isVolatileQualified().
Referenced by clang::Sema::ActOnFields(), clang::Sema::AddInitializerToDecl(), appendQualifier(), basicGVALinkageForVariable(), clang::Sema::BuildFunctionType(), clang::SemaPPC::BuiltinPPCMMACall(), clang::Sema::CheckAssignmentOperands(), CheckC23ConstexprVarType(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), CheckIdentityFieldAssignment(), CheckIncrementDecrementOperand(), clang::Sema::CheckLiteralOperatorDeclaration(), clang::Sema::CheckLValueToRValueConversionOperand(), clang::Sema::CheckUnusedVolatileAssignment(), clang::interp::CheckVolatile(), CollectVRQualifiers(), decomposeTypeForEH(), clang::InitializationSequence::Diagnose(), DiagnoseSelfAssignment(), clang::CodeGen::CodeGenFunction::emitAlignmentAssumptionCheck(), clang::CodeGen::CodeGenFunction::EmitAMDGPUBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), EmitCheckedMixedSignMultiply(), EmitCheckedUnsignedMultiplySignedResult(), clang::CodeGen::CodeGenFunction::EmitCXXPseudoDestructorExpr(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), emitOMPAtomicCompareExpr(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), findCompleteObject(), findSubobject(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), getBlockCaptureStr(), clang::Sema::getNamedReturnInfo(), clang::interp::Program::getOrCreateRecord(), getSubobjectType(), clang::Sema::handlerCanCatch(), clang::Expr::HasSideEffects(), clang::CXXRecordDecl::isLiteral(), clang::Expr::isUnusedResultAWarning(), clang::MaterializeTemporaryExpr::isUsableInConstantExpressions(), clang::AtomicExpr::isVolatile(), isVolatileQualified(), MaybeDecrementCount(), shouldExtendLifetime(), TryListConversion(), TryReferenceInit(), and clang::interp::Compiler< Emitter >::VisitCastExpr().
bool QualType::isWebAssemblyExternrefType | ( | ) | const |
Returns true if it is a WebAssembly Externref Type.
Definition at line 2944 of file Type.cpp.
References getTypePtr(), and clang::Type::isWebAssemblyExternrefType().
Referenced by clang::SemaWasm::BuiltinWasmRefIsNullExtern(), clang::CodeGen::CodeGenFunction::EmitWebAssemblyBuiltinExpr(), and isWebAssemblyReferenceType().
bool QualType::isWebAssemblyFuncrefType | ( | ) | const |
Returns true if it is a WebAssembly Funcref Type.
Definition at line 2948 of file Type.cpp.
References getAddressSpace(), getTypePtr(), clang::Type::isFunctionPointerType(), and clang::wasm_funcref.
Referenced by clang::CodeGen::CodeGenFunction::EmitWebAssemblyBuiltinExpr(), and isWebAssemblyReferenceType().
bool QualType::isWebAssemblyReferenceType | ( | ) | const |
Returns true if it is a WebAssembly Reference Type.
Definition at line 2940 of file Type.cpp.
References isWebAssemblyExternrefType(), and isWebAssemblyFuncrefType().
Referenced by captureInLambda(), clang::Sema::CheckAddressOfOperand(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckCXXThrowOperand(), clang::Sema::CheckSpecifiedExceptionType(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::CreateBuiltinUnaryOp(), and clang::Sema::isValidVarArgType().
bool QualType::mayBeDynamicClass | ( | ) | const |
Returns true if it is a class and it might be dynamic.
Definition at line 130 of file Type.cpp.
References clang::Type::getPointeeCXXRecordDecl(), getTypePtr(), and clang::CXXRecordDecl::mayBeDynamicClass().
bool QualType::mayBeNotDynamicClass | ( | ) | const |
Returns true if it is not a class or if the class might not be dynamic.
Definition at line 135 of file Type.cpp.
References clang::Type::getPointeeCXXRecordDecl(), getTypePtr(), and clang::CXXRecordDecl::mayBeNonDynamicClass().
|
inline |
Definition at line 992 of file TypeBase.h.
References getTypePtr().
|
inline |
Definition at line 996 of file TypeBase.h.
References getTypePtr().
|
static |
Definition at line 2824 of file TypePrinter.cpp.
void QualType::print | ( | raw_ostream & | OS, |
const PrintingPolicy & | Policy, | ||
const Twine & | PlaceHolder = Twine(), | ||
unsigned | Indentation = 0 ) const |
Definition at line 2818 of file TypePrinter.cpp.
References print(), and splitAccordingToPolicy().
Referenced by clang::CIRGen::CIRGenTypes::getRecordTypeName(), clang::QualType::StreamedQualTypeHelper::operator<<, clang::DynTypedNode::print(), clang::NestedNameSpecifier::print(), print(), clang::TemplateArgument::print(), clang::TypeInfoLValue::print(), print_elem(), printArgument(), clang::TemplateParamObjectDecl::printAsExpr(), printCXXConstructorDestructorName(), clang::ProgramPoint::printJson(), clang::FieldDecl::printName(), and clang::TagDecl::printName().
|
inlinestatic |
Definition at line 1346 of file TypeBase.h.
|
inline |
Definition at line 1398 of file TypeBase.h.
References getAsOpaquePtr().
Referenced by clang::TemplateArgument::Profile(), clang::TypedefType::Profile(), and clang::UnnamedGlobalConstantDecl::Profile().
|
inline |
Definition at line 8393 of file TypeBase.h.
References clang::Qualifiers::Const, removeLocalConst(), and removeLocalFastQualifiers().
Referenced by clang::Sema::BuildAtomicExpr(), DiagnoseForRangeReferenceVariableCopies(), findSubobject(), and removeLocalConst().
|
inline |
Definition at line 1193 of file TypeBase.h.
Referenced by removeLocalConst(), removeLocalRestrict(), and removeLocalVolatile().
|
inline |
Definition at line 1194 of file TypeBase.h.
References clang::Qualifiers::FastMask.
|
inline |
Definition at line 8397 of file TypeBase.h.
References removeLocalFastQualifiers(), removeLocalRestrict(), and clang::Qualifiers::Restrict.
Referenced by clang::CXXMethodDecl::getThisType(), and removeLocalRestrict().
|
inline |
Definition at line 8401 of file TypeBase.h.
References removeLocalFastQualifiers(), removeLocalVolatile(), and clang::Qualifiers::Volatile.
Referenced by clang::Sema::BuildAtomicExpr(), findSubobject(), and removeLocalVolatile().
|
inline |
Definition at line 965 of file TypeBase.h.
|
inline |
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition at line 8306 of file TypeBase.h.
References clang::Qualifiers::addFastQualifiers(), clang::Qualifiers::fromFastMask(), clang::ExtQuals::getBaseType(), getLocalFastQualifiers(), clang::ExtQuals::getQualifiers(), hasLocalNonFastQualifiers(), and split().
Referenced by checkARCPropertyImpl(), getAsString(), getAsString(), getAsStringInternal(), clang::ASTContext::getCommonSugaredType(), getSplitUnqualifiedType(), clang::operator<<(), print(), printIndicesOfElementsToConstructJson(), printPendingInitLoopJson(), split(), splitAccordingToPolicy(), unwrapSugar(), and clang::TextNodeDumper::VisitFunctionDecl().
|
inline |
Definition at line 1388 of file TypeBase.h.
Referenced by clang::APValue::printPretty().
QualType QualType::stripObjCKindOfType | ( | const ASTContext & | ctx | ) | const |
Strip Objective-C "__kindof" types from the given type.
Definition at line 1663 of file Type.cpp.
References QualType().
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.
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. |
dc | The declaration context from which the subject type was retrieved, which indicates (for example) which type parameters should be substituted. |
context | The context in which the subject type was written. |
Definition at line 1654 of file Type.cpp.
References clang::Type::getObjCSubstitutions(), clang::DeclContext::getParentASTContext(), QualType(), and substObjCTypeArgs().
Referenced by clang::ObjCMethodDecl::getSendResultType(), clang::ObjCIvarDecl::getUsageType(), and clang::ObjCPropertyDecl::getUsageType().
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.
ctx | ASTContext in which the type exists. |
typeArgs | The 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. |
context | The context in which the subject type was written. |
Definition at line 1647 of file Type.cpp.
References QualType().
Referenced by clang::SemaObjC::CheckMessageArgumentTypes(), clang::SemaCodeCompletion::CodeCompleteObjCMethodDecl(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), formatBlockPlaceholder(), getReturnTypeForMethod(), clang::ObjCMethodDecl::getSendResultType(), and substObjCMemberType().
bool QualType::UseExcessPrecision | ( | const ASTContext & | Ctx | ) |
Definition at line 1612 of file Type.cpp.
References clang::Type::getAs(), clang::VectorType::getElementType(), clang::BuiltinType::getKind(), clang::ASTContext::getLangOpts(), clang::ASTContext::getTargetInfo(), getTypePtr(), clang::TargetInfo::hasBFloat16Type(), clang::TargetInfo::hasFastHalfType(), clang::TargetInfo::hasFloat16Type(), clang::TargetInfo::hasFullBFloat16Type(), QualType(), and UseExcessPrecision().
Referenced by UseExcessPrecision().
|
inline |
Definition at line 1159 of file TypeBase.h.
References clang::Qualifiers::Const, QualType(), and withFastQualifiers().
Referenced by clang::hlsl::BuiltinTypeDeclBuilder::addCopyAssignmentOperator(), clang::hlsl::BuiltinTypeDeclBuilder::addCopyConstructor(), clang::Sema::BuildCXXTypeId(), clang::Sema::BuildCXXTypeId(), clang::SemaObjC::BuildObjCArrayLiteral(), clang::SemaObjC::BuildObjCBoxedExpr(), clang::SemaObjC::BuildObjCDictionaryLiteral(), captureInBlock(), clang::SemaARM::CheckNeonBuiltinFunctionCall(), DiagnoseForRangeReferenceVariableCopies(), diagnoseListInit(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), getParallelRegionParams(), clang::ObjCMethodDecl::getSelfType(), clang::ASTContext::getStringLiteralArrayType(), getTargetRegionParams(), getTaskloopRegionParams(), getTaskRegionParams(), clang::InitializationSequence::Perform(), clang::hlsl::BuiltinTypeMethodBuilder::returnValue(), TryInitializerListConstruction(), clang::tryMakeVariablePseudoStrong(), clang::interp::Compiler< Emitter >::VisitSYCLUniqueStableNameExpr(), and clang::CanQual< Type >::withConst().
Definition at line 1179 of file TypeBase.h.
References QualType(), and withFastQualifiers().
Referenced by clang::Sema::BuildAtomicExpr(), checkConditionalPointerCompatibility(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementExpr(), clang::CIRGen::CIRGenFunction::emitLValueForBitField(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), GeneralizeType(), and unwrapCastAwayConstnessLevel().
Definition at line 1209 of file TypeBase.h.
References QualType(), withFastQualifiers(), and withoutLocalFastQualifiers().
Definition at line 1201 of file TypeBase.h.
References QualType(), and clang::T.
Referenced by clang::QualifierCollector::apply(), getCanonicalType(), withConst(), withCVRQualifiers(), withExactLocalFastQualifiers(), withRestrict(), and withVolatile().
|
inline |
Definition at line 1214 of file TypeBase.h.
References QualType(), and clang::T.
Referenced by CheckTautologicalComparison(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), getCoreType(), and withExactLocalFastQualifiers().
|
inline |
Definition at line 1175 of file TypeBase.h.
References QualType(), clang::Qualifiers::Restrict, and withFastQualifiers().
Referenced by emitDestructorsFunction(), emitProxyTaskFunction(), getParallelRegionParams(), getTargetRegionParams(), getTaskloopRegionParams(), and getTaskRegionParams().
|
inline |
Definition at line 1167 of file TypeBase.h.
References QualType(), clang::Qualifiers::Volatile, and withFastQualifiers().
Referenced by callSpecialFunction(), clang::SemaARM::CheckARMBuiltinExclusiveCall(), clang::CodeGen::CodeGenFunction::defaultInitNonTrivialCStructVar(), and getSpecialFunction().
Definition at line 1325 of file TypeBase.h.
References QualType().
Definition at line 1328 of file TypeBase.h.
References QualType().
Indicate whether the specified types and qualifiers are identical.
Definition at line 1322 of file TypeBase.h.
References QualType().
|
friend |
Definition at line 938 of file TypeBase.h.
References clang::Qualifiers::FastWidth, and QualifierCollector.
Referenced by QualifierCollector.