clang
17.0.0git
|
A (possibly-)qualified type. More...
#include "clang/AST/Type.h"
Classes | |
class | StreamedQualTypeHelper |
Public Types | |
enum | PrimitiveDefaultInitializeKind { PDIK_Trivial, PDIK_ARCStrong, PDIK_ARCWeak, PDIK_Struct } |
enum | PrimitiveCopyKind { PCK_Trivial, PCK_VolatileTrivial, PCK_ARCStrong, PCK_ARCWeak, PCK_Struct } |
enum | DestructionKind { DK_none, DK_cxx_destructor, DK_objc_strong_lifetime, DK_objc_weak_lifetime, DK_nontrivial_c_struct } |
Public Member Functions | |
QualType ()=default | |
QualType (const Type *Ptr, unsigned Quals) | |
QualType (const ExtQuals *Ptr, unsigned Quals) | |
unsigned | getLocalFastQualifiers () const |
void | setLocalFastQualifiers (unsigned Quals) |
bool | UseExcessPrecision (const ASTContext &Ctx) |
const Type * | getTypePtr () const |
Retrieves a pointer to the underlying (unqualified) type. More... | |
const Type * | getTypePtrOrNull () const |
const IdentifierInfo * | getBaseTypeIdentifier () const |
Retrieves a pointer to the name of the base type. More... | |
SplitQualType | split () const |
Divides a QualType into its unqualified type and a set of local qualifiers. More... | |
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. More... | |
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. More... | |
bool | isConstQualified () const |
Determine whether this type is const-qualified. More... | |
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. More... | |
bool | isRestrictQualified () const |
Determine whether this type is restrict-qualified. More... | |
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. More... | |
bool | isVolatileQualified () const |
Determine whether this type is volatile-qualified. More... | |
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. More... | |
bool | hasQualifiers () const |
Determine whether this type has any qualifiers. More... | |
bool | hasLocalNonFastQualifiers () const |
Determine whether this particular QualType instance has any "non-fast" qualifiers, e.g., those that are stored in an ExtQualType instance. More... | |
Qualifiers | getLocalQualifiers () const |
Retrieve the set of qualifiers local to this particular QualType instance, not including any qualifiers acquired through typedefs or other sugar. More... | |
Qualifiers | getQualifiers () const |
Retrieve the set of qualifiers applied to this type. More... | |
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. More... | |
unsigned | getCVRQualifiers () const |
Retrieve the set of CVR (const-volatile-restrict) qualifiers applied to this type. More... | |
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). More... | |
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. More... | |
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. More... | |
bool | isTrivialType (const ASTContext &Context) const |
Return true if this is a trivial type per (C++0x [basic.types]p9) More... | |
bool | isTriviallyCopyableType (const ASTContext &Context) const |
Return true if this is a trivially copyable type (C++0x [basic.types]p9) More... | |
bool | isTriviallyRelocatableType (const ASTContext &Context) const |
Return true if this is a trivially relocatable type. More... | |
bool | mayBeDynamicClass () const |
Returns true if it is a class and it might be dynamic. More... | |
bool | mayBeNotDynamicClass () const |
Returns true if it is not a class or if the class might not be dynamic. More... | |
void | addConst () |
Add the const type qualifier to this QualType. More... | |
QualType | withConst () const |
void | addVolatile () |
Add the volatile type qualifier to this QualType. More... | |
QualType | withVolatile () const |
void | addRestrict () |
Add the restrict qualifier to this QualType. More... | |
QualType | withRestrict () const |
QualType | withCVRQualifiers (unsigned CVR) const |
void | addFastQualifiers (unsigned TQs) |
void | removeLocalConst () |
void | removeLocalVolatile () |
void | removeLocalRestrict () |
void | removeLocalCVRQualifiers (unsigned Mask) |
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. More... | |
QualType | getUnqualifiedType () const |
Retrieve the unqualified variant of the given type, removing as little sugar as possible. More... | |
SplitQualType | getSplitUnqualifiedType () const |
Retrieve the unqualified variant of the given type, removing as little sugar as possible. More... | |
bool | isMoreQualifiedThan (QualType Other) const |
Determine whether this type is more qualified than the other given type, requiring exact equality for non-CVR qualifiers. More... | |
bool | isAtLeastAsQualifiedAs (QualType Other) const |
Determine whether this type is at least as qualified as the other given type, requiring exact equality for non-CVR qualifiers. More... | |
QualType | getNonReferenceType () const |
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const
int"). More... | |
QualType | getNonLValueExprType (const ASTContext &Context) const |
Determine the type of a (typically non-lvalue) expression with the specified result type. More... | |
QualType | getNonPackExpansionType () const |
Remove an outer pack expansion type (if any) from this type. More... | |
QualType | getDesugaredType (const ASTContext &Context) const |
Return the specified type with any "sugar" removed from the type. More... | |
SplitQualType | getSplitDesugaredType () const |
QualType | getSingleStepDesugaredType (const ASTContext &Context) const |
Return the specified type with one level of "sugar" removed from the type. More... | |
QualType | IgnoreParens () const |
Returns the specified type after dropping any outer-level parentheses. More... | |
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. More... | |
LangAS | getAddressSpace () const |
Return the address space of this type. More... | |
bool | isAddressSpaceOverlapping (QualType T) const |
Returns true if address space qualifiers overlap with T address space qualifiers. More... | |
Qualifiers::GC | getObjCGCAttr () const |
Returns gc attribute of this type. More... | |
bool | isObjCGCWeak () const |
true when Type is objc's weak. More... | |
bool | isObjCGCStrong () const |
true when Type is objc's strong. More... | |
Qualifiers::ObjCLifetime | getObjCLifetime () const |
Returns lifetime attribute of this type. More... | |
bool | hasNonTrivialObjCLifetime () const |
bool | hasStrongOrWeakObjCLifetime () const |
bool | isNonWeakInMRRWithObjCWeak (const ASTContext &Context) const |
PrimitiveDefaultInitializeKind | isNonTrivialToPrimitiveDefaultInitialize () const |
Functions to query basic properties of non-trivial C struct types. More... | |
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. More... | |
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. More... | |
DestructionKind | isDestructedType () const |
Returns a nonzero value if objects of this type require non-trivial work to clean up after. More... | |
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. More... | |
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. More... | |
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. More... | |
bool | isCForbiddenLValueType () const |
Determine whether expressions of the given type are forbidden from being lvalues in C. More... | |
QualType | substObjCTypeArgs (ASTContext &ctx, ArrayRef< QualType > typeArgs, ObjCSubstitutionContext context) const |
Substitute type arguments for the Objective-C type parameters used in the subject type. More... | |
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. More... | |
QualType | stripObjCKindOfType (const ASTContext &ctx) const |
Strip Objective-C "__kindof" types from the given type. More... | |
QualType | getAtomicUnqualifiedType () const |
Remove all qualifiers including _Atomic. More... | |
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. More... | |
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.
|
default |
Referenced by getLocalUnqualifiedType(), and getUnqualifiedType().
|
inline |
Add the const
type qualifier to this QualType.
Definition at line 912 of file Type.h.
References addFastQualifiers(), and clang::Qualifiers::Const.
Referenced by clang::Sema::ActOnCXXUuidof(), adjustCVQualifiersForCXXThisWithinLambda(), alignReferenceTypes(), clang::Expr::EvaluateAsConstantExpr(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::ASTContext::getInjectedTemplateArg(), getSubobjectType(), clang::ASTContext::getTemplateParamObjectDecl(), isVariableAlreadyCapturedInScopeInfo(), and clang::Sema::tryCaptureVariable().
|
inline |
Definition at line 939 of file Type.h.
References clang::Qualifiers::FastMask.
Referenced by addConst(), addRestrict(), addVolatile(), and withFastQualifiers().
|
inline |
Add the restrict
qualifier to this QualType.
Definition at line 928 of file Type.h.
References addFastQualifiers(), and clang::Qualifiers::Restrict.
Referenced by emitReduceInitFunction().
|
inline |
Add the volatile
type qualifier to this QualType.
Definition at line 920 of file Type.h.
References addFastQualifiers(), and clang::Qualifiers::Volatile.
Referenced by getSubobjectType().
LLVM_DUMP_METHOD void QualType::dump | ( | ) | const |
Definition at line 184 of file ASTDumper.cpp.
References clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
void QualType::dump | ( | const char * | s | ) | const |
Definition at line 178 of file ASTDumper.cpp.
References dump().
Referenced by clang::CanQual< ObjCObjectType >::dump(), and clang::Type::dump().
LLVM_DUMP_METHOD void QualType::dump | ( | llvm::raw_ostream & | OS, |
const ASTContext & | Context | ||
) | const |
Definition at line 189 of file ASTDumper.cpp.
References clang::ASTContext::getDiagnostics(), clang::DiagnosticsEngine::getShowColors(), and clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
|
inline |
Return the address space of this type.
Definition at line 6767 of file Type.h.
References clang::Qualifiers::getAddressSpace(), and getQualifiers().
Referenced by clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildAddressSpaceAttr(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildCallExpr(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::BuildObjCExceptionDecl(), clang::Sema::CheckAllocatedType(), clang::Sema::CheckAssignmentConstraints(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckFunctionReturnType(), clang::Sema::CheckVariableDeclarationType(), clang::CodeGen::CodeGenTypes::ConvertType(), diagnoseOpenCLTypes(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), 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::CodeGen::CodeGenModule::GenKernelArgMetadata(), clang::CodeGen::CGOpenMPRuntimeGPU::getAddressOfLocalVariable(), clang::CodeGen::CodeGenModule::GetAddrOfGlobalVar(), clang::CodeGen::CodeGenModule::GetAddrOfUnnamedGlobalConstantDecl(), clang::ASTContext::getAddrSpaceQualType(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), clang::CodeGen::CodeGenModule::GetGlobalVarAddressSpace(), clang::CodeGen::CodeGenTypes::getTargetAddressSpace(), clang::ASTContext::getTargetNullPointerValue(), IsAddressSpaceConversion(), clang::Expr::isNullPointerConstant(), isValidSwiftContextType(), isValidSwiftIndirectResultType(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformQualificationConversion(), clang::Sema::PrepareScalarCast(), clang::TreeTransform< EnsureImmediateInvocationInDefaultArgs >::RebuildQualifiedType(), clang::ASTContext::removePtrSizeAddrSpace(), rewriteBuiltinFunctionDecl(), clang::CodeGen::ConstantEmitter::tryEmitForInitializer(), and TryReinterpretCast().
|
inline |
Definition at line 783 of file Type.h.
Referenced by clang::CodeGen::CGDebugInfo::completeClass(), clang::CodeGen::CGDebugInfo::completeType(), clang::CodeGen::CGDebugInfo::completeUnusedClass(), clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor(), clang::CodeGen::CGDebugInfo::finalize(), clang::CanQual< ObjCObjectType >::getAsOpaquePtr(), llvm::DenseMapInfo< clang::QualType >::getHashValue(), clang::serialization::UnsafeQualTypeDenseMapInfo::getHashValue(), clang::CodeGen::CGDebugInfo::getOrCreateStandaloneType(), clang::QualTypeOrdering::operator()(), clang::operator<<(), Profile(), clang::ComplexType::Profile(), clang::PointerType::Profile(), clang::AdjustedType::Profile(), clang::BlockPointerType::Profile(), clang::ReferenceType::Profile(), clang::MemberPointerType::Profile(), clang::IncompleteArrayType::Profile(), clang::TemplateParamObjectDecl::Profile(), clang::VectorType::Profile(), clang::ConstantMatrixType::Profile(), clang::DependentSizedMatrixType::Profile(), clang::FunctionNoProtoType::Profile(), clang::DependentUnaryTransformType::Profile(), clang::AttributedType::Profile(), clang::BTFTagAttributedType::Profile(), clang::DeducedTemplateSpecializationType::Profile(), clang::PackExpansionType::Profile(), clang::ObjCTypeParamType::Profile(), clang::ObjCObjectTypeImpl::Profile(), clang::ObjCObjectPointerType::Profile(), clang::AtomicType::Profile(), clang::PipeType::Profile(), clang::StandardConversionSequence::setAllToTypes(), clang::StandardConversionSequence::setFromType(), clang::AmbiguousConversionSequence::setFromType(), clang::BadConversionSequence::setFromType(), clang::TemplateArgument::setIntegralType(), clang::ObjCMessageExpr::setSuper(), clang::StandardConversionSequence::setToType(), clang::AmbiguousConversionSequence::setToType(), clang::BadConversionSequence::setToType(), clang::TemplateArgument::TemplateArgument(), clang::TextNodeDumper::Visit(), and clang::JSONNodeDumper::Visit().
std::string QualType::getAsString | ( | ) | const |
Definition at line 2330 of file TypePrinter.cpp.
Referenced by clang::TextNodeDumper::dumpBareType(), getAsString(), and clang::TextNodeDumper::VisitFunctionDecl().
std::string QualType::getAsString | ( | const PrintingPolicy & | Policy | ) | const |
Definition at line 2334 of file TypePrinter.cpp.
|
static |
Definition at line 2340 of file TypePrinter.cpp.
|
inlinestatic |
Definition at line 1089 of file Type.h.
References getAsString(), clang::SplitQualType::Quals, split(), and clang::SplitQualType::Ty.
Referenced by clang::data_collection::addDataToConsumer(), clang::CodeGen::CGHLSLRuntime::annotateHLSLResource(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), clang::Sema::diagnoseUnavailableAlignedAllocation(), clang::TypeName::getFullyQualifiedName(), clang::diff::getInitializerValue(), getNoteTag(), getPrettyTypeName(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), isISLObjectRef(), isOpenCLSizeDependentType(), rewriteToNSMacroDecl(), rewriteToObjCProperty(), and clang::CXXRecordDecl::viewInheritance().
|
static |
Definition at line 2368 of file TypePrinter.cpp.
|
inlinestatic |
Definition at line 1117 of file Type.h.
References getAsStringInternal(), clang::SplitQualType::Quals, split(), and clang::SplitQualType::Ty.
void QualType::getAsStringInternal | ( | std::string & | Str, |
const PrintingPolicy & | Policy | ||
) | const |
Definition at line 2362 of file TypePrinter.cpp.
Referenced by clang::Sema::CheckVirtualDtorCall(), diagnoseNoViableConversion(), formatBlockPlaceholder(), and getAsStringInternal().
QualType QualType::getAtomicUnqualifiedType | ( | ) | const |
Remove all qualifiers including _Atomic.
Definition at line 1531 of file Type.cpp.
References getTypePtr(), and getUnqualifiedType().
Referenced by clang::Sema::CheckAssignmentOperands(), clang::TypeOfExprType::desugar(), clang::TypeOfType::desugar(), Evaluate(), and EvaluateInPlace().
const IdentifierInfo * QualType::getBaseTypeIdentifier | ( | ) | const |
Retrieves a pointer to the name of the base type.
Definition at line 73 of file Type.cpp.
References clang::Type::castAs(), clang::Type::castAsArrayTypeUnsafe(), getBaseTypeIdentifier(), clang::NamedDecl::getIdentifier(), clang::Type::getPointeeType(), clang::Type::getTypeClass(), getTypePtr(), clang::Type::isArrayType(), clang::Type::isEnumeralType(), clang::Type::isPointerType(), clang::Type::isRecordType(), and clang::Type::isReferenceType().
Referenced by appendType(), getBaseTypeIdentifier(), getNestedNameSpecifierIdentifiers(), and hasSimilarParameters().
|
inline |
Definition at line 6685 of file Type.h.
References getLocalFastQualifiers(), and withFastQualifiers().
Referenced by clang::Sema::ActOnOpenMPAlignedClause(), adjustReturnValue(), clang::CodeGen::CGOpenMPRuntimeGPU::adjustTargetSpecificDataForLambdas(), appendType(), clang::Sema::BuildReturnStmt(), checkMappableExpressionList(), clang::Sema::CheckSizelessVectorConditionalTypes(), clang::Sema::checkTypeSupport(), ConvertTypeToDiagnosticString(), clang::ConstructionContext::createFromLayers(), diagnoseOpenCLTypes(), clang::ento::SMTConv::doTypeConversion(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::index::generateUSRForType(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), getAArch64LS(), getAArch64MTV(), getAArch64PBV(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getCanonicalType(), clang::ento::StoreManager::getLValueElement(), clang::Sema::getMoreSpecializedTemplate(), getNDSWDS(), clang::dataflow::DataflowAnalysisContext::getOrCreateNullPointerValue(), clang::ento::ObjCMethodCall::getRuntimeDefinition(), getTypeString(), clang::RecordType::hasConstFields(), clang::Sema::inferGslPointerAttribute(), clang::CFGCXXRecordTypedCall::isCXXRecordTypedCall(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), clang::ento::RetainSummaryManager::isKnownSmartPointer(), isLayoutCompatible(), isPointerToConst(), IsStringInit(), clang::InitListExpr::isTransparent(), isTriviallyCopyableType(), isValidSizelessVectorForConditionalCondition(), isValidVectorForConditionalCondition(), clang::CodeGen::CodeGenModule::MayDropFunctionReturn(), clang::TemplateParamObjectDecl::Profile(), clang::DeducedTemplateSpecializationType::Profile(), splitAccordingToPolicy(), tryExtractInitializerFromList(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), and clang::ento::SValExplainer::VisitSymbolicRegion().
|
inline |
Retrieve the set of CVR (const-volatile-restrict) qualifiers applied to this type.
Definition at line 6679 of file Type.h.
References getLocalCVRQualifiers().
Referenced by clang::Sema::CheckPointerToMemberOperands(), GeneralizeType(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::Sema::SpecialMemberIsTrivial(), 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 1053 of file Type.h.
Referenced by clang::ento::TypedRegion::getDesugaredLocationType(), clang::ento::TypedValueRegion::getDesugaredValueType(), clang::Sema::getMessageSendResultType(), isGRealloc(), isStandardRealloc(), and IsStructurallyEquivalent().
|
inlinestatic |
Definition at line 785 of file Type.h.
Referenced by clang::DependentDiagnostic::getAccessBaseObjectType(), clang::TemplateArgument::getAsType(), clang::APValue::LValueBase::getDynamicAllocType(), clang::serialization::UnsafeQualTypeDenseMapInfo::getEmptyKey(), clang::sema::DelayedDiagnostic::getForbiddenTypeOperand(), clang::CanQual< ObjCObjectType >::getFromOpaquePtr(), clang::StandardConversionSequence::getFromType(), clang::AmbiguousConversionSequence::getFromType(), clang::BadConversionSequence::getFromType(), llvm::PointerLikeTypeTraits< clang::QualType >::getFromVoidPointer(), clang::TemplateArgument::getIntegralType(), clang::TemplateArgument::getNullPtrType(), clang::TemplateArgument::getParamTypeForDecl(), clang::ObjCMessageExpr::getSuperType(), clang::serialization::UnsafeQualTypeDenseMapInfo::getTombstoneKey(), clang::StandardConversionSequence::getToType(), clang::AmbiguousConversionSequence::getToType(), clang::BadConversionSequence::getToType(), clang::TypeLoc::getType(), clang::APValue::LValuePathSerializationHelper::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 868 of file Type.h.
References getLocalFastQualifiers().
Referenced by clang::Sema::CheckOverridingFunctionReturnType(), clang::CanQual< ObjCObjectType >::getCVRQualifiers(), and getCVRQualifiers().
|
inline |
Definition at line 763 of file Type.h.
Referenced by getCanonicalType(), clang::serialization::UnsafeQualTypeDenseMapInfo::getHashValue(), getLocalCVRQualifiers(), getLocalQualifiers(), clang::ASTWriter::GetOrCreateTypeID(), getQualifiers(), clang::ASTWriter::getTypeID(), hasLocalQualifiers(), isLocalConstQualified(), isLocalRestrictQualified(), isLocalVolatileQualified(), clang::serialization::MakeTypeID(), 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 6665 of file Type.h.
References clang::Qualifiers::addFastQualifiers(), getLocalFastQualifiers(), clang::ExtQuals::getQualifiers(), and hasLocalNonFastQualifiers().
Referenced by BuildSimilarlyQualifiedPointerType(), clang::TypeName::getFullyQualifiedType(), clang::CanQual< ObjCObjectType >::getQualifiers(), getQualifiers(), clang::ASTImporter::Import(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), clang::TreeTransform< EnsureImmediateInvocationInDefaultArgs >::RebuildQualifiedType(), and UnwrapTypeForDebugInfo().
|
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 982 of file Type.h.
References getTypePtr(), and QualType().
Referenced by clang::Sema::AttachBaseSpecifiers(), BuildSimilarlyQualifiedPointerType(), and clang::ento::StoreManager::castRegion().
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 3163 of file Type.cpp.
References clang::ASTContext::getLangOpts(), clang::Type::getPointeeType(), getTypePtr(), getUnqualifiedType(), and isRecordType().
Referenced by clang::Sema::ActOnOpenMPLoopInitialization(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildLiteralOperatorCall(), clang::Sema::BuildVAArgExpr(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckTemplateArgument(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), EvaluateBinaryTypeTrait(), clang::FunctionType::getCallResultType(), clang::ObjCMethodDecl::getSendResultType(), clang::Sema::PerformImplicitConversion(), and TryClassUnification().
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 3156 of file Type.cpp.
References getTypePtr().
|
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 6842 of file Type.h.
References clang::Type::getPointeeType().
Referenced by clang::Sema::ActOnOpenMPAlignedClause(), clang::Sema::ActOnOpenMPCopyinClause(), clang::Sema::ActOnOpenMPDependClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnOpenMPLastprivateClause(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::ActOnParamDefaultArgument(), clang::Sema::ActOnParamDefaultArgumentError(), clang::CodeGen::CGOpenMPRuntimeGPU::adjustTargetSpecificDataForLambdas(), clang::Sema::BuildCXXTypeConstructExpr(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), clang::Sema::BuiltinAddPointer(), clang::Sema::BuiltinDecay(), clang::Sema::BuiltinRemoveReference(), canCaptureVariableByCopy(), castToBase(), checkCastFunctionType(), clang::Sema::CheckCompleteDecompositionDeclaration(), clang::Sema::CheckConditionVariable(), checkMapConflicts(), clang::Sema::CheckTemplateArgument(), clang::Sema::ConstantFoldAttrArgs(), createObjCPropertyGetter(), createPrivatesRecordDecl(), diagnoseAmbiguousConversion(), clang::Sema::diagnoseARCUnbridgedCast(), DiagnoseForRangeReferenceVariableCopies(), diagnoseNoViableConversion(), clang::Sema::DiagnosePropertyAccessorMismatch(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), emitCPPObjectAtomicSetterCall(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalFinalUpdate(), clang::CodeGen::CGOpenMPRuntime::emitLastprivateConditionalInit(), clang::CodeGen::CodeGenFunction::EmitOMPUseDeviceAddrClause(), clang::Sema::EmitRelatedResultTypeNote(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), emitStructSetterCall(), clang::Sema::EndOpenMPDSABlock(), EvaluateBinaryTypeTrait(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), getAsRecordDecl(), getCanonicalParamType(), clang::CFGImplicitDtor::getDestructorDecl(), clang::Sema::getNamedReturnInfo(), clang::UnresolvedMemberExpr::getNamingClass(), clang::CodeGen::CodeGenModule::getOMPAllocateAlignment(), getParamType(), clang::CXXTypeidExpr::getTypeOperand(), clang::CXXUuidofExpr::getTypeOperand(), getVariableCategoryFromDecl(), clang::Sema::HandleFunctionTypeMismatch(), handleTrivialCopy(), hasCopyOrMoveCtorParam(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), isFirstArgumentCompatibleWithType(), IsTypeModifiable(), clang::Sema::isValidPointerAttrType(), isVariableAlreadyCapturedInScopeInfo(), loadToBegin(), clang::Sema::PerformImplicitConversion(), clang::Sema::ProcessPropertyDecl(), recordConversion(), and clang::Sema::tryCaptureVariable().
|
inline |
Returns gc attribute of this type.
Return the gc attribute of this type.
Definition at line 6772 of file Type.h.
References clang::Qualifiers::getObjCGCAttr(), and getQualifiers().
Referenced by clang::ASTContext::getObjCGCAttrKind(), clang::ASTContext::getObjCGCQualType(), isObjCGCStrong(), and isObjCGCWeak().
|
inline |
Returns lifetime attribute of this type.
Definition at line 1194 of file Type.h.
References clang::Qualifiers::getObjCLifetime(), and getQualifiers().
Referenced by clang::Sema::AddInitializerToDecl(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildDeclRefExpr(), clang::Sema::BuildPseudoDestructorExpr(), checkAllAtProps(), clang::Sema::CheckAllocatedType(), clang::Sema::CheckAssignmentOperands(), clang::Sema::checkIllFormedTrivialABIStruct(), clang::Sema::CheckObjCARCUnavailableWeakConversion(), clang::Sema::CheckObjCConversion(), clang::Sema::checkUnsafeAssigns(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::DefaultLvalueConversion(), clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(), clang::CodeGen::CodeGenFunction::EmitCXXPseudoDestructorExpr(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), EmitObjectDelete(), EvaluateUnaryTypeTrait(), clang::ASTContext::getByrefLifetime(), GetGCAttrTypeForType(), clang::ASTContext::getInnerObjCOwnership(), isCanonicalResultType(), isInvalidICRSource(), isNonTrivialToPrimitiveDefaultInitialize(), isNonWeakInMRRWithObjCWeak(), PropertyMemoryAttribute(), pushTemporaryCleanup(), clang::TreeTransform< EnsureImmediateInvocationInDefaultArgs >::RebuildQualifiedType(), setImpliedPropertyAttributeForReadOnlyProperty(), shouldExtendReceiverForInnerPointerMessage(), and tryEmitARCCopyWeakInit().
|
inline |
Retrieve the set of qualifiers applied to this type.
Definition at line 6673 of file Type.h.
References clang::Qualifiers::addFastQualifiers(), getLocalFastQualifiers(), and getLocalQualifiers().
Referenced by AdoptQualifiers(), clang::ASTContext::BlockRequiresCopying(), clang::Sema::BuildCallExpr(), clang::Sema::BuildDeclRefExpr(), BuildImplicitBaseInitializer(), BuildSimilarlyQualifiedPointerType(), clang::Sema::BuiltinChangeSignedness(), clang::Sema::CheckAllocatedType(), clang::Sema::CheckPointerToMemberOperands(), clang::Sema::CreateBuiltinArraySubscriptExpr(), createPlaceholderSlot(), decomposeTypeForEH(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DiagnoseAssignmentResult(), clang::CodeGen::CodeGenFunction::EmitAnyExprToExn(), clang::CodeGen::CodeGenFunction::EmitCompoundLiteralLValue(), clang::CodeGen::CodeGenFunction::EmitCXXPseudoDestructorExpr(), EmitDeclDestroy(), clang::CodeGen::CGObjCRuntime::EmitInitOfCatchParam(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), clang::CodeGen::CodeGenFunction::EmitObjCIvarRefLValue(), EmitOMPAggregateInit(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), EmitValToTemp(), clang::Sema::FindCompositeObjCPointerType(), getAddressSpace(), GetAlignOfType(), getCommonArrayElementType(), clang::ASTContext::getDeclAlign(), clang::TypeName::getFullyQualifiedType(), clang::CodeGen::CodeGenModule::getNaturalTypeAlignment(), getObjCGCAttr(), getObjCLifetime(), hasAddressSpace(), hasInconsistentOrSupersetQualifiersOf(), hasMangledSubstitutionQualifiers(), hasNonTrivialObjCLifetime(), hasStrongOrWeakObjCLifetime(), isAddressSpaceOverlapping(), isAtLeastAsQualifiedAs(), isMoreQualifiedThan(), isNonTrivialToPrimitiveCopy(), isNonTrivialToPrimitiveDefaultInitialize(), clang::Expr::isNullPointerConstant(), clang::Sema::isObjCPointerConversion(), clang::Sema::isObjCWritebackConversion(), isQualificationConversionStep(), IsStructurallyEquivalent(), isValidSwiftErrorResultType(), clang::ASTContext::mergeTypes(), clang::Sema::PerformImplicitConversion(), clang::TreeTransform< EnsureImmediateInvocationInDefaultArgs >::RebuildQualifiedType(), clang::Sema::RefersToMemberWithReducedAlignment(), RemoveAddressSpaceFromPtr(), rewriteToObjCProperty(), StoreAnyExprIntoOneUnit(), TryReinterpretCast(), TryStaticCast(), TypeInfoIsInStandardLibrary(), and withoutUnaligned().
|
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 1066 of file Type.h.
Referenced by captureVariablyModifiedType(), computeConditionalNullability(), isOpenCLSizeDependentType(), and clang::ASTContext::removeAddrSpaceQualType().
|
inline |
Definition at line 1057 of file Type.h.
Referenced by clang::TextNodeDumper::dumpBareType(), and clang::ASTContext::getAsArrayType().
|
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 6733 of file Type.h.
References getTypePtr(), hasLocalQualifiers(), and split().
Referenced by clang::Sema::BuildQualifiedType(), and clang::Sema::BuiltinDecay().
|
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 6633 of file Type.h.
Referenced by clang::Sema::ActOnOpenMPDependClause(), addAssociatedClassesAndNamespaces(), clang::ASTContext::adjustObjCTypeParamBoundType(), clang::interp::ByteCodeExprGen< Emitter >::allocateLocal(), clang::Sema::BuildCXXNamedCast(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), captureVariablyModifiedType(), clang::Sema::CheckAddressOfOperand(), checkArrayExpressionDoesNotReferToUnitySize(), checkArrayExpressionDoesNotReferToWholeSize(), clang::Sema::CheckObjCConversion(), clang::Sema::checkOpenMPDeclareVariantFunction(), clang::EnumDecl::completeDefinition(), clang::LinkageComputer::computeTypeLinkageInfo(), clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::ObjCTypeParamDecl::Create(), clang::TemplateTypeParmDecl::Create(), clang::interp::Program::createDescriptor(), clang::CodeGen::CodeGenModule::createOpenCLIntToSamplerConversion(), clang::Sema::DiagnoseUnusedButSetDecl(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenModule::EmitVTableTypeMetadata(), clang::TypePropertyCache< Private >::ensure(), FindVA(), clang::Sema::FixOverloadedFunctionReference(), clang::TypePropertyCache< Private >::get(), clang::ASTContext::getAlignOfGlobalVar(), GetAlignOfType(), getAtomicUnqualifiedType(), getBaseTypeIdentifier(), clang::ASTContext::getCanonicalParamType(), clang::ASTContext::getCanonicalType(), clang::CodeGen::CodeGenTypes::getCGRecordLayout(), getCommonNonSugarTypeNode(), clang::ASTContext::getCommonSugaredType(), getCurrentInstantiationOf(), clang::ASTContext::getDeclAlign(), clang::TypeName::getFullyQualifiedTemplateType(), clang::TypeName::getFullyQualifiedType(), clang::InjectedClassNameType::getInjectedTST(), getIntegerTypeForEnum(), getLocalUnqualifiedType(), clang::Sema::getMessageSendResultType(), getNonLValueExprType(), getNonPackExpansionType(), clang::interp::Program::getOrCreateRecord(), clang::ASTContext::getPreferredTypeAlign(), GetPrototypeLoc(), getRequiredQualification(), llvm::simplify_type< ::clang::QualType >::getSimplifiedValue(), getSplitUnqualifiedType(), getTypeAlignIfRequired(), clang::ASTContext::getTypeInfo(), clang::ASTContext::getTypeInfoInChars(), clang::LinkageComputer::getTypeLinkageAndVisibility(), clang::CanQual< ObjCObjectType >::getTypePtr(), clang::TypeLoc::getTypePtr(), clang::ASTContext::getTypeUnadjustedAlign(), getUnqualifiedType(), clang::ASTContext::getUsingType(), getUuidAttrOfType(), clang::ASTNodeImporter::hasAutoReturnTypeDeclaredInside(), hasNonTrivialToPrimitiveCopyCUnion(), hasNonTrivialToPrimitiveDefaultInitializeCUnion(), hasNonTrivialToPrimitiveDestructCUnion(), clang::ASTImporter::Import(), clang::Sema::inferGslPointerAttribute(), clang::ASTContext::isAlignmentRequired(), isCanonical(), isCanonicalAsParam(), isCForbiddenLValueType(), isCXX11PODType(), isCXX98PODType(), clang::CodeGen::ABIInfo::isHomogeneousAggregate(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), clang::Sema::IsMemberPointerConversion(), isNonTrivialToPrimitiveCopy(), isNonTrivialToPrimitiveDefaultInitialize(), clang::Type::isObjCARCImplicitlyUnretainedType(), clang::Sema::IsOverload(), IsPossiblyOpaquelyQualifiedType(), isSafeToConvert(), isSingleElementStruct(), clang::ASTImporter::IsStructurallyEquivalent(), isTrivialType(), clang::serialization::MakeTypeID(), MarkUsedTemplateParameters(), clang::Sema::MaybeBindToTemporary(), mayBeDynamicClass(), mayBeNotDynamicClass(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), clang::StmtIteratorBase::NextVA(), operator*(), operator->(), clang::CodeGen::CodeGenTypes::RefreshTypeCacheForClass(), clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition(), TryStaticMemberPointerUpcast(), typeIsPostfix(), UnwrapTypeForDebugInfo(), clang::CodeGen::CodeGenTypes::UpdateCompletedType(), and UseExcessPrecision().
|
inline |
Definition at line 6637 of file Type.h.
References isNull().
Referenced by clang::Sema::ActOnOpenMPAlignedClause(), clang::Sema::ActOnOpenMPDeclareSimdDirective(), clang::ASTContext::getCommonSugaredType(), clang::ento::TypedValueRegion::getDesugaredValueType(), clang::CanQual< ObjCObjectType >::getTypePtrOrNull(), and clang::EnumDecl::setIntegerType().
|
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 C2x 6.2.5p29 for details), and it is not stripped by this function. Use getAtomicUnqualifiedType() to strip qualifiers including _Atomic.
Definition at line 6726 of file Type.h.
References getTypePtr(), hasLocalQualifiers(), QualType(), and clang::SplitQualType::Ty.
Referenced by clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnOpenMPAlignedClause(), clang::Sema::ActOnOpenMPCopyinClause(), clang::Sema::ActOnOpenMPCopyprivateClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::ActOnStmtExprResult(), AdoptQualifiers(), clang::Sema::BuildAtomicExpr(), BuildImplicitBaseInitializer(), BuildSimilarlyQualifiedPointerType(), clang::Sema::CheckAllocatedType(), clang::Sema::CheckAssignmentOperands(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckConditionalOperands(), clang::Sema::CheckLiteralOperatorDeclaration(), clang::Sema::CheckMatrixElementwiseOperands(), clang::Sema::CheckMatrixMultiplyOperands(), clang::Sema::CheckNonTypeTemplateParameterType(), clang::Sema::checkOpenMPDeclareVariantFunction(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::CheckSizelessVectorConditionalTypes(), clang::Sema::CheckSizelessVectorOperands(), clang::Sema::CheckSubtractionOperands(), clang::Sema::CheckTemplateArgument(), clang::Sema::checkTypeSupport(), clang::Sema::CheckVectorConditionalTypes(), clang::Sema::CheckVectorOperands(), decomposeTypeForEH(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DefaultLvalueConversion(), clang::Sema::DiagnoseAssignmentEnum(), clang::Sema::DiagnoseAssignmentResult(), DiagnoseBadFunctionCast(), DiagnoseCastOfObjCSEL(), clang::CodeGen::CodeGenFunction::EmitAndRegisterVariableArrayDimensions(), clang::CodeGen::CodeGenFunction::EmitAtomicExpr(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), FormatFunctionParameter(), clang::Sema::FunctionParamTypesAreEqual(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), getAtomicUnqualifiedType(), clang::Sema::getDecltypeForExpr(), clang::ASTContext::getExceptionObjectType(), getNonLValueExprType(), clang::SubstNonTypeTemplateParmExpr::getParameterType(), clang::ASTContext::getSignatureParameterType(), clang::CXXBaseSpecifier::getType(), isAtLeastAsQualifiedAs(), clang::Sema::IsBlockPointerConversion(), clang::Sema::isInitListConstructor(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), isLayoutCompatible(), clang::Sema::isObjCWritebackConversion(), isOpenCLSizeDependentType(), clang::Sema::IsQualificationConversion(), isValidInteropVariable(), IsVoidStarType(), maybeAdjustInterfaceForSubscriptingCheck(), clang::ASTContext::mergeFunctionTypes(), clang::ASTContext::mergeTypes(), clang::Sema::PerformImplicitConversion(), clang::TemplateParamObjectDecl::printAsExpr(), clang::TreeTransform< EnsureImmediateInvocationInDefaultArgs >::RebuildQualifiedType(), RemoveAddressSpaceFromPtr(), rewriteToObjCProperty(), clang::Sema::tryCaptureVariable(), TryLValueToRValueCast(), TypeIsInnerPointer(), and clang::Sema::UsualArithmeticConversions().
|
inline |
Check if this type has any address space qualifier.
Definition at line 6762 of file Type.h.
References getQualifiers(), and clang::Qualifiers::hasAddressSpace().
Referenced by clang::CodeGen::CodeGenTypes::getTargetAddressSpace(), clang::ASTContext::removeAddrSpaceQualType(), and rewriteBuiltinFunctionDecl().
|
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 853 of file Type.h.
Referenced by getLocalQualifiers(), hasLocalQualifiers(), clang::serialization::MakeTypeID(), 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 843 of file Type.h.
References getLocalFastQualifiers(), and hasLocalNonFastQualifiers().
Referenced by clang::ASTContext::getAsArrayType(), clang::ASTContext::getConstantArrayType(), clang::TypeName::getFullyQualifiedType(), clang::ASTContext::getIncompleteArrayType(), getSplitUnqualifiedType(), getUnqualifiedType(), clang::ASTContext::getUsingType(), clang::ASTContext::getVariableArrayType(), clang::CanQual< ObjCObjectType >::hasQualifiers(), hasQualifiers(), isCanonicalAsParam(), and clang::serialization::MakeTypeID().
|
inline |
Definition at line 1198 of file Type.h.
References getQualifiers(), and clang::Qualifiers::hasNonTrivialObjCLifetime().
Referenced by BuildImplicitMemberInitializer(), EvaluateBinaryTypeTrait(), isCXX11PODType(), isCXX98PODType(), isTriviallyCopyableType(), 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 6788 of file Type.h.
References getAsRecordDecl(), and getTypePtr().
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::AddInitializerToDecl(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::CheckFunctionReturnType(), clang::Sema::CheckLValueToRValueConversionOperand(), clang::Sema::checkNonTrivialCUnion(), clang::Sema::checkNonTrivialCUnionInInitializer(), and clang::Sema::CreateBuiltinBinOp().
|
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 6776 of file Type.h.
References getAsRecordDecl(), and getTypePtr().
Referenced by clang::Sema::AddInitializerToDecl(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::checkNonTrivialCUnion(), and clang::Sema::checkNonTrivialCUnionInInitializer().
|
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 6782 of file Type.h.
References getAsRecordDecl(), and getTypePtr().
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::BuildCompoundLiteralExpr(), clang::Sema::CheckFunctionReturnType(), clang::Sema::CheckLValueToRValueConversionOperand(), and clang::Sema::checkNonTrivialCUnion().
|
inline |
Determine whether this type has any qualifiers.
Definition at line 6721 of file Type.h.
References hasLocalQualifiers().
Referenced by clang::Sema::ActOnOpenMPDeclareReductionType(), clang::Sema::BuildAtomicType(), clang::Sema::CheckDeductionGuideDeclarator(), clang::Sema::CheckTemplateArgument(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::DefaultLvalueConversion(), clang::Sema::IsBlockPointerConversion(), isCForbiddenLValueType(), and clang::ASTContext::mergeFunctionTypes().
|
inline |
Definition at line 1202 of file Type.h.
References getQualifiers(), and clang::Qualifiers::hasStrongOrWeakObjCLifetime().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXPseudoDestructorExpr().
|
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 1173 of file Type.h.
References getQualifiers(), and clang::Qualifiers::isAddressSpaceSupersetOf().
Referenced by clang::Sema::CheckCompareOperands().
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 6823 of file Type.h.
References clang::Qualifiers::compatiblyIncludes(), getQualifiers(), getUnqualifiedType(), and clang::Qualifiers::removeUnaligned().
Referenced by clang::CanQual< ObjCObjectType >::isAtLeastAsQualifiedAs(), clang::Sema::isObjCPointerConversion(), and TryClassUnification().
|
inline |
Definition at line 6690 of file Type.h.
References getTypePtr(), and clang::Type::isCanonicalUnqualified().
Referenced by clang::ASTContext::getAtomicType(), clang::ASTContext::getBlockPointerType(), clang::ASTContext::getCommonSugaredType(), clang::ASTContext::getComplexType(), clang::ASTContext::getConstantArrayType(), clang::ASTContext::getConstantMatrixType(), clang::ASTContext::getElaboratedType(), clang::ASTContext::getExtVectorType(), clang::ASTContext::getIncompleteArrayType(), clang::ASTContext::getLValueReferenceType(), clang::ASTContext::getMacroQualifiedType(), clang::ASTContext::getMemberPointerType(), clang::ASTContext::getObjCObjectPointerType(), clang::ASTContext::getObjCObjectType(), clang::ASTContext::getPackExpansionType(), clang::ASTContext::getParenType(), clang::ASTContext::getPointerType(), clang::ASTContext::getRValueReferenceType(), clang::ASTContext::getVariableArrayType(), clang::ASTContext::getVectorType(), isCanonicalAsParam(), isCanonicalExceptionSpecification(), and isCanonicalResultType().
|
inline |
Definition at line 6694 of file Type.h.
References getTypePtr(), hasLocalQualifiers(), clang::Type::hasSizedVLAType(), isCanonical(), and clang::Type::isVariablyModifiedType().
Referenced by clang::CanQual< ObjCObjectType >::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 6849 of file Type.h.
References getTypePtr(), and hasQualifiers().
Referenced by clang::Sema::CreateBuiltinArraySubscriptExpr(), and clang::ento::ExprEngine::VisitArraySubscriptExpr().
|
inline |
Definition at line 876 of file Type.h.
Referenced by clang::Sema::ActOnOpenMPDetachClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), findCompleteObject(), handleLValueToRValueConversion(), clang::CodeGen::CodeGenModule::isTypeConstant(), and clang::MaterializeTemporaryExpr::isUsableInConstantExpressions().
|
inline |
Determine whether this type is const-qualified.
Definition at line 6705 of file Type.h.
References isLocalConstQualified().
Referenced by clang::Sema::ActOnObjCForCollectionStmt(), clang::Sema::AddInitializerToDecl(), alignReferenceTypes(), clang::interp::ByteCodeExprGen< Emitter >::allocateLocal(), appendQualifier(), clang::Sema::BuildAtomicExpr(), BuildImplicitMemberInitializer(), clang::Sema::BuiltinRemoveReference(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), clang::Sema::CheckLiteralOperatorDeclaration(), clang::Sema::CheckVariableDeclarationType(), decomposeTypeForEH(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), DiagnoseForRangeVariableCopies(), diagnoseOpenCLTypes(), clang::ento::ExprEngine::evalCall(), evaluateLValueAsAllocSize(), EvaluateUnaryTypeTrait(), findSubobject(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), clang::CodeGen::CodeGenModule::GetGlobalVarAddressSpace(), clang::interp::Program::getOrCreateRecord(), getSubobjectType(), clang::Sema::handlerCanCatch(), clang::RecordType::hasConstFields(), clang::Sema::IdentifyCUDATarget(), isPointerToConst(), IsTypeModifiable(), isVoidPointerToNonConst(), lifetimeStartedInEvaluation(), MarkVarDeclODRUsed(), clang::analyze_format_string::ArgType::matchesType(), clang::Sema::MaybeAddCUDAConstantAttr(), clang::Sema::SpecialMemberIsTrivial(), clang::Sema::tryCaptureVariable(), clang::ento::UndefOrNullArgVisitor::VisitNode(), and clang::interp::ByteCodeExprGen< 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 2739 of file Type.cpp.
References clang::Type::getAs(), clang::Type::getBaseElementTypeUnsafe(), getTypePtr(), hasNonTrivialObjCLifetime(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Type::isScalarType(), clang::Type::isSizelessBuiltinType(), and clang::Type::isVectorType().
Referenced by isPODType().
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 2406 of file Type.cpp.
References clang::ASTContext::getBaseElementType(), clang::Type::getTypeClass(), getTypePtr(), hasNonTrivialObjCLifetime(), isCXX98PODType(), and isNull().
Referenced by isCXX98PODType(), 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 1288 of file Type.h.
Referenced by clang::ASTContext::BlockRequiresCopying(), clang::Sema::BuildCompoundLiteralExpr(), checkDestructorsRequired(), CheckLValueConstantExpression(), clang::Sema::checkVariadicArgument(), clang::Sema::DefaultLvalueConversion(), clang::CodeGen::CGObjCRuntime::destroyCalleeDestroyedArguments(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::ReductionCodeGen::emitCleanups(), clang::CodeGen::CodeGenFunction::EmitCompoundLiteralLValue(), clang::CodeGen::CodeGenFunction::EmitInitializerForField(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), EmitMemberInitializer(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), EvaluateUnaryTypeTrait(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), HandleDestructionImpl(), clang::ParmVarDecl::isDestroyedInCallee(), isTriviallyRelocatableType(), clang::Sema::isValidVarArgType(), clang::Sema::MaybeBindToTemporary(), clang::CodeGen::ReductionCodeGen::needCleanups(), clang::VarDecl::needsDestruction(), pushCaptureCleanup(), clang::CodeGen::CGCXXABI::requiresArrayCookie(), and clang::DestructedTypeVisitor< Derived, RetTy >::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 813 of file Type.h.
References clang::Qualifiers::Const, and getLocalFastQualifiers().
Referenced by clang::CanQual< ObjCObjectType >::isConstQualified(), and 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 823 of file Type.h.
References getLocalFastQualifiers(), and clang::Qualifiers::Restrict.
Referenced by clang::CanQual< ObjCObjectType >::isRestrictQualified(), and 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 833 of file Type.h.
References getLocalFastQualifiers(), and clang::Qualifiers::Volatile.
Referenced by clang::CanQual< ObjCObjectType >::isVolatileQualified(), and isVolatileQualified().
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 6813 of file Type.h.
References clang::Qualifiers::compatiblyIncludes(), and getQualifiers().
Referenced by clang::Sema::CheckOverridingFunctionReturnType(), and clang::CanQual< ObjCObjectType >::isMoreQualifiedThan().
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 2600 of file Type.cpp.
References clang::Qualifiers::getObjCLifetime(), getQualifiers(), getTypePtr(), clang::Qualifiers::hasVolatile(), clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, PCK_ARCStrong, PCK_ARCWeak, PCK_Struct, PCK_Trivial, and PCK_VolatileTrivial.
Referenced by clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), isNonTrivialToPrimitiveDestructiveMove(), and clang::CopiedTypeVisitor< Derived, IsMove, RetTy >::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 2584 of file Type.cpp.
References getObjCLifetime(), getQualifiers(), getTypePtr(), clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, PDIK_ARCStrong, PDIK_ARCWeak, PDIK_Struct, and PDIK_Trivial.
Referenced by clang::DefaultInitializedTypeVisitor< Derived, RetTy >::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 2618 of file Type.cpp.
References isNonTrivialToPrimitiveCopy().
Referenced by clang::ASTContext::BlockRequiresCopying(), isTriviallyRelocatableType(), and clang::CopiedTypeVisitor< Derived, IsMove, RetTy >::visit().
bool QualType::isNonWeakInMRRWithObjCWeak | ( | const ASTContext & | Context | ) | const |
Definition at line 2565 of file Type.cpp.
References clang::ASTContext::getLangOpts(), 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 803 of file Type.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnCapScopeReturnStmt(), clang::Sema::ActOnClassPropertyRefExpr(), clang::Sema::ActOnConditionalOp(), clang::Sema::ActOnCXXNestedNameSpecifierDecltype(), clang::Sema::ActOnCXXThis(), clang::Sema::ActOnCXXUuidof(), clang::Sema::ActOnGCCAsmStmt(), clang::Sema::ActOnNumericConstant(), clang::Sema::ActOnObjCForCollectionStmt(), clang::Sema::ActOnOMPArraySectionExpr(), clang::Sema::ActOnOpenMPDeclareMapperType(), clang::Sema::ActOnOpenMPDeclareReductionType(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::ActOnSYCLUniqueStableNameExpr(), clang::Sema::ActOnTemplateTypeArgument(), clang::Sema::ActOnTypeRequirement(), clang::Sema::AddFunctionCandidates(), clang::Sema::AddInitializerToDecl(), clang::ODRHash::AddQualType(), AddResultTypeChunk(), clang::Sema::adjustCCAndNoReturn(), clang::TreeTransform< EnsureImmediateInvocationInDefaultArgs >::AlreadyTransformed(), clang::ASTContext::areCommonBaseCompatible(), clang::ento::ProgramState::assumeInBoundDual(), clang::Sema::BuildClassMessageImplicit(), clang::Sema::buildCoroutinePromise(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildDeclaratorGroup(), clang::Sema::BuildExpressionFromDeclTemplateArgument(), clang::Sema::BuildInstanceMessage(), clang::Sema::buildLambdaInitCaptureInitialization(), clang::Sema::BuildObjCEncodeExpression(), clang::Sema::BuildQualifiedType(), clang::Sema::BuildReturnStmt(), BuildSimilarlyQualifiedPointerType(), clang::Sema::BuildVAArgExpr(), clang::Sema::BuiltinChangeSignedness(), clang::arcmt::trans::canApplyWeak(), clang::Sema::canDelayFunctionBody(), captureVariablyModifiedType(), clang::Sema::CheckAdditionOperands(), checkAllAtProps(), clang::Sema::CheckAssignmentOperands(), clang::Sema::CheckBitwiseOperands(), clang::Sema::CheckConditionalOperands(), checkDeducedTemplateArguments(), clang::Sema::CheckDestructorAccess(), clang::Sema::CheckEnumConstant(), clang::Sema::checkInitMethod(), clang::Sema::CheckMultiplyDivideOperands(), clang::Sema::CheckNonDependentConversions(), clang::Sema::checkOpenMPDeclareVariantFunction(), clang::Sema::CheckOverridingFunctionReturnType(), clang::Sema::CheckRemainderOperands(), clang::Sema::CheckSizelessVectorCompareOperands(), clang::Sema::CheckSubtractionOperands(), clang::Sema::CheckTemplateArgument(), clang::Sema::CheckTypenameType(), clang::Sema::checkTypeSupport(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::CheckVariableDeclarationType(), clang::Sema::CheckVectorCompareOperands(), clang::Sema::CheckVectorLogicalOperands(), chooseRecoveryType(), ClassifyImplicitMemberAccess(), clang::Sema::CodeCompleteDesignator(), clang::Sema::containsUnexpandedParameterPacks(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CreateBuiltinUnaryOp(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), clang::Sema::CreateRecoveryExpr(), clang::Sema::CXXCheckConditionalOperands(), decomposeTypeForEH(), clang::Sema::DeduceAutoType(), clang::Sema::deduceClosureReturnType(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DefaultArgumentPromotion(), clang::Sema::DefaultFunctionArrayConversion(), clang::Sema::DefaultLvalueConversion(), determineEndOffset(), DiagnoseForRangeReferenceVariableCopies(), clang::ODRDiagsEmitter::diagnoseMismatch(), clang::ento::SMTConv::doIntTypeConversion(), clang::ento::SMTConv::doTypeConversion(), clang::TextNodeDumper::dumpBareType(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CGOpenMPRuntime::emitDoacrossInit(), clang::CodeGen::CodeGenFunction::EmitPromotedScalarExpr(), clang::CodeGen::CGOpenMPRuntime::emitTaskInit(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), clang::ento::StoreManager::evalBaseToDerived(), clang::ento::retaincountchecker::RetainCountChecker::evalCall(), clang::ento::ExprEngine::evalCall(), clang::ento::ExprEngine::evalLoad(), EvaluateAsRValue(), evaluateCDTSize(), FastEvaluateAsRValue(), clang::Sema::FindCompositePointerType(), FindDesignatorMismatch(), clang::Sema::FindInstantiatedDecl(), FinishForRangeVarDecl(), clang::Sema::FinishTemplateArgumentDeduction(), clang::index::generateUSRForType(), clang::ASTContext::getAutoDeductType(), clang::ASTContext::getAutoRRefDeductType(), clang::CallExpr::getCallReturnType(), clang::ASTContext::getCommentForDecl(), getCurrentInstantiationOf(), clang::Sema::getCurrentThisType(), GetDeclSpecTypeForDeclarator(), clang::Sema::getDecltypeForExpr(), clang::getDeclUsageType(), getDependTypes(), getDesignatedType(), clang::Sema::getDestructorTypeForDecltype(), clang::Sema::getElaboratedType(), clang::ento::StoreManager::GetElementZeroRegion(), getExistingLazyBinding(), clang::extractapi::DeclarationFragmentsBuilder::getFragmentsForEnum(), clang::ClassTemplateDecl::getInjectedClassNameSpecialization(), clang::ASTContext::getInnerObjCOwnership(), getKmpAffinityType(), clang::ento::StoreManager::getLValueElement(), getMostInformativeDerivedClassImpl(), clang::Sema::getMostSpecialized(), clang::NSAPI::GetNSIntegralKind(), clang::CodeGen::CodeGenModule::getObjCFastEnumerationStateType(), clang::Type::getObjCSubstitutions(), clang::ASTContext::getObjCSuperType(), clang::dataflow::DataflowAnalysisContext::getOrCreateNullPointerValue(), clang::CodeGen::CGDebugInfo::getOrCreateStandaloneType(), clang::ASTWriter::GetOrCreateTypeID(), getParamType(), getPrettyTypeName(), clang::ASTContext::getPromotedIntegerType(), clang::ento::CXXInstanceCall::getRuntimeDefinition(), clang::ento::ObjCMethodCall::getRuntimeDefinition(), clang::ObjCObjectPointerType::getSuperClassType(), clang::ASTContext::getTemplateSpecializationType(), clang::Sema::getTrivialTemplateArgumentLoc(), clang::ASTContext::getTypedefType(), clang::Sema::GetTypeFromParser(), clang::ASTWriter::getTypeID(), getTypePtrOrNull(), clang::ASTContext::getUsingType(), clang::Sema::HandleDependentAccessCheck(), clang::Sema::HandleFunctionTypeMismatch(), hasNonTrivialConstructorCall(), clang::ASTContext::hasUniqueObjectRepresentations(), haveSameParameterTypes(), clang::ASTImporter::Import(), clang::ASTReader::InitializeContext(), clang::comments::DeclInfo::involvesFunctionType(), IsAcceptableNonMemberOperatorCandidate(), isCXX98PODType(), clang::Declarator::isDeclarationOfFunction(), clang::DeducedType::isDeduced(), clang::DeclarationName::isDependentName(), clang::arcmt::trans::MigrationContext::isGCOwnedNonObjC(), clang::CodeGen::CodeGenModule::isInNoSanitizeList(), isLayoutCompatible(), clang::CanQual< ObjCObjectType >::isNull(), isOSObjectRelated(), isOverflowingIntegerType(), isPointerToConst(), isPointerToObject(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), IsStructurallyEquivalent(), clang::DeducedType::isSugared(), clang::Sema::isThisOutsideMemberFunctionBody(), isTrivialType(), clang::ento::DynamicTypeInfo::isValid(), isValidOSObjectOutParameter(), isValidSubjectOfOSAttribute(), clang::ento::SymExpr::isValidTypeForSymbol(), isVoidPointer(), clang::ComparisonCategories::lookupInfoForType(), clang::serialization::MakeTypeID(), MarkUsedTemplateParameters(), clang::Sema::MatchTemplateParametersToScopeSpecifier(), maybeAdjustInterfaceForSubscriptingCheck(), mergeEnumWithInteger(), clang::ASTContext::mergeFunctionParameterTypes(), clang::ASTContext::mergeFunctionTypes(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTransparentUnionType(), clang::ASTContext::mergeTypes(), clang::Sema::MergeVarDeclTypes(), clang::Sema::ParseObjCProtocolExpression(), clang::Sema::PerformImplicitConversion(), clang::ento::ExprEngine::processCallExit(), clang::UsingType::Profile(), clang::TypedefType::Profile(), clang::DeducedTemplateSpecializationType::Profile(), clang::ASTRecordReader::readTypeSourceInfo(), clang::TreeTransform< EnsureImmediateInvocationInDefaultArgs >::RebuildUnresolvedUsingType(), rewriteToNSMacroDecl(), clang::Sema::SelectorsForTypoCorrection(), clang::InitializationSequence::SetFailed(), clang::ASTContext::setObjCConstantStringInterface(), clang::Expr::setType(), clang::Sema::SubstType(), clang::TreeTransform< EnsureImmediateInvocationInDefaultArgs >::TransformFunctionProtoType(), clang::TreeTransform< EnsureImmediateInvocationInDefaultArgs >::TransformFunctionTypeParams(), clang::TreeTransform< EnsureImmediateInvocationInDefaultArgs >::TransformReferenceType(), clang::TreeTransform< EnsureImmediateInvocationInDefaultArgs >::TransformTemplateArgument(), clang::RecursiveASTVisitor< CallGraph >::TraverseType(), clang::Sema::tryCaptureOpenMPLambdas(), TryDeconstructFunctionLike(), clang::Sema::tryExprAsCall(), tryRearrange(), TryReinterpretCast(), TryToFixInvalidVariablyModifiedType(), TryToFixInvalidVariablyModifiedTypeSourceInfo(), clang::Sema::tryToRecoverWithCall(), clang::ASTContext::typesAreBlockPointerCompatible(), clang::ASTContext::typesAreCompatible(), UnwrapTypeForDebugInfo(), clang::Sema::UsualArithmeticConversions(), clang::Sema::UsualUnaryConversions(), clang::FunctionCallFilterCCC::ValidateCandidate(), clang::UsedDeclVisitor< Derived >::VisitCXXDeleteExpr(), and clang::ASTDeclReader::VisitDeclaratorDecl().
|
inline |
true when Type is objc's strong.
Definition at line 1189 of file Type.h.
References getObjCGCAttr(), and clang::Qualifiers::Strong.
Referenced by GetGCAttrTypeForType().
|
inline |
true when Type is objc's weak.
Definition at line 1184 of file Type.h.
References getObjCGCAttr(), and clang::Qualifiers::Weak.
Referenced by clang::Sema::CheckVariableDeclarationType(), 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 2398 of file Type.cpp.
References clang::ASTContext::getLangOpts(), isCXX11PODType(), and isCXX98PODType().
Referenced by clang::Sema::BuildVAArgExpr(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), EmitMemberInitializer(), and EvaluateUnaryTypeTrait().
|
inline |
Definition at line 6641 of file Type.h.
References clang::Type::getAs(), clang::Type::isObjectType(), clang::Type::isReferenceType(), and clang::RQ_None.
Referenced by clang::Sema::BuiltinAddPointer(), clang::Sema::BuiltinAddReference(), and EvaluateUnaryTypeTrait().
|
inline |
Determine whether this type is restrict-qualified.
Definition at line 6710 of file Type.h.
References isLocalRestrictQualified().
Referenced by appendQualifier(), CollectVRQualifiers(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), and clang::CodeGen::CodeGenModule::GenKernelArgMetadata().
bool QualType::isTriviallyCopyableType | ( | const ASTContext & | Context | ) | const |
Return true if this is a trivially copyable type (C++0x [basic.types]p9)
Definition at line 2506 of file Type.cpp.
References clang::Type::getAs(), clang::ASTContext::getBaseElementType(), getCanonicalType(), hasNonTrivialObjCLifetime(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Type::isScalarType(), clang::Type::isSizelessBuiltinType(), isTriviallyCopyableType(), and clang::Type::isVectorType().
Referenced by clang::Sema::BuildAtomicExpr(), clang::Sema::BuildAtomicType(), clang::Sema::BuildObjCBoxedExpr(), canCaptureVariableByCopy(), createObjCPropertyGetter(), DiagnoseForRangeConstVariableCopies(), EvaluateUnaryTypeTrait(), clang::ASTContext::hasUniqueObjectRepresentations(), isTriviallyCopyableType(), and clang::CodeGen::CodeGenModule::MayDropFunctionReturn().
bool QualType::isTriviallyRelocatableType | ( | const ASTContext & | Context | ) | const |
Return true if this is a trivially relocatable type.
Definition at line 2546 of file Type.cpp.
References clang::Type::getAsRecordDecl(), clang::ASTContext::getBaseElementType(), isDestructedType(), clang::Type::isIncompleteType(), isNonTrivialToPrimitiveDestructiveMove(), PCK_ARCStrong, and PCK_Trivial.
Referenced by EvaluateUnaryTypeTrait().
bool QualType::isTrivialType | ( | const ASTContext & | Context | ) | const |
Return true if this is a trivial type per (C++0x [basic.types]p9)
Definition at line 2455 of file Type.cpp.
References clang::Type::getAs(), clang::ASTContext::getBaseElementType(), getTypePtr(), hasNonTrivialObjCLifetime(), clang::Type::isDependentType(), isNull(), clang::Type::isScalarType(), isTrivialType(), and clang::Type::isVectorType().
Referenced by EvaluateUnaryTypeTrait(), isTrivialType(), and clang::cross_tu::shouldImport().
|
inline |
Determine whether this type is volatile-qualified.
Definition at line 6716 of file Type.h.
References isLocalVolatileQualified().
Referenced by clang::Sema::AddInitializerToDecl(), appendQualifier(), clang::Sema::BuildFunctionType(), clang::Sema::BuiltinRemoveReference(), clang::Sema::CaptureHasSideEffects(), clang::Sema::CheckAssignmentOperands(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), clang::Sema::CheckFunctionReturnType(), CheckIdentityFieldAssignment(), clang::Sema::CheckLiteralOperatorDeclaration(), clang::Sema::CheckLValueToRValueConversionOperand(), clang::Sema::CheckUnusedVolatileAssignment(), CollectVRQualifiers(), decomposeTypeForEH(), clang::CodeGen::CodeGenFunction::emitAlignmentAssumptionCheck(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), EmitCheckedMixedSignMultiply(), EmitCheckedUnsignedMultiplySignedResult(), clang::CodeGen::CodeGenFunction::EmitCXXPseudoDestructorExpr(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), emitOMPAtomicCompareExpr(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), EvaluateUnaryTypeTrait(), findCompleteObject(), findSubobject(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenModule::GenKernelArgMetadata(), clang::Sema::getNamedReturnInfo(), getSubobjectType(), clang::Sema::handlerCanCatch(), clang::Expr::isUnusedResultAWarning(), clang::MaterializeTemporaryExpr::isUsableInConstantExpressions(), clang::AtomicExpr::isVolatile(), and MaybeDecrementCount().
bool QualType::mayBeDynamicClass | ( | ) | const |
Returns true if it is a class and it might be dynamic.
Definition at line 93 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 98 of file Type.cpp.
References clang::Type::getPointeeCXXRecordDecl(), getTypePtr(), and clang::CXXRecordDecl::mayBeNonDynamicClass().
|
inline |
Definition at line 791 of file Type.h.
References getTypePtr().
|
inline |
Definition at line 795 of file Type.h.
References getTypePtr().
|
static |
Definition at line 2353 of file TypePrinter.cpp.
void QualType::print | ( | raw_ostream & | OS, |
const PrintingPolicy & | Policy, | ||
const Twine & | PlaceHolder = Twine() , |
||
unsigned | Indentation = 0 |
||
) | const |
Definition at line 2347 of file TypePrinter.cpp.
Referenced by clang::NestedNameSpecifier::print(), print(), clang::TemplateParamObjectDecl::printAsExpr(), and printCXXConstructorDestructorName().
|
inlinestatic |
Definition at line 1103 of file Type.h.
References print(), clang::SplitQualType::Quals, split(), and clang::SplitQualType::Ty.
|
inline |
Definition at line 1155 of file Type.h.
References getAsOpaquePtr().
Referenced by clang::ento::CompoundValData::Profile(), clang::UnnamedGlobalConstantDecl::Profile(), clang::UsingType::Profile(), clang::TypedefType::Profile(), clang::TemplateSpecializationType::Profile(), and clang::ElaboratedType::Profile().
|
inline |
Definition at line 6740 of file Type.h.
References clang::Qualifiers::Const, and removeLocalFastQualifiers().
Referenced by clang::Sema::BuildAtomicExpr(), DiagnoseForRangeReferenceVariableCopies(), and findSubobject().
|
inline |
Definition at line 6752 of file Type.h.
References clang::Qualifiers::CVRMask, clang::Qualifiers::FastMask, and removeLocalFastQualifiers().
Referenced by adjustCVQualifiersForCXXThisWithinLambda(), and clang::Sema::CheckCXXThisCapture().
|
inline |
Definition at line 950 of file Type.h.
Referenced by clang::serialization::MakeTypeID(), removeLocalConst(), removeLocalCVRQualifiers(), removeLocalRestrict(), removeLocalVolatile(), and withoutLocalFastQualifiers().
|
inline |
Definition at line 951 of file Type.h.
References clang::Qualifiers::FastMask.
|
inline |
Definition at line 6744 of file Type.h.
References removeLocalFastQualifiers(), and clang::Qualifiers::Restrict.
|
inline |
Definition at line 6748 of file Type.h.
References removeLocalFastQualifiers(), and clang::Qualifiers::Volatile.
Referenced by clang::Sema::BuildAtomicExpr(), and findSubobject().
|
inline |
|
inline |
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition at line 6654 of file Type.h.
References clang::Qualifiers::addFastQualifiers(), clang::Qualifiers::fromFastMask(), clang::ExtQuals::getBaseType(), getLocalFastQualifiers(), clang::ExtQuals::getQualifiers(), and hasLocalNonFastQualifiers().
Referenced by clang::ODRHash::AddQualType(), clang::TextNodeDumper::dumpBareType(), getAsString(), getAsStringInternal(), clang::ASTContext::getCommonSugaredType(), clang::SplitQualType::getSingleStepDesugaredType(), getSplitUnqualifiedType(), print(), clang::CanQual< ObjCObjectType >::split(), splitAccordingToPolicy(), clang::ObjCObjectType::stripObjCKindOfTypeAndQuals(), unwrapSugar(), clang::ASTNodeTraverser< ASTDumper, TextNodeDumper >::Visit(), clang::TextNodeDumper::Visit(), clang::JSONNodeDumper::Visit(), and clang::TextNodeDumper::VisitFunctionDecl().
|
inline |
Definition at line 1145 of file Type.h.
Referenced by clang::FunctionProtoType::printExceptionSpecification().
QualType QualType::stripObjCKindOfType | ( | const ASTContext & | ctx | ) | const |
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 1515 of file Type.cpp.
References clang::Type::getObjCSubstitutions(), clang::DeclContext::getParentASTContext(), and substObjCTypeArgs().
Referenced by clang::ObjCMethodDecl::getSendResultType(), clang::ObjCPropertyDecl::getUsageType(), and clang::ObjCIvarDecl::getUsageType().
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 1508 of file Type.cpp.
Referenced by clang::Sema::CheckMessageArgumentTypes(), clang::ObjCObjectType::computeSuperClassTypeSlow(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), formatBlockPlaceholder(), getReturnTypeForMethod(), clang::ObjCMethodDecl::getSendResultType(), and substObjCMemberType().
bool QualType::UseExcessPrecision | ( | const ASTContext & | Ctx | ) |
Definition at line 1487 of file Type.cpp.
References clang::Type::getAs(), clang::BuiltinType::getKind(), clang::ASTContext::getLangOpts(), clang::ASTContext::getTargetInfo(), getTypePtr(), clang::TargetInfo::hasFloat16Type(), and clang::TargetInfo::hasLegalHalfType().
|
inline |
Definition at line 915 of file Type.h.
References clang::Qualifiers::Const, and withFastQualifiers().
Referenced by clang::Sema::ActOnCapturedRegionStart(), clang::Sema::ActOnOpenMPRegionStart(), clang::Sema::ActOnSourceLocExpr(), clang::Sema::BuildCXXTypeId(), clang::Sema::BuildObjCArrayLiteral(), clang::Sema::BuildObjCDictionaryLiteral(), clang::Sema::DeclareImplicitCopyAssignment(), clang::Sema::DeclareImplicitCopyConstructor(), DiagnoseForRangeReferenceVariableCopies(), clang::CodeGen::CodeGenFunction::EmitObjCCollectionLiteral(), clang::ASTContext::getConstType(), clang::ASTContext::getMSGuidDecl(), clang::ASTContext::getStringLiteralArrayType(), clang::Sema::SpecialMemberIsTrivial(), and clang::CanQual< ObjCObjectType >::withConst().
Definition at line 935 of file Type.h.
References withFastQualifiers().
Referenced by clang::CodeGen::CodeGenFunction::EmitExtVectorElementExpr(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), GeneralizeType(), and unwrapCastAwayConstnessLevel().
Definition at line 966 of file Type.h.
References withFastQualifiers(), and withoutLocalFastQualifiers().
Definition at line 958 of file Type.h.
References addFastQualifiers().
Referenced by clang::QualifierCollector::apply(), getCanonicalType(), clang::ASTContext::getQualifiedType(), clang::ASTContext::getRestrictType(), clang::ASTContext::getVolatileType(), withConst(), withCVRQualifiers(), withExactLocalFastQualifiers(), withRestrict(), and withVolatile().
|
inline |
Definition at line 971 of file Type.h.
References removeLocalFastQualifiers().
Referenced by getCoreType(), and withExactLocalFastQualifiers().
|
inline |
Definition at line 931 of file Type.h.
References clang::Qualifiers::Restrict, and withFastQualifiers().
Referenced by clang::Sema::ActOnCapturedRegionStart(), clang::Sema::ActOnOpenMPRegionStart(), emitDestructorsFunction(), and emitProxyTaskFunction().
|
inline |
Definition at line 923 of file Type.h.
References clang::Qualifiers::Volatile, and withFastQualifiers().
Referenced by callSpecialFunction(), clang::CodeGen::CodeGenFunction::defaultInitNonTrivialCStructVar(), and getSpecialFunction().
|
friend |