clang
10.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) |
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 | 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 | 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 | 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 |
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... | |
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 |
|
inline |
|
inline |
|
inline |
Add the const
type qualifier to this QualType.
Definition at line 823 of file Type.h.
References clang::Qualifiers::Const.
Referenced by adjustCVQualifiersForCXXThisWithinLambda(), alignReferenceTypes(), checkTrivialSubobjectCall(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), getSubobjectType(), and isVariableAlreadyCapturedInScopeInfo().
|
inline |
Definition at line 850 of file Type.h.
References clang::Qualifiers::FastMask.
Referenced by withFastQualifiers().
|
inline |
Add the restrict
qualifier to this QualType.
Definition at line 839 of file Type.h.
References clang::Qualifiers::Restrict.
|
inline |
Add the volatile
type qualifier to this QualType.
Definition at line 831 of file Type.h.
References clang::Qualifiers::Volatile.
Referenced by getSubobjectType().
void QualType::dump | ( | const char * | s | ) | const |
Definition at line 156 of file ASTDumper.cpp.
References dump().
Referenced by clang::CanQual< ObjCObjectType >::dump(), clang::Type::dump(), and clang::arcmt::trans::MigrationContext::dumpGCAttrs().
LLVM_DUMP_METHOD void QualType::dump | ( | ) | const |
Definition at line 162 of file ASTDumper.cpp.
References dump().
LLVM_DUMP_METHOD void QualType::dump | ( | llvm::raw_ostream & | OS | ) | const |
Definition at line 164 of file ASTDumper.cpp.
References clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
|
inline |
Return the address space of this type.
Definition at line 6377 of file Type.h.
Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::BuildAddressSpaceAttr(), clang::Sema::BuildAtomicExpr(), clang::Sema::BuildObjCExceptionDecl(), clang::Sema::CheckAllocatedType(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitCastLValue(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), clang::CodeGen::CodeGenFunction::EmitVarDecl(), findCompleteObject(), clang::CodeGen::CodeGenModule::GenOpenCLArgMetadata(), clang::ASTContext::getAddrSpaceQualType(), clang::MemberExpr::getEndLoc(), clang::CodeGen::TargetCodeGenInfo::getGlobalVarAddressSpace(), clang::CodeGen::CodeGenModule::GetGlobalVarAddressSpace(), clang::ASTContext::getTargetNullPointerValue(), HandleAddressSpaceTypeAttribute(), IsAddressSpaceConversion(), clang::Expr::isNullPointerConstant(), isTrivialFiller(), clang::CodeGen::CodeGenModule::isTypeConstant(), mayBeNotDynamicClass(), clang::InitializationSequence::Perform(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformQualificationConversion(), processTypeAttrs(), clang::TreeTransform< Derived >::RebuildQualifiedType(), clang::ASTContext::removePtrSizeAddrSpace(), requiresAMDGPUDefaultVisibility(), clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue(), TryAddressSpaceCast(), clang::CodeGen::ConstantEmitter::tryEmitForInitializer(), and TryReinterpretCast().
|
inline |
Definition at line 699 of file Type.h.
Referenced by clang::CodeGen::CGDebugInfo::completeClass(), clang::CodeGen::CGDebugInfo::completeType(), clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor(), clang::CanQual< ObjCObjectType >::getAsOpaquePtr(), llvm::PointerLikeTypeTraits< clang::QualType >::getAsVoidPointer(), clang::ASTContext::getCommentForDecl(), llvm::DenseMapInfo< clang::QualType >::getHashValue(), clang::serialization::UnsafeQualTypeDenseMapInfo::getHashValue(), clang::CodeGen::CGDebugInfo::getOrCreateStandaloneType(), clang::ObjCPropertyRefExpr::getReceiverType(), hasDefaultSetterName(), hasMangledSubstitutionQualifiers(), isStreamCharSpecialization(), clang::FunctionProtoType::isTemplateVariadic(), clang::sema::DelayedDiagnostic::makeForbiddenType(), clang::QualTypeOrdering::operator()(), clang::operator<<(), clang::detail::CXXSpecialNameExtra::Profile(), clang::ComplexType::Profile(), clang::PointerType::Profile(), clang::AdjustedType::Profile(), clang::BlockPointerType::Profile(), clang::ReferenceType::Profile(), clang::MemberPointerType::Profile(), clang::IncompleteArrayType::Profile(), clang::DependentSizedArrayType::Profile(), clang::DependentAddressSpaceType::Profile(), clang::DependentSizedExtVectorType::Profile(), clang::VectorType::Profile(), clang::DependentVectorType::Profile(), clang::FunctionNoProtoType::Profile(), clang::DependentUnaryTransformType::Profile(), clang::AttributedType::Profile(), clang::SubstTemplateTypeParmType::Profile(), clang::AutoType::Profile(), clang::DeducedTemplateSpecializationType::Profile(), clang::PackExpansionType::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(), TryReferenceInit(), UnwrapTypeForDebugInfo(), clang::TextNodeDumper::Visit(), and clang::JSONNodeDumper::Visit().
|
inlinestatic |
Definition at line 990 of file Type.h.
References clang::getAsString(), print(), clang::SplitQualType::Quals, and clang::SplitQualType::Ty.
Referenced by clang::data_collection::addDataToConsumer(), addFixitForObjCARCConversion(), CompareReturnTypes(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), clang::Sema::diagnoseUnavailableAlignedAllocation(), dumpMicrosoftThunkAdjustment(), DumpRecordLayout(), clang::ento::SymbolRegionValue::dumpToStream(), FormatFunctionParameter(), clang::CodeGen::CodeGenModule::GenOpenCLArgMetadata(), clang::TypeName::getFullyQualifiedName(), getFunctionSourceLocation(), getIncrementedVar(), clang::diff::getInitializerValue(), getPrettyTypeName(), GetSignature(), HasLocalVariableExternalStorage(), clang::CodeGen::CodeGenModule::isInSanitizerBlacklist(), isISLObjectRef(), isLeftShiftResultUnrepresentable(), isNullPointerValueTemplateArgument(), isOpenCLSizeDependentType(), isOSObjectRelated(), OpenCLConvertScalarsToVectors(), clang::consumed::ConsumedStateMap::operator!=(), clang::ento::printDynamicTypesJson(), RewriteOneForwardClassDecl(), rewriteToNSMacroDecl(), rewriteToObjCProperty(), scanToNextArgument(), SemaOpenCLBuiltinEnqueueKernel(), clang::TextNodeDumper::VisitCXXFunctionalCastExpr(), clang::TextNodeDumper::VisitCXXNamedCastExpr(), clang::ento::SValExplainer::VisitElementRegion(), clang::ento::SValExplainer::VisitSymbolConjured(), and clang::ento::SValExplainer::VisitSymbolMetadata().
|
static |
Definition at line 1887 of file TypePrinter.cpp.
std::string QualType::getAsString | ( | ) | const |
Definition at line 1877 of file TypePrinter.cpp.
Referenced by clang::TextNodeDumper::dumpBareType(), clang::JSONNodeDumper::Visit(), and clang::TextNodeDumper::VisitFunctionDecl().
std::string QualType::getAsString | ( | const PrintingPolicy & | Policy | ) | const |
Definition at line 1881 of file TypePrinter.cpp.
void QualType::getAsStringInternal | ( | std::string & | Str, |
const PrintingPolicy & | Policy | ||
) | const |
Definition at line 1909 of file TypePrinter.cpp.
Referenced by clang::Sema::CheckVirtualDtorCall(), diagnoseNoViableConversion(), formatBlockPlaceholder(), FormatFunctionParameter(), and HasLocalVariableExternalStorage().
|
inlinestatic |
Definition at line 1018 of file Type.h.
References clang::SplitQualType::Quals, and clang::SplitQualType::Ty.
|
static |
Definition at line 1915 of file TypePrinter.cpp.
QualType QualType::getAtomicUnqualifiedType | ( | ) | const |
Remove all qualifiers including _Atomic.
Definition at line 1438 of file Type.cpp.
Referenced by Evaluate(), and EvaluateInPlace().
const IdentifierInfo * QualType::getBaseTypeIdentifier | ( | ) | const |
Retrieves a pointer to the name of the base type.
Definition at line 72 of file Type.cpp.
References clang::Type::castAs(), clang::Type::castAsArrayTypeUnsafe(), getBaseTypeIdentifier(), clang::TypedefType::getDecl(), clang::RecordType::getDecl(), clang::EnumType::getDecl(), clang::NamedDecl::getIdentifier(), clang::Type::getPointeeType(), clang::Type::getTypeClass(), clang::Type::isArrayType(), clang::Type::isEnumeralType(), clang::Type::isPointerType(), clang::Type::isRecordType(), and clang::Type::isReferenceType().
Referenced by appendType(), and getBaseTypeIdentifier().
|
inline |
Definition at line 6295 of file Type.h.
References withFastQualifiers().
Referenced by clang::Sema::ActOnOpenMPAlignedClause(), clang::Sema::ActOnOpenMPLinearClause(), adjustReturnValue(), clang::CodeGen::CGOpenMPRuntimeNVPTX::adjustTargetSpecificDataForLambdas(), appendType(), buildUserDefinedMapperRef(), clang::Sema::CheckGNUVectorConditionalTypes(), checkMapClauseExpressionBase(), checkMapConflicts(), checkMappableExpressionList(), clang::Sema::checkOpenCLDisabledTypeDeclSpec(), checkOpenCLEnqueueVariadicArgs(), clang::Sema::CheckOpenMPLinearDecl(), checkVarTypeForConstantEmission(), clang::ConstructionContext::createFromLayers(), DiagnoseRecursiveConstFields(), clang::ento::SMTConv::doTypeConversion(), dumpMicrosoftThunkAdjustment(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), clang::CodeGen::CodeGenModule::EmitOMPThreadPrivateDecl(), clang::PreferredTypeBuilder::enterTypeCast(), clang::ento::SValBuilder::evalCast(), EvaluateBuiltinClassifyType(), clang::index::generateUSRForType(), clang::CodeGen::CodeGenModule::GenOpenCLArgMetadata(), getAArch64LS(), getAArch64MTV(), getAArch64PBV(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getCanonicalType(), clang::ASTContext::getCommentForDecl(), getComplexType(), clang::CodeGen::CodeGenFunction::getEvaluationKind(), getNDSWDS(), clang::ObjCMethodCall::getRuntimeDefinition(), getTypeInfoLinkage(), clang::RecordType::hasConstFields(), hasSameUnqualifiedPointeeType(), clang::Sema::inferGslPointerAttribute(), clang::CFGCXXRecordTypedCall::isCXXRecordTypedCall(), clang::CodeGen::CodeGenModule::isInSanitizerBlacklist(), isLayoutCompatible(), isOSObjectRelated(), isPointerToConst(), clang::ConstructionContextLayer::isStrictlyMoreSpecificThan(), clang::InitListExpr::isTransparent(), isTypeSubstitutable(), isValidVectorForConditionalCondition(), maybeRecoverWithZeroInitialization(), SemaOpenCLBuiltinEnqueueKernel(), clang::Sema::setOpenCLExtensionForType(), splitAccordingToPolicy(), SuggestInitializationFixit(), clang::TreeTransform< Derived >::TransformExceptionSpec(), clang::Sema::tryCaptureOpenMPLambdas(), clang::ASTNodeImporter::VisitClassTemplateSpecializationDecl(), clang::ento::SValExplainer::VisitSymbolicRegion(), and clang::ASTNodeImporter::VisitTemplateSpecializationType().
|
inline |
Retrieve the set of CVR (const-volatile-restrict) qualifiers applied to this type.
Definition at line 6289 of file Type.h.
Referenced by clang::Sema::CheckPointerToMemberOperands(), CheckTemplateArgumentIsCompatibleWithParameter(), checkTrivialSubobjectCall(), DeduceTemplateArgumentsByTypeMatch(), defaultedSpecialMemberIsConstexpr(), diagnoseRedundantReturnTypeQualifiers(), GeneralizeType(), handleCompoundAssignment(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::Sema::SpecialMemberIsTrivial(), and TryObjectArgumentInitialization().
|
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 954 of file Type.h.
Referenced by clang::Type::getArrayElementTypeNoTypeQual().
|
inlinestatic |
Definition at line 701 of file Type.h.
Referenced by clang::DependentDiagnostic::getAccessBaseObjectType(), 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::ObjCMessageExpr::getSuperType(), llvm::DenseMapInfo< clang::QualType >::getTombstoneKey(), clang::serialization::UnsafeQualTypeDenseMapInfo::getTombstoneKey(), clang::StandardConversionSequence::getToType(), clang::AmbiguousConversionSequence::getToType(), clang::BadConversionSequence::getToType(), clang::TypeLoc::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 781 of file Type.h.
Referenced by diagnoseRedundantReturnTypeQualifiers(), and clang::CanQual< ObjCObjectType >::getCVRQualifiers().
|
inline |
Definition at line 681 of file Type.h.
Referenced by clang::serialization::UnsafeQualTypeDenseMapInfo::getHashValue(), clang::ASTWriter::GetOrCreateTypeID(), clang::ASTWriter::getTypeID(), and clang::QualifierCollector::strip().
|
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 6275 of file Type.h.
References clang::Qualifiers::addFastQualifiers().
Referenced by clang::Sema::ActOnForEachDeclStmt(), clang::TypeName::getFullyQualifiedType(), clang::CanQual< ObjCObjectType >::getQualifiers(), getTypeCodeForTypeClass(), clang::ASTImporter::Import(), isConstantEmittableObjectType(), IsStandardConversion(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), clang::TreeTransform< Derived >::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 893 of file Type.h.
Referenced by clang::ento::StoreManager::castRegion(), DiagnoseNarrowingInInitList(), getTypeCodeForTypeClass(), IsStandardConversion(), 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 2915 of file Type.cpp.
References clang::ASTContext::getLangOpts(), and clang::Type::getPointeeType().
Referenced by EvaluateBinaryTypeTrait(), evaluateTypeTrait(), clang::ObjCMethodDecl::getSendResultType(), clang::UserDefinedLiteral::getUDSuffix(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), clang::Sema::PerformImplicitConversion(), TryClassUnification(), tryObjCWritebackConversion(), and TryRefInitWithConversionFunction().
|
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 6452 of file Type.h.
References clang::Type::getPointeeType().
Referenced by clang::Sema::ActOnOpenMPAlignedClause(), clang::Sema::ActOnOpenMPFirstprivateClause(), clang::Sema::ActOnOpenMPIsDevicePtrClause(), clang::Sema::ActOnOpenMPLastprivateClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPPrivateClause(), clang::Sema::ActOnOpenMPUseDevicePtrClause(), clang::CodeGen::CGOpenMPRuntimeNVPTX::adjustTargetSpecificDataForLambdas(), buildCapture(), clang::Sema::BuildDeclarationNameExpr(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), castToBase(), clang::Sema::CheckConditionVariable(), checkMapClauseExpressionBase(), checkMapConflicts(), checkMappableExpressionList(), clang::Sema::CheckOpenMPLinearDecl(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), clang::ExprWithCleanups::Create(), createObjCPropertyGetter(), createPrivatesRecordDecl(), DeduceNonTypeTemplateArgument(), diagnoseAmbiguousConversion(), clang::Sema::diagnoseARCUnbridgedCast(), DiagnoseForRangeReferenceVariableCopies(), diagnoseNoViableConversion(), clang::Sema::DiagnosePropertyAccessorMismatch(), DiagnoseUninitializedReference(), emitBadConversionNotes(), emitCPPObjectAtomicSetterCall(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::emitLastprivateConditionalFinalUpdate(), emitOMPAtomicCaptureExpr(), emitOMPAtomicReadExpr(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), emitStructSetterCall(), EvaluateBinaryTypeTrait(), EvaluateComparisonBinaryOperator(), evaluateTypeTrait(), FindConversionForRefInit(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), getCanonicalParamType(), clang::CFGImplicitDtor::getDestructorDecl(), clang::UnresolvedMemberExpr::getNamingClass(), clang::Sema::getOpenMPCapturedExpr(), getParamType(), getThreadLocalWrapperLinkage(), getVariableCategoryFromDecl(), HandleConstructorCall(), hasCopyOrMoveCtorParam(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), IsTypeModifiable(), isVariableAlreadyCapturedInScopeInfo(), loadToBegin(), clang::InitializationSequence::Perform(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformMoveOrCopyInitialization(), clang::APValue::printPretty(), recordConversion(), clang::Sema::tryCaptureOpenMPLambdas(), and clang::Sema::tryCaptureVariable().
|
inline |
Returns gc attribute of this type.
Return the gc attribute of this type.
Definition at line 6382 of file Type.h.
Referenced by clang::ASTContext::getObjCGCAttrKind(), clang::ASTContext::getObjCGCQualType(), and handleObjCGCTypeAttr().
|
inline |
Returns lifetime attribute of this type.
Definition at line 1080 of file Type.h.
References clang::Qualifiers::getObjCLifetime().
Referenced by clang::Sema::BuildPseudoDestructorExpr(), checkAllAtProps(), clang::Sema::CheckAllocatedType(), checkBuiltinArgument(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::checkIllFormedTrivialABIStruct(), clang::Sema::CheckObjCConversion(), checkTrivialClassMembers(), clang::Sema::checkUnsafeAssigns(), clang::Sema::checkUnsafeExprAssigns(), computeBlockInfo(), considerVariable(), clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(), clang::CodeGen::CodeGenFunction::EmitCXXPseudoDestructorExpr(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), EmitObjectDelete(), enterBlockScope(), EvaluateUnaryTypeTrait(), findRetainCycleOwner(), clang::ASTContext::getByrefLifetime(), GetGCAttrTypeForType(), clang::ASTContext::getInnerObjCOwnership(), GetIntrinsic(), clang::ASTContext::getLifetimeQualifiedType(), getMaxAtomicAccessSize(), clang::Type::hasSizedVLAType(), hasWeakMember(), inferARCWriteback(), clang::Sema::inferObjCARCLifetime(), isCanonicalResultType(), isInvalidICRSource(), isTypeSubstitutable(), LookupMemberExpr(), LookupMethodInReceiverType(), PropertyMemoryAttribute(), pushTemporaryCleanup(), clang::TreeTransform< Derived >::RebuildQualifiedType(), setImpliedPropertyAttributeForReadOnlyProperty(), shouldEmitSeparateBlockRetain(), shouldExtendReceiverForInnerPointerMessage(), transferARCOwnershipToDeclSpec(), tryEmitARCCopyWeakInit(), and tryEmitARCRetainLoadOfScalar().
|
inline |
Retrieve the set of qualifiers applied to this type.
Definition at line 6283 of file Type.h.
References clang::Qualifiers::addFastQualifiers().
Referenced by clang::Sema::ActOnCXXDelete(), AddRecordMembersCompletionResults(), clang::ASTContext::BlockRequiresCopying(), BuildImplicitBaseInitializer(), clang::Sema::CheckAllocatedType(), checkComplexDecomposition(), checkConditionalObjectPointersCompatibility(), checkConditionalPointerCompatibility(), checkMemberDecomposition(), checkVectorDecomposition(), CompareQualificationConversions(), computeCopyInfoForBlockCapture(), computeDestroyInfoForBlockCapture(), createPlaceholderSlot(), decomposeTypeForEH(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::DefineImplicitCopyAssignment(), DiagnoseBadFunctionCast(), DiagnoseUninitializedUse(), clang::CodeGen::CodeGenFunction::EmitCompoundLiteralLValue(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), clang::CodeGen::CodeGenFunction::EmitCXXPseudoDestructorExpr(), clang::CodeGen::emitDeclareTargetVarDefinition(), EmitDeclDestroy(), clang::CodeGen::CGObjCRuntime::EmitInitOfCatchParam(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), clang::CodeGen::CodeGenFunction::EmitObjCIvarRefLValue(), EmitOMPAggregateInit(), clang::CodeGen::CodeGenFunction::EmitOMPFirstprivateClause(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), EmitValToTemp(), GetAlignOfType(), clang::TypeName::getFullyQualifiedType(), clang::CodeGen::CodeGenFunction::getNaturalTypeAlignment(), getNonMemoryType(), clang::ASTContext::getTargetAddressSpace(), clang::ASTContext::getUnqualifiedObjCPointerType(), handleObjCOwnershipTypeAttr(), hasInconsistentOrSupersetQualifiersOf(), hasMangledSubstitutionQualifiers(), clang::PointerType::isAddressSpaceOverlapping(), isAtLeastAsQualifiedAs(), IsConstNonVolatile(), isMoreQualifiedThan(), clang::Expr::isNullPointerConstant(), clang::Sema::isObjCPointerConversion(), isQualificationConversionStep(), clang::CodeGen::LValue::MakeBitfield(), clang::CodeGen::LValue::MakeExtVectorElt(), clang::CodeGen::LValue::MakeGlobalReg(), clang::CodeGen::LValue::MakeVectorElt(), clang::ASTContext::mergeTypes(), processTypeAttrs(), clang::TreeTransform< Derived >::RebuildQualifiedType(), clang::Sema::RefersToMemberWithReducedAlignment(), ResolveConstructorOverload(), rewriteToObjCProperty(), splitAccordingToPolicy(), StoreAnyExprIntoOneUnit(), TryObjectArgumentInitialization(), TryReferenceInit(), TryReferenceInitializationCore(), TryRefInitWithConversionFunction(), TryReinterpretCast(), TryStaticCast(), TryUserDefinedConversion(), 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 967 of file Type.h.
Referenced by computeConditionalNullability(), clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), isOpenCLSizeDependentType(), and isTypeSubstitutable().
|
inline |
Definition at line 958 of file Type.h.
Referenced by clang::TextNodeDumper::dumpBareType(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getBaseElementType(), clang::Type::getLocallyUnqualifiedSingleStepDesugaredType(), clang::ASTContext::getVariableArrayDecayedType(), and clang::JSONNodeDumper::Visit().
|
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 6343 of file Type.h.
Referenced by clang::Sema::BuildQualifiedType(), and clang::ASTContext::getUnqualifiedArrayType().
|
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 6256 of file Type.h.
Referenced by clang::Sema::ActOnCastExpr(), addAssociatedClassesAndNamespaces(), clang::CodeGen::CGDebugInfo::addHeapAllocSiteMetadata(), clang::ASTContext::adjustFunctionType(), clang::interp::ByteCodeExprGen< Emitter >::allocateLocal(), clang::ASTContext::applyObjCProtocolQualifiers(), clang::Sema::BuildCXXNamedCast(), clang::Type::canHaveNullability(), checkArrayExpressionDoesNotReferToUnitySize(), checkArrayExpressionDoesNotReferToWholeSize(), clang::Sema::CheckFloatComparison(), checkNullabilityTypeSpecifier(), CheckObjCBridgeCFCast(), CheckObjCBridgeNSCast(), clang::Sema::CheckObjCConversion(), clang::Sema::checkOpenCLDisabledTypeDeclSpec(), compareOverloads(), 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::interp::Program::createGlobal(), clang::CodeGen::CodeGenModule::createOpenCLIntToSamplerConversion(), clang::CanQual< ObjCObjectType >::CreateUnsafe(), diagReturnOnAllocFailure(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), clang::TypePropertyCache< Private >::ensure(), evenFlexibleArraySize(), FindVA(), clang::ASTContext::getAlignOfGlobalVar(), GetAlignOfType(), clang::Type::getArrayElementTypeNoTypeQual(), clang::ASTContext::getCanonicalNestedNameSpecifier(), clang::ASTContext::getCanonicalParamType(), clang::ASTContext::getCanonicalType(), clang::CodeGen::CodeGenTypes::getCGRecordLayout(), getCurrentInstantiationOf(), clang::ASTContext::getDeclAlign(), clang::TypeName::getFullyQualifiedTemplateType(), clang::TypeName::getFullyQualifiedType(), clang::InjectedClassNameType::getInjectedTST(), getIntegerTypeForEnum(), clang::ASTContext::getLegacyIntegralTypeEncoding(), clang::interp::Program::getOrCreateRecord(), clang::getParameterABISpelling(), clang::Type::getPointeeOrArrayElementType(), clang::ASTContext::getPreferredTypeAlign(), clang::Type::getScalarTypeKind(), GetSignature(), llvm::simplify_type< ::clang::QualType >::getSimplifiedValue(), getTypeAlignIfRequired(), getTypeCodeForTypeClass(), getTypeForFormat(), clang::ASTContext::getTypeInfo(), clang::ASTContext::getTypeInfoInChars(), clang::LinkageComputer::getTypeLinkageAndVisibility(), clang::CanQual< ObjCObjectType >::getTypePtr(), clang::TypeLoc::getTypePtr(), clang::ASTContext::getTypeUnadjustedAlign(), clang::ASTContext::getUnqualifiedObjCPointerType(), getUuidAttrOfType(), clang::Type::hasAttr(), hasSameUnqualifiedPointeeType(), clang::ASTImporter::Import(), clang::Sema::inferGslPointerAttribute(), clang::ASTContext::isAlignmentRequired(), clang::CodeGen::CodeGenModule::isInSanitizerBlacklist(), clang::Type::isObjCARCImplicitlyUnretainedType(), isRecordWithSSEVectorType(), isSafeToConvert(), clang::ASTImporter::IsStructurallyEquivalent(), IsVoidStarType(), MarkUsedTemplateParameters(), clang::Sema::MaybeBindToTemporary(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), clang::StmtIteratorBase::NextVA(), ObjCBridgeRelatedAttrFromType(), clang::InitializationSequence::Perform(), printIntegral(), processTypeAttrs(), clang::CodeGen::CodeGenTypes::RefreshTypeCacheForClass(), clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition(), clang::Sema::setOpenCLExtensionForType(), clang::Sema::SubstExceptionSpec(), TryAddressSpaceCast(), TypeIsInnerPointer(), typeIsPostfix(), UnwrapTypeForDebugInfo(), and clang::CodeGen::CodeGenTypes::UpdateCompletedType().
|
inline |
Definition at line 6260 of file Type.h.
Referenced by clang::Sema::ActOnOpenMPDeclareSimdDirective(), clang::Sema::CheckOpenMPLinearDecl(), clang::CanQual< ObjCObjectType >::getTypePtrOrNull(), clang::ento::MemRegionManager::getVarRegion(), 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.
Definition at line 6336 of file Type.h.
Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::ActOnOpenMPAlignedClause(), clang::Sema::ActOnOpenMPLinearClause(), clang::Sema::ActOnOpenMPUseDevicePtrClause(), clang::Sema::ActOnStmtExprResult(), AdjustFunctionParmAndArgTypesForDeduction(), clang::Sema::BuildDeclarationNameExpr(), BuildImplicitBaseInitializer(), clang::Sema::CheckAllocatedType(), clang::Sema::CheckAssignmentOperands(), checkBlockPointerTypesForAssignment(), checkBuiltinArgument(), clang::Sema::CheckConditionalOperands(), checkConditionalPointerCompatibility(), clang::Sema::CheckGNUVectorConditionalTypes(), clang::Sema::CheckLiteralOperatorDeclaration(), clang::Sema::CheckNonTypeTemplateParameterType(), clang::Sema::CheckOpenMPLinearDecl(), clang::Sema::CheckSingleAssignmentConstraints(), checkTrivialSubobjectCall(), CompareDerivedToBaseConversions(), CompareStandardConversionSequences(), decomposeTypeForEH(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DiagnoseAssignmentResult(), DiagnoseBadFunctionCast(), DiagnoseCastOfObjCSEL(), DiagnoseFloatingImpCast(), clang::CodeGen::CodeGenFunction::EmitAndRegisterVariableArrayDimensions(), clang::CodeGen::CodeGenFunction::EmitObjCBoxedExpr(), emitRTtypeidCall(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), extractPBaseFlags(), FindConversionForRefInit(), FormatFunctionParameter(), clang::CodeGen::CodeGenFunction::generateObjCSetterBody(), clang::CodeGen::CodeGenModule::GenOpenCLArgMetadata(), getBadTypeidFn(), getCastAwayConstnessCastKind(), clang::ASTContext::getExceptionObjectType(), getIncrementedVar(), clang::ASTContext::getSignatureParameterType(), clang::CXXBaseSpecifier::getType(), clang::ASTContext::getUnqualifiedObjCPointerType(), clang::Sema::isInitListConstructor(), clang::CodeGen::CodeGenModule::isInSanitizerBlacklist(), isLayoutCompatible(), isOpenCLSizeDependentType(), isQualificationConversionStep(), IsStandardConversion(), IsVoidStarType(), maybeAdjustInterfaceForSubscriptingCheck(), clang::ASTContext::mergeFunctionTypes(), clang::ASTContext::mergeTypes(), OpenCLConvertScalarsToVectors(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformImplicitConversion(), clang::Sema::PerformMoveOrCopyInitialization(), print_elem(), clang::TreeTransform< Derived >::RebuildQualifiedType(), ResolveOverloadedFunctionForReferenceBinding(), rewriteToObjCProperty(), SemaOpenCLBuiltinEnqueueKernel(), TryLValueToRValueCast(), TryRefInitWithConversionFunction(), TryUserDefinedConversion(), and TypeIsInnerPointer().
|
inline |
Check if this type has any address space qualifier.
Definition at line 6372 of file Type.h.
Referenced by clang::Sema::deduceOpenCLAddressSpace(), clang::InitializationSequence::Perform(), and suppressReport().
|
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 766 of file Type.h.
Referenced by getTypeCodeForTypeClass(), and clang::QualifierCollector::strip().
|
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 756 of file Type.h.
Referenced by clang::ASTContext::getAsArrayType(), clang::ASTContext::getConstantArrayType(), clang::TypeName::getFullyQualifiedType(), clang::ASTContext::getIncompleteArrayType(), clang::ASTContext::getVariableArrayType(), clang::CanQual< ObjCObjectType >::hasQualifiers(), and clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc().
|
inline |
Definition at line 1084 of file Type.h.
References clang::Qualifiers::hasNonTrivialObjCLifetime().
Referenced by BuildImplicitMemberInitializer(), checkTrivialClassMembers(), EvaluateBinaryTypeTrait(), evaluateTypeTrait(), and getMaxAtomicAccessSize().
|
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 6398 of file Type.h.
Referenced by clang::Sema::CheckFunctionReturnType(), clang::Sema::CheckLValueToRValueConversionOperand(), clang::Sema::checkNonTrivialCUnion(), clang::Sema::checkNonTrivialCUnionInInitializer(), isNonWeakInMRRWithObjCWeak(), 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 6386 of file Type.h.
Referenced by clang::Sema::checkNonTrivialCUnion(), clang::Sema::checkNonTrivialCUnionInInitializer(), and isNonWeakInMRRWithObjCWeak().
|
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 6392 of file Type.h.
Referenced by clang::Sema::CheckFunctionReturnType(), clang::Sema::CheckLValueToRValueConversionOperand(), clang::Sema::checkNonTrivialCUnion(), isNonWeakInMRRWithObjCWeak(), and markEscapingByrefs().
|
inline |
Determine whether this type has any qualifiers.
Definition at line 6331 of file Type.h.
Referenced by AdjustFunctionParmAndArgTypesForDeduction(), clang::Sema::BuildAtomicType(), clang::Sema::BuildDeclarationNameExpr(), isStreamCharSpecialization(), clang::ASTContext::mergeFunctionTypes(), and TryUserDefinedConversion().
|
inline |
Definition at line 1088 of file Type.h.
References clang::Qualifiers::hasStrongOrWeakObjCLifetime().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXPseudoDestructorExpr().
|
inline |
Returns the specified type after dropping any outer-level parentheses.
Definition at line 973 of file Type.h.
Referenced by clang::Type::getLocallyUnqualifiedSingleStepDesugaredType().
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 6433 of file Type.h.
References getQualifiers(), and clang::Qualifiers::removeUnaligned().
Referenced by checkObjCPointerTypesForAssignment(), getCastAwayConstnessCastKind(), clang::CanQual< ObjCObjectType >::isAtLeastAsQualifiedAs(), TryClassUnification(), and TryObjectArgumentInitialization().
|
inline |
Definition at line 6300 of file Type.h.
Referenced by checkBlockPointerTypesForAssignment(), checkObjCPointerTypesForAssignment(), checkPointerTypesForAssignment(), clang::CanQual< ObjCObjectType >::CreateUnsafe(), DeduceTemplateArguments(), clang::CodeGen::CodeGenModule::GenOpenCLArgMetadata(), clang::ASTContext::getAtomicType(), clang::ASTContext::getBlockPointerType(), clang::ASTContext::getComplexType(), clang::ASTContext::getConstantArrayType(), 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::getSubstTemplateTypeParmType(), getTypeForFormat(), clang::ASTContext::getVariableArrayType(), clang::ASTContext::getVectorType(), isCanonicalExceptionSpecification(), isCanonicalResultType(), and isConstantEmittableObjectType().
|
inline |
Definition at line 6304 of file Type.h.
References clang::Type::hasSizedVLAType(), 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 6459 of file Type.h.
Referenced by CheckIndirectionOperand(), and clang::ento::ExprEngine::VisitArraySubscriptExpr().
|
inline |
Definition at line 789 of file Type.h.
Referenced by checkFormatStringExpr(), clang::CodeGen::CodeGenModule::isTypeConstant(), mayBeNotDynamicClass(), clang::CodeGen::registerTargetFirstprivateCopy(), reportOriginalDsa(), and clang::CodeGen::CGOpenMPRuntimeNVPTX::translateParameter().
|
inline |
Determine whether this type is const-qualified.
Definition at line 6315 of file Type.h.
Referenced by alignReferenceTypes(), clang::interp::ByteCodeExprGen< Emitter >::allocateLocal(), appendQualifier(), clang::Sema::BuildAtomicExpr(), BuildImplicitMemberInitializer(), buildSingleCopyAssign(), checkBuiltinArgument(), CheckForModifiableLvalue(), clang::interp::Program::createGlobal(), decomposeTypeForEH(), describeUninitializedArgumentInCall(), DiagnoseForRangeVariableCopies(), DiagnoseRecursiveConstFields(), enterBlockScope(), clang::ento::ExprEngine::evalCall(), evaluateLValueAsAllocSize(), EvaluateUnaryTypeTrait(), extractPBaseFlags(), extractSubobject(), findCompleteObject(), findSubobject(), clang::CodeGen::CodeGenModule::GenOpenCLArgMetadata(), getExistingLazyBinding(), clang::CodeGen::CodeGenModule::GetGlobalVarAddressSpace(), clang::interp::Program::getOrCreateRecord(), getSubobjectType(), clang::ento::MemRegionManager::getVarRegion(), handleAssignment(), handleCompoundAssignment(), clang::CodeGen::CodeGenModule::HandleCXXStaticMemberVarInstantiation(), clang::Sema::handlerCanCatch(), clang::RecordType::hasConstFields(), isPointerToConst(), isReferenceToNonConstCapture(), clang::CodeGen::CodeGenModule::isTypeConstant(), IsTypeModifiable(), isVoidPointerToNonConst(), LookThroughTransitiveAssignmentsAndCommaOperators(), clang::analyze_format_string::ArgType::matchesType(), mayBeNotDynamicClass(), tryCaptureAsConstant(), TryConstructorInitialization(), tryEmitARCRetainLoadOfScalar(), TryListConversion(), TryReferenceInit(), and clang::interp::ByteCodeExprGen< Emitter >::visitBool().
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 2484 of file Type.cpp.
References clang::Type::getAs(), clang::Type::getBaseElementTypeUnsafe(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Type::isScalarType(), and clang::Type::isVectorType().
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 2193 of file Type.cpp.
References clang::ASTContext::getBaseElementType(), clang::Type::getTypeClass(), and isCXX98PODType().
Referenced by isCXX98PODType(), 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 1174 of file Type.h.
Referenced by clang::Sema::ActOnCXXDelete(), clang::ASTContext::BlockRequiresCopying(), clang::Sema::CheckCompleteVariableDeclaration(), CheckLValueConstantExpression(), clang::Sema::checkVariadicArgument(), computeBlockInfo(), computeDestroyInfoForBlockCapture(), clang::CodeGen::CodeGenFunction::EmitCallArg(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), emitCXXDestructMethod(), clang::CodeGen::emitDeclareTargetVarDefinition(), clang::CodeGen::CodeGenFunction::EmitInitializerForField(), clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(), EmitMemberInitializer(), clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), enterBlockScope(), clang::CodeGen::CodeGenFunction::EnterDtorCleanups(), EvaluateUnaryTypeTrait(), HandleDestructionImpl(), isTrivialFiller(), clang::Sema::isValidVarArgType(), clang::VarDecl::needsDestruction(), clang::InitializationSequence::Perform(), 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 726 of file Type.h.
References clang::Qualifiers::Const.
Referenced by clang::CanQual< ObjCObjectType >::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 736 of file Type.h.
References clang::Qualifiers::Restrict.
Referenced by clang::CanQual< ObjCObjectType >::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 746 of file Type.h.
References clang::Qualifiers::Volatile.
Referenced by clang::CanQual< ObjCObjectType >::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 6423 of file Type.h.
References clang::Qualifiers::compatiblyIncludes(), and getQualifiers().
Referenced by buildDeclareReductionRef(), buildUserDefinedMapperRef(), CompareQualificationConversions(), CompareStandardConversionSequences(), 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 2361 of file Type.cpp.
References clang::Type::getBaseElementTypeUnsafe(), clang::Qualifiers::getObjCLifetime(), clang::Qualifiers::hasVolatile(), clang::Qualifiers::OCL_Strong, and clang::Qualifiers::OCL_Weak.
Referenced by computeBlockInfo(), computeCopyInfoForBlockCapture(), 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 2345 of file Type.cpp.
References clang::Type::getBaseElementTypeUnsafe(), clang::Qualifiers::OCL_Strong, and clang::Qualifiers::OCL_Weak.
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 2379 of file Type.cpp.
Referenced by clang::ASTContext::BlockRequiresCopying(), and clang::CopiedTypeVisitor< Derived, IsMove, RetTy >::visit().
bool QualType::isNonWeakInMRRWithObjCWeak | ( | const ASTContext & | Context | ) | const |
Definition at line 2326 of file Type.cpp.
References clang::ASTContext::getLangOpts(), hasNonTrivialToPrimitiveCopyCUnion(), clang::RecordDecl::hasNonTrivialToPrimitiveCopyCUnion(), hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::RecordDecl::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), hasNonTrivialToPrimitiveDestructCUnion(), clang::RecordDecl::hasNonTrivialToPrimitiveDestructCUnion(), and clang::Qualifiers::OCL_Weak.
|
inline |
Return true if this QualType doesn't point to a type yet.
Definition at line 719 of file Type.h.
Referenced by clang::Sema::ActOnClassMessage(), clang::Sema::ActOnClassPropertyRefExpr(), clang::Sema::ActOnCXXThis(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnTemplateTypeArgument(), clang::Sema::ActOnTypeRequirement(), AddClassMessageCompletions(), clang::Sema::AddFunctionCandidates(), clang::ODRHash::AddQualType(), clang::Sema::adjustCCAndNoReturn(), AdjustFunctionParmAndArgTypesForDeduction(), clang::TreeTransform< Derived >::AlreadyTransformed(), clang::TemplateSpecializationType::anyDependentTemplateArguments(), clang::ASTContext::areCommonBaseCompatible(), clang::ento::ProgramState::assumeInBound(), clang::ento::StoreManager::attemptDownCast(), clang::Sema::BuildClassMessageImplicit(), clang::Sema::BuildCXXTypeConstructExpr(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildDeclaratorGroup(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildObjCObjectType(), clang::Sema::BuildQualifiedType(), clang::Sema::BuildUnaryTransformType(), clang::arcmt::trans::canApplyWeak(), clang::Sema::canDelayFunctionBody(), clang::ento::StoreManager::CastRetrievedVal(), clang::Sema::CheckAdditionOperands(), checkAllAtProps(), checkArithmeticOrEnumeralCompare(), checkArithmeticOrEnumeralThreeWayCompare(), clang::Sema::CheckAssignmentOperands(), clang::Sema::CheckBitwiseOperands(), clang::Sema::CheckConditionalOperands(), checkConditionalPointerCompatibility(), clang::Sema::CheckDestructorAccess(), CheckIndirectionOperand(), clang::Sema::checkInitMethod(), CheckKeyForObjCARCConversion(), checkMapConflicts(), clang::Sema::CheckMultiplyDivideOperands(), clang::Sema::CheckNonDependentConversions(), clang::Sema::CheckPackExpansion(), clang::Sema::CheckRemainderOperands(), clang::comments::Sema::checkReturnsCommand(), clang::Sema::CheckSubtractionOperands(), clang::Sema::CheckTemplateArgument(), checkTupleLikeDecomposition(), clang::Sema::CheckTypenameType(), clang::Sema::checkUnsafeExprAssigns(), clang::Sema::CheckVectorCompareOperands(), clang::Sema::CheckVectorLogicalOperands(), checkWeakGCAttrs(), ClassifyImplicitMemberAccess(), clang::Sema::CodeCompleteQualifiedId(), clang::CodeGen::CGDebugInfo::completeUnusedClass(), clang::Sema::containsUnexpandedParameterPacks(), clang::Sema::CreateBuiltinBinOp(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), clang::CanQual< ObjCObjectType >::CreateUnsafe(), clang::Sema::CXXCheckConditionalOperands(), decomposeTypeForEH(), clang::Sema::DeduceAutoType(), clang::Sema::deduceClosureReturnType(), clang::DeducedType::DeducedType(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DeduceVariableDeclarationType(), clang::Sema::DefaultArgumentPromotion(), clang::Sema::DefaultFunctionArrayConversion(), clang::Sema::DefaultLvalueConversion(), determineEndOffset(), clang::ento::SMTConv::doIntTypeConversion(), clang::ento::SMTConv::doTypeConversion(), clang::TextNodeDumper::dumpBareType(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::emitDeclareSimdFunction(), clang::CodeGen::emitTaskInit(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), clang::PreferredTypeBuilder::enterTypeCast(), errorForGCAttrsOnNonObjC(), clang::ento::retaincountchecker::RetainCountChecker::evalCall(), clang::ento::ExprEngine::evalCall(), clang::ento::ExprEngine::evalLoad(), EvaluateAsRValue(), evaluateCDTSize(), FastEvaluateAsRValue(), clang::Sema::FindCompositePointerType(), FindDesignatorMismatch(), clang::Sema::FindInstantiatedDecl(), findOMPAllocatorHandleT(), FinishForRangeVarDecl(), clang::ento::SMTConv::fixAPSInt(), clang::index::generateUSRForType(), clang::ASTContext::getAutoDeductType(), clang::ASTContext::getAutoRRefDeductType(), clang::ASTContext::getAutoType(), clang::ASTContext::getCommentForDecl(), getCurrentInstantiationOf(), clang::Sema::getCurrentThisType(), GetDeclSpecTypeForDeclarator(), getDecltypeForExpr(), clang::getDeclUsageType(), clang::Sema::getElaboratedType(), clang::ento::StoreManager::GetElementZeroRegion(), clang::MemberExpr::getEndLoc(), getExistingLazyBinding(), clang::ClassTemplateDecl::getInjectedClassNameSpecialization(), clang::ASTContext::getInnerObjCOwnership(), clang::TypeLoc::getLocalAlignmentForType(), getMostInformativeDerivedClassImpl(), clang::Sema::getMostSpecialized(), clang::NSAPI::GetNSIntegralKind(), clang::ASTContext::getObjCClassRedefinitionType(), clang::ASTContext::getObjCIdRedefinitionType(), clang::ASTContext::getObjCSelRedefinitionType(), clang::Type::getObjCSubstitutions(), clang::CodeGen::CGDebugInfo::getOrCreateStandaloneType(), clang::ASTWriter::GetOrCreateTypeID(), clang::getParameterABISpelling(), getParamType(), getPrettyTypeName(), clang::ASTContext::getPromotedIntegerType(), getReturnTypeForMethod(), clang::CXXInstanceCall::getRuntimeDefinition(), clang::ObjCMethodCall::getRuntimeDefinition(), clang::ObjCObjectPointerType::getSuperClassType(), clang::ento::ProgramState::getSValAsScalarOrLoc(), clang::ASTContext::getTemplateSpecializationType(), clang::CodeGen::getTgtOffloadEntryQTy(), clang::ASTContext::getTypedefType(), clang::Sema::GetTypeFromParser(), clang::ASTWriter::getTypeID(), clang::ento::MemRegionManager::getVarRegion(), HandleAddressSpaceTypeAttribute(), handleAssignment(), HandleExtVectorTypeAttr(), clang::Sema::HandleFunctionTypeMismatch(), HandleVectorSizeAttr(), clang::Type::hasAttr(), clang::ASTNodeImporter::hasAutoReturnTypeDeclaredInside(), hasNonTrivialConstructorCall(), clang::ASTContext::hasUniqueObjectRepresentations(), clang::ASTImporter::Import(), isArithmeticArgumentPromotion(), isCharSpecialization(), isCharType(), clang::Sema::isCopyElisionCandidate(), clang::Declarator::isDeclarationOfFunction(), clang::DeclarationName::isDependentName(), clang::arcmt::trans::MigrationContext::isGCOwnedNonObjC(), clang::CodeGen::CodeGenModule::isInSanitizerBlacklist(), isLayoutCompatible(), clang::CanQual< ObjCObjectType >::isNull(), isObjCReceiverType(), isOSObjectRelated(), isOverflowingIntegerType(), isPointerToConst(), isPointerToObject(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::NSAPI::isSubclassOfNSClass(), clang::Sema::isThisOutsideMemberFunctionBody(), clang::ento::DynamicTypeInfo::isValid(), clang::ento::SymExpr::isValidTypeForSymbol(), isVoidPointer(), clang::ComparisonCategories::lookupInfoForType(), LookupMemberExpr(), lookupStdTypeTraitMember(), mangleAArch64VectorBase(), MarkUsedTemplateParameters(), maybeAdjustInterfaceForSubscriptingCheck(), MaybeElementDependentArrayFiller(), clang::ASTContext::mergeFunctionParameterTypes(), clang::ASTContext::mergeFunctionTypes(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTransparentUnionType(), clang::ASTContext::mergeTypes(), OpenCLCheckVectorConditional(), OpenCLConvertScalarsToVectors(), clang::Sema::PerformContextualImplicitConversion(), clang::Sema::PerformImplicitConversion(), PrintFloatingLiteral(), clang::APValue::printPretty(), clang::ento::ExprEngine::processCallExit(), clang::ASTRecordReader::readTypeSourceInfo(), clang::TreeTransform< Derived >::RebuildQualifiedType(), clang::TreeTransform< Derived >::RebuildUnresolvedUsingType(), recordFixedType(), ResolveOverloadForDeduction(), rewriteToNSMacroDecl(), roundUpSizeToCharAlignment(), clang::Sema::SelectorsForTypoCorrection(), clang::InitializationSequence::SetFailed(), clang::Expr::setType(), clang::ObjCObjectPointerType::stripObjCKindOfTypeAndQuals(), clang::Sema::SubstExceptionSpec(), clang::Sema::SubstFunctionDeclType(), clang::Sema::SubstType(), takeDeclAttributes(), clang::TreeTransform< Derived >::TransformCXXNamedCastExpr(), clang::TreeTransform< Derived >::TransformDependentTemplateSpecializationType(), clang::TreeTransform< Derived >::TransformExceptionSpec(), clang::TreeTransform< Derived >::TransformFunctionProtoType(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), clang::TreeTransform< Derived >::TransformFunctionTypeParams(), clang::TreeTransform< Derived >::TransformOverloadExprDecls(), clang::TreeTransform< Derived >::TransformReferenceType(), clang::TreeTransform< Derived >::TransformTemplateSpecializationType(), clang::TreeTransform< Derived >::TransformType(), clang::TransformTypeSpecType(), clang::TreeTransform< Derived >::TransformTypeWithDeducedTST(), clang::RecursiveASTVisitor< CallGraph >::TraverseType(), clang::Sema::tryCaptureOpenMPLambdas(), TryDeconstructFunctionLike(), clang::Sema::tryExprAsCall(), TryListConversion(), tryRearrange(), TryReinterpretCast(), clang::Sema::tryToRecoverWithCall(), clang::ASTContext::typesAreBlockPointerCompatible(), clang::ASTContext::typesAreCompatible(), UnwrapTypeForDebugInfo(), clang::Sema::UsualUnaryConversions(), clang::FunctionCallFilterCCC::ValidateCandidate(), clang::JSONNodeDumper::Visit(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::ASTDeclReader::VisitDeclaratorDecl().
|
inline |
true when Type is objc's strong.
Definition at line 1075 of file Type.h.
References clang::Qualifiers::Strong.
Referenced by GetGCAttrTypeForType().
|
inline |
true when Type is objc's weak.
Definition at line 1070 of file Type.h.
References clang::Qualifiers::Weak.
Referenced by computeCopyInfoForBlockCapture(), computeDestroyInfoForBlockCapture(), 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 2185 of file Type.cpp.
References clang::ASTContext::getLangOpts().
Referenced by clang::Sema::DiagnoseSizeOfParametersAndReturnValue(), clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), EmitMemberInitializer(), EvaluateUnaryTypeTrait(), and isTrivialFiller().
|
inline |
Determine whether this type is restrict-qualified.
Definition at line 6320 of file Type.h.
Referenced by appendQualifier(), extractPBaseFlags(), and clang::CodeGen::CodeGenModule::GenOpenCLArgMetadata().
bool QualType::isTriviallyCopyableType | ( | const ASTContext & | Context | ) | const |
Return true if this is a trivially copyable type (C++0x [basic.types]p9)
Definition at line 2289 of file Type.cpp.
References clang::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Type::isScalarType(), isTriviallyCopyableType(), and clang::Type::isVectorType().
Referenced by clang::Sema::BuildAtomicExpr(), clang::Sema::BuildAtomicType(), buildSingleCopyAssign(), checkTypeMappable(), createObjCPropertyGetter(), DiagnoseBadFunctionCast(), DiagnoseForRangeConstVariableCopies(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), EvaluateUnaryTypeTrait(), getAlignmentArgument(), clang::ASTContext::hasUniqueObjectRepresentations(), isTrivialFiller(), isTriviallyCopyableType(), and clang::Sema::PerformMoveOrCopyInitialization().
bool QualType::isTrivialType | ( | const ASTContext & | Context | ) | const |
Return true if this is a trivial type per (C++0x [basic.types]p9)
Definition at line 2241 of file Type.cpp.
References clang::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::Type::isDependentType(), clang::Type::isScalarType(), isTrivialType(), and clang::Type::isVectorType().
Referenced by EvaluateUnaryTypeTrait(), and isTrivialType().
|
inline |
Determine whether this type is volatile-qualified.
Definition at line 6326 of file Type.h.
Referenced by appendQualifier(), buildSingleCopyAssign(), clang::Sema::CheckFunctionReturnType(), CheckIdentityFieldAssignment(), clang::Sema::CheckLValueToRValueConversionOperand(), clang::Sema::CheckUnusedVolatileAssignment(), decomposeTypeForEH(), DiagnoseSelfAssignment(), clang::CodeGen::CodeGenFunction::EmitAlignmentAssumptionCheck(), clang::CodeGen::CodeGenFunction::EmitCallAndReturnForThunk(), EmitCheckedMixedSignMultiply(), clang::CodeGen::CodeGenFunction::EmitOMPAtomicSimpleUpdateExpr(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), EvaluateUnaryTypeTrait(), extractPBaseFlags(), findCompleteObject(), findPeephole(), findSubobject(), clang::CodeGen::CodeGenModule::GenOpenCLArgMetadata(), getBlockCaptureStr(), getFieldSize(), getSubobjectType(), handleLValueToRValueConversion(), clang::Sema::handlerCanCatch(), clang::Sema::IgnoredValueConversions(), clang::CodeGen::CodeGenFunction::isTrivialInitializer(), clang::Expr::isUnusedResultAWarning(), LookThroughTransitiveAssignmentsAndCommaOperators(), tryEmitARCRetainLoadOfScalar(), TryListConversion(), and TryReferenceInit().
bool QualType::mayBeDynamicClass | ( | ) | const |
Returns true if it is a class and it might be dynamic.
Definition at line 92 of file Type.cpp.
Referenced by GetIntrinsic(), and clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue().
bool QualType::mayBeNotDynamicClass | ( | ) | const |
Returns true if it is not a class or if the class might not be dynamic.
Definition at line 97 of file Type.cpp.
References getAddressSpace(), clang::ASTContext::getAsArrayType(), isConstant(), isConstQualified(), and clang::opencl_constant.
Referenced by clang::CodeGen::CodeGenFunction::ShouldNullCheckClassCastValue().
void QualType::print | ( | raw_ostream & | OS, |
const PrintingPolicy & | Policy, | ||
const Twine & | PlaceHolder = Twine() , |
||
unsigned | Indentation = 0 |
||
) | const |
Definition at line 1894 of file TypePrinter.cpp.
Referenced by getExpressionTraitName(), getReturnTypeForMethod(), isImplicitThis(), clang::TypeInfoLValue::print(), clang::NestedNameSpecifier::print(), clang::TemplateArgument::print(), print_elem(), printCXXConstructorDestructorName(), and PrintFloatingLiteral().
|
inlinestatic |
Definition at line 1004 of file Type.h.
References print(), clang::SplitQualType::Quals, and clang::SplitQualType::Ty.
|
static |
Definition at line 1900 of file TypePrinter.cpp.
|
inline |
Definition at line 1056 of file Type.h.
Referenced by clang::ento::CompoundValData::Profile(), clang::ParenType::Profile(), and clang::ElaboratedType::Profile().
|
inline |
Definition at line 6350 of file Type.h.
References clang::Qualifiers::Const.
Referenced by DiagnoseForRangeReferenceVariableCopies(), and findSubobject().
|
inline |
Definition at line 6362 of file Type.h.
References clang::Qualifiers::CVRMask, and clang::Qualifiers::FastMask.
Referenced by adjustCVQualifiersForCXXThisWithinLambda(), and clang::Sema::CheckCXXThisCapture().
|
inline |
Definition at line 861 of file Type.h.
Referenced by withoutLocalFastQualifiers().
|
inline |
Definition at line 862 of file Type.h.
References clang::Qualifiers::FastMask.
|
inline |
Definition at line 6354 of file Type.h.
References clang::Qualifiers::Restrict.
|
inline |
Definition at line 6358 of file Type.h.
References clang::Qualifiers::Volatile.
Referenced by findSubobject().
|
inline |
|
inline |
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition at line 6264 of file Type.h.
References clang::Qualifiers::addFastQualifiers(), clang::Qualifiers::fromFastMask(), clang::ExtQuals::getBaseType(), and clang::ExtQuals::getQualifiers().
Referenced by clang::ODRHash::AddQualType(), clang::TextNodeDumper::dumpBareType(), clang::Type::getArrayElementTypeNoTypeQual(), clang::ASTContext::getASTObjCImplementationLayout(), clang::Type::getLocallyUnqualifiedSingleStepDesugaredType(), handleObjCOwnershipTypeAttr(), isTypeSubstitutable(), mangleAArch64VectorBase(), clang::CanQual< ObjCObjectType >::split(), splitAccordingToPolicy(), clang::ObjCObjectType::stripObjCKindOfTypeAndQuals(), clang::ObjCObjectPointerType::stripObjCKindOfTypeAndQuals(), clang::ASTNodeTraverser< ASTDumper, TextNodeDumper >::Visit(), clang::TextNodeDumper::Visit(), clang::JSONNodeDumper::Visit(), and clang::TextNodeDumper::VisitFunctionDecl().
|
inline |
Definition at line 1046 of file Type.h.
References dump().
Referenced by clang::APValue::printPretty().
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 1422 of file Type.cpp.
References clang::Type::getObjCSubstitutions(), and clang::DeclContext::getParentASTContext().
Referenced by clang::ObjCMethodDecl::getSendResultType(), clang::ObjCPropertyDecl::getUsageType(), clang::ObjCIvarDecl::getUsageType(), and LookupMethodInReceiverType().
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 1415 of file Type.cpp.
Referenced by clang::ObjCObjectType::computeSuperClassTypeSlow(), clang::CodeCompletionResult::createCodeCompletionStringForDecl(), formatBlockPlaceholder(), FormatFunctionParameter(), and getReturnTypeForMethod().
|
inline |
Definition at line 826 of file Type.h.
References clang::Qualifiers::Const.
Referenced by clang::Sema::ActOnForEachDeclStmt(), DiagnoseForRangeReferenceVariableCopies(), diagnoseListInit(), emitTaskPrivateMappingFunction(), clang::ASTContext::getConstType(), clang::ASTContext::getStringLiteralArrayType(), and clang::CanQual< ObjCObjectType >::withConst().
|
inline |
Definition at line 846 of file Type.h.
Referenced by checkConditionalPointerCompatibility(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset(), and GeneralizeType().
|
inline |
Definition at line 877 of file Type.h.
References withFastQualifiers().
|
inline |
Definition at line 869 of file Type.h.
References addFastQualifiers().
Referenced by clang::QualifierCollector::apply(), getCanonicalType(), clang::ASTContext::getQualifiedType(), clang::ASTContext::getRestrictType(), clang::ASTContext::getVolatileType(), and withExactLocalFastQualifiers().
|
inline |
Definition at line 882 of file Type.h.
References removeLocalFastQualifiers().
Referenced by getCoreType().
|
inline |
Definition at line 842 of file Type.h.
References clang::Qualifiers::Restrict.
Referenced by emitCombinerOrInitializer(), emitDestructorsFunction(), emitProxyTaskFunction(), emitTaskPrivateMappingFunction(), and clang::CodeGen::emitUserDefinedMapper().
|
inline |
Definition at line 834 of file Type.h.
References clang::Qualifiers::Volatile.
Referenced by callSpecialFunction(), getFieldSize(), and getSpecialFunction().
|
friend |