|
clang 24.0.0git
|
The collection of all-type qualifiers we support. More...
#include "clang/AST/TypeBase.h"
Public Types | |
| enum | TQ : uint64_t { Const = 0x1 , Restrict = 0x2 , Volatile = 0x4 , CVRMask = Const | Volatile | Restrict } |
| enum | GC { GCNone = 0 , Weak , Strong } |
| enum | ObjCLifetime { OCL_None , OCL_ExplicitNone , OCL_Strong , OCL_Weak , OCL_Autoreleasing } |
| enum | : uint64_t { MaxAddressSpace = 0x7fffffu , FastWidth = 3 , FastMask = (1 << FastWidth) - 1 } |
Public Member Functions | |
| Qualifiers ()=default | |
| uint64_t | getAsOpaqueValue () const |
| bool | hasConst () const |
| bool | hasOnlyConst () const |
| void | removeConst () |
| void | addConst () |
| Qualifiers | withConst () const |
| bool | hasVolatile () const |
| bool | hasOnlyVolatile () const |
| void | removeVolatile () |
| void | addVolatile () |
| Qualifiers | withVolatile () const |
| bool | hasRestrict () const |
| bool | hasOnlyRestrict () const |
| void | removeRestrict () |
| void | addRestrict () |
| Qualifiers | withRestrict () const |
| bool | hasCVRQualifiers () const |
| unsigned | getCVRQualifiers () const |
| unsigned | getCVRUQualifiers () const |
| void | setCVRQualifiers (unsigned mask) |
| void | removeCVRQualifiers (unsigned mask) |
| void | removeCVRQualifiers () |
| void | addCVRQualifiers (unsigned mask) |
| void | addCVRUQualifiers (unsigned mask) |
| bool | hasUnaligned () const |
| void | setUnaligned (bool flag) |
| void | removeUnaligned () |
| void | addUnaligned () |
| bool | hasObjCGCAttr () const |
| GC | getObjCGCAttr () const |
| void | setObjCGCAttr (GC type) |
| void | removeObjCGCAttr () |
| void | addObjCGCAttr (GC type) |
| Qualifiers | withoutObjCGCAttr () const |
| Qualifiers | withoutObjCLifetime () const |
| Qualifiers | withoutAddressSpace () const |
| bool | hasObjCLifetime () const |
| ObjCLifetime | getObjCLifetime () const |
| void | setObjCLifetime (ObjCLifetime type) |
| void | removeObjCLifetime () |
| void | addObjCLifetime (ObjCLifetime type) |
| bool | hasNonTrivialObjCLifetime () const |
| True if the lifetime is neither None or ExplicitNone. | |
| bool | hasStrongOrWeakObjCLifetime () const |
| True if the lifetime is either strong or weak. | |
| bool | hasAddressSpace () const |
| LangAS | getAddressSpace () const |
| bool | hasTargetSpecificAddressSpace () const |
| unsigned | getAddressSpaceAttributePrintValue () const |
| Get the address space attribute value to be printed by diagnostics. | |
| void | setAddressSpace (LangAS space) |
| void | removeAddressSpace () |
| void | addAddressSpace (LangAS space) |
| bool | hasPointerAuth () const |
| PointerAuthQualifier | getPointerAuth () const |
| void | setPointerAuth (PointerAuthQualifier Q) |
| void | removePointerAuth () |
| void | addPointerAuth (PointerAuthQualifier Q) |
| bool | hasFastQualifiers () const |
| unsigned | getFastQualifiers () const |
| void | setFastQualifiers (unsigned mask) |
| void | removeFastQualifiers (unsigned mask) |
| void | removeFastQualifiers () |
| void | addFastQualifiers (unsigned mask) |
| bool | hasNonFastQualifiers () const |
| Return true if the set contains any qualifiers which require an ExtQuals node to be allocated. | |
| Qualifiers | getNonFastQualifiers () const |
| bool | hasQualifiers () const |
| Return true if the set contains any qualifiers. | |
| bool | empty () const |
| void | addQualifiers (Qualifiers Q) |
| Add the qualifiers from the given set to this set. | |
| void | removeQualifiers (Qualifiers Q) |
| Remove the qualifiers from the given set from this set. | |
| void | addConsistentQualifiers (Qualifiers qs) |
| Add the qualifiers from the given set to this set, given that they don't conflict. | |
| bool | isAddressSpaceSupersetOf (Qualifiers other, const ASTContext &Ctx) const |
| Returns true if the address space in these qualifiers is equal to or a superset of the address space in the argument qualifiers. | |
| bool | compatiblyIncludes (Qualifiers other, const ASTContext &Ctx) const |
| Determines if these qualifiers compatibly include another set. | |
| bool | compatiblyIncludesObjCLifetime (Qualifiers other) const |
| Determines if these qualifiers compatibly include another set of qualifiers from the narrow perspective of Objective-C ARC lifetime. | |
| bool | isStrictSupersetOf (Qualifiers Other) const |
| Determine whether this set of qualifiers is a strict superset of another set of qualifiers, not considering qualifier compatibility. | |
| bool | operator== (Qualifiers Other) const |
| bool | operator!= (Qualifiers Other) const |
| operator bool () const | |
| Qualifiers & | operator+= (Qualifiers R) |
| Qualifiers & | operator-= (Qualifiers R) |
| std::string | getAsString () const |
| std::string | getAsString (const PrintingPolicy &Policy) const |
| bool | isEmptyWhenPrinted (const PrintingPolicy &Policy) const |
| void | print (raw_ostream &OS, const PrintingPolicy &Policy, bool appendSpaceIfNonEmpty=false) const |
| void | Profile (llvm::FoldingSetNodeID &ID) const |
Static Public Member Functions | |
| static Qualifiers | removeCommonQualifiers (Qualifiers &L, Qualifiers &R) |
| Returns the common set of qualifiers while removing them from the given sets. | |
| static Qualifiers | fromFastMask (unsigned Mask) |
| static Qualifiers | fromCVRMask (unsigned CVR) |
| static Qualifiers | fromCVRUMask (unsigned CVRU) |
| static Qualifiers | fromOpaqueValue (uint64_t opaque) |
| static bool | isAddressSpaceSupersetOf (LangAS A, LangAS B, const ASTContext &Ctx) |
| Returns true if address space A is equal to or a superset of B. | |
| static bool | isTargetAddressSpaceSupersetOf (LangAS A, LangAS B, const ASTContext &Ctx) |
| static std::string | getAddrSpaceAsString (LangAS AS) |
Friends | |
| Qualifiers | operator+ (Qualifiers L, Qualifiers R) |
| Qualifiers | operator- (Qualifiers L, Qualifiers R) |
| Compute the difference between two qualifier sets. | |
The collection of all-type qualifiers we support.
Clang supports five independent qualifiers:
Definition at line 332 of file TypeBase.h.
| anonymous enum : uint64_t |
| Enumerator | |
|---|---|
| MaxAddressSpace | The maximum supported address space number. 23 bits should be enough for anyone. |
| FastWidth | The width of the "fast" qualifier mask. |
| FastMask | The fast qualifier mask. |
Definition at line 371 of file TypeBase.h.
| Enumerator | |
|---|---|
| GCNone | |
| Weak | |
| Strong | |
Definition at line 343 of file TypeBase.h.
| Enumerator | |
|---|---|
| OCL_None | There is no lifetime qualification on this type. |
| OCL_ExplicitNone | This object can be modified without requiring retains or releases. |
| OCL_Strong | Assigning into this object requires the old value to be released and the new value to be retained. The timing of the release of the old value is inexact: it may be moved to immediately after the last known point where the value is live. |
| OCL_Weak | Reading or writing from this object requires a barrier call. |
| OCL_Autoreleasing | Assigning into this object requires a lifetime extension. |
Definition at line 349 of file TypeBase.h.
| enum clang::Qualifiers::TQ : uint64_t |
| Enumerator | |
|---|---|
| Const | |
| Restrict | |
| Volatile | |
| CVRMask | |
Definition at line 335 of file TypeBase.h.
|
default |
Referenced by addConsistentQualifiers(), addQualifiers(), compatiblyIncludes(), compatiblyIncludesObjCLifetime(), fromCVRMask(), fromCVRUMask(), fromFastMask(), fromOpaqueValue(), getNonFastQualifiers(), isAddressSpaceSupersetOf(), isStrictSupersetOf(), operator!=(), operator+, operator+=(), operator-, operator-=(), operator==(), clang::QualifierCollector::QualifierCollector(), removeCommonQualifiers(), removeQualifiers(), withConst(), withoutAddressSpace(), withoutObjCGCAttr(), withoutObjCLifetime(), withRestrict(), and withVolatile().
|
inline |
Definition at line 598 of file TypeBase.h.
References clang::Default, and setAddressSpace().
Referenced by addQualifiers(), clang::ASTContext::getAddrSpaceQualType(), getDummyLambdaType(), GetFullTypeForDeclarator(), and TryReferenceInitializationCore().
|
inline |
Add the qualifiers from the given set to this set, given that they don't conflict.
Definition at line 690 of file TypeBase.h.
References getAddressSpace(), getObjCGCAttr(), getObjCLifetime(), getPointerAuth(), hasAddressSpace(), hasObjCGCAttr(), hasObjCLifetime(), hasPointerAuth(), and Qualifiers().
Referenced by clang::ASTContext::getBaseElementType(), clang::SplitQualType::getSingleStepDesugaredType(), clang::ASTContext::getUnqualifiedArrayType(), clang::QualifierCollector::strip(), and unwrapSugar().
|
inline |
Definition at line 461 of file TypeBase.h.
References Const.
Referenced by addBlockPointerConversion(), addFunctionPointerConversion(), clang::Sema::CheckExplicitlyDefaultedComparison(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckFunctionTemplateSpecialization(), getDummyLambdaType(), TryObjectArgumentInitialization(), and withConst().
|
inline |
Definition at line 503 of file TypeBase.h.
References CVRMask.
Referenced by clang::CodeGen::CGHLSLRuntime::emitBufferMemberExpr(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CIRGen::CIRGenFunction::emitLValueForField(), fromCVRMask(), and removeCommonQualifiers().
|
inline |
Definition at line 507 of file TypeBase.h.
References CVRMask.
Referenced by fromCVRUMask(), and GetFullTypeForDeclarator().
|
inline |
Definition at line 632 of file TypeBase.h.
References FastMask.
Referenced by fromFastMask(), clang::QualType::getLocalQualifiers(), clang::QualType::getQualifiers(), clang::QualType::split(), and clang::QualifierCollector::strip().
|
inline |
Definition at line 525 of file TypeBase.h.
References setObjCGCAttr(), and clang::ast_matchers::type.
Referenced by addQualifiers(), and clang::ASTContext::getObjCGCQualType().
|
inline |
Definition at line 553 of file TypeBase.h.
References hasObjCLifetime(), and clang::ast_matchers::type.
Referenced by clang::SemaObjC::ActOnPropertyImplDecl(), addQualifiers(), clang::ASTContext::getLifetimeQualifiedType(), handleObjCOwnershipTypeAttr(), inferARCLifetimeForPointee(), inferARCWriteback(), and transferARCOwnershipToDeclSpec().
|
inline |
Definition at line 612 of file TypeBase.h.
References clang::PointerAuthQualifier::isPresent(), and setPointerAuth().
Referenced by addQualifiers().
|
inline |
Add the qualifiers from the given set to this set.
Definition at line 651 of file TypeBase.h.
References addAddressSpace(), addObjCGCAttr(), addObjCLifetime(), addPointerAuth(), CVRMask, getAddressSpace(), getObjCGCAttr(), getObjCLifetime(), getPointerAuth(), hasAddressSpace(), hasObjCGCAttr(), hasObjCLifetime(), hasPointerAuth(), and Qualifiers().
Referenced by clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), clang::CIRGen::CIRGenFunction::emitUnaryOpLValue(), and operator+=().
|
inline |
Definition at line 481 of file TypeBase.h.
References Restrict.
Referenced by CollectVRQualifiers(), clang::CodeGen::CGOpenMPRuntimeGPU::translateParameter(), and withRestrict().
|
inline |
Definition at line 517 of file TypeBase.h.
|
inline |
Definition at line 471 of file TypeBase.h.
References Volatile.
Referenced by CollectVRQualifiers(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CIRGen::CIRGenFunction::emitLValueForField(), TryObjectArgumentInitialization(), and withVolatile().
|
inline |
Determines if these qualifiers compatibly include another set.
Generally this answers the question of whether an object with the other qualifiers can be safely used as an object with these qualifiers.
Definition at line 728 of file TypeBase.h.
References CVRMask, getObjCGCAttr(), getObjCLifetime(), getPointerAuth(), hasObjCGCAttr(), hasUnaligned(), isAddressSpaceSupersetOf(), and Qualifiers().
Referenced by AdoptQualifiers(), CheckOriginalCallArgDeduction(), checkPointerTypesForAssignment(), compareOverloads(), DeduceTemplateArgumentsByTypeMatch(), emitBadConversionNotes(), clang::Sema::handlerCanCatch(), clang::QualType::isMoreQualifiedThan(), clang::SemaObjC::isObjCWritebackConversion(), isQualificationConversionStep(), TryReferenceInit(), and TryStaticCast().
|
inline |
Determines if these qualifiers compatibly include another set of qualifiers from the narrow perspective of Objective-C ARC lifetime.
One set of Objective-C lifetime qualifiers compatibly includes the other if the lifetime qualifiers match, or if both are non-__weak and the including set also contains the 'const' qualifier, or both are non-__weak and one is None (which can only happen in non-ARC modes).
Definition at line 751 of file TypeBase.h.
References getObjCLifetime(), hasConst(), OCL_None, OCL_Weak, and Qualifiers().
Referenced by CastsAwayConstness(), checkPointerTypesForAssignment(), and isQualificationConversionStep().
|
inline |
Definition at line 648 of file TypeBase.h.
Referenced by clang::SemaObjC::actOnObjCTypeParam(), clang::Sema::CheckMain(), checkQualifiedFunction(), clang::Sema::CheckQualifiedFunctionForTypeId(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getUnqualifiedArrayType(), clang::Expr::isNullPointerConstant(), clang::SemaObjC::isObjCWritebackConversion(), clang::isValidSwiftErrorResultType(), clang::TreeTransform< Derived >::TransformNestedNameSpecifierLoc(), and TypeInfoIsInStandardLibrary().
|
inlinestatic |
Definition at line 436 of file TypeBase.h.
References addCVRQualifiers(), and Qualifiers().
Referenced by clang::Sema::BuildQualifiedType(), CastsAwayConstness(), clang::InitializationSequence::Diagnose(), clang::ASTContext::getCVRQualifiedType(), clang::ArrayType::getIndexTypeQualifiers(), and clang::TreeTransform< Derived >::RebuildQualifiedType().
|
inlinestatic |
Definition at line 442 of file TypeBase.h.
References addCVRUQualifiers(), and Qualifiers().
Referenced by clang::Sema::FindCompositePointerType().
|
inlinestatic |
Definition at line 430 of file TypeBase.h.
References addFastQualifiers(), and Qualifiers().
Referenced by clang::FunctionType::getFastTypeQuals(), and clang::QualType::split().
|
inlinestatic |
Definition at line 449 of file TypeBase.h.
References Qualifiers().
Referenced by clang::FormatASTNodeDiagnosticArgument(), clang::ASTRecordReader::readQualifiers(), and clang::serialization::DataStreamBasicReader< Impl >::readQualifiers().
|
inline |
Definition at line 572 of file TypeBase.h.
Referenced by addConsistentQualifiers(), addQualifiers(), clang::SemaCUDA::checkAllowedInitializer(), checkConditionalPointerCompatibility(), clang::Sema::CheckExplicitlyDefaultedSpecialMember(), checkPointerTypesForAssignment(), clang::CodeGen::CodeGenTypes::DeriveThisType(), clang::CIRGen::CIRGenTypes::deriveThisType(), clang::Sema::DiagnoseAssignmentResult(), DiagnoseBadConversion(), clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), EmitDeclDestroy(), clang::Sema::FindCompositePointerType(), getAddressSpaceAttributePrintValue(), hasInconsistentOrSupersetQualifiersOf(), hasTargetSpecificAddressSpace(), isAddressSpaceSupersetOf(), isEmptyWhenPrinted(), IsModifiable(), isQualificationConversionStep(), isStrictSupersetOf(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), print(), clang::TreeTransform< Derived >::RebuildQualifiedType(), removeCommonQualifiers(), removeQualifiers(), ResolveConstructorOverload(), TryReferenceInitializationCore(), and TryUserDefinedConversion().
|
inline |
Get the address space attribute value to be printed by diagnostics.
Definition at line 579 of file TypeBase.h.
References clang::Addr, clang::Default, getAddressSpace(), hasTargetSpecificAddressSpace(), and clang::toTargetAddressSpace().
|
static |
Definition at line 2718 of file TypePrinter.cpp.
References clang::cuda_constant, clang::cuda_device, clang::cuda_shared, clang::Default, clang::hlsl_constant, clang::hlsl_device, clang::hlsl_groupshared, clang::hlsl_input, clang::hlsl_output, clang::hlsl_private, clang::hlsl_push_constant, clang::opencl_constant, clang::opencl_generic, clang::opencl_global, clang::opencl_global_device, clang::opencl_global_host, clang::opencl_local, clang::opencl_private, clang::ptr32_sptr, clang::ptr32_uptr, clang::ptr64, clang::sycl_global, clang::sycl_global_device, clang::sycl_global_host, clang::sycl_local, clang::sycl_private, clang::toTargetAddressSpace(), and clang::wasm_funcref.
Referenced by clang::Sema::ActOnCXXDelete(), clang::Sema::CheckAllocatedType(), clang::FormatASTNodeDiagnosticArgument(), and print().
|
inline |
| std::string Qualifiers::getAsString | ( | ) | const |
Definition at line 2682 of file TypePrinter.cpp.
References clang::getAsString().
Referenced by clang::SemaObjC::actOnObjCTypeParam(), clang::applyObjCTypeArgs(), clang::Sema::BuildCallToMemberFunction(), DeclTypeToString(), fixParamWithSpan(), clang::FormatASTNodeDiagnosticArgument(), getFunctionQualifiersAsString(), and clang::JSONNodeDumper::VisitArrayType().
| std::string Qualifiers::getAsString | ( | const PrintingPolicy & | Policy | ) | const |
Definition at line 2690 of file TypePrinter.cpp.
References print().
|
inline |
Definition at line 489 of file TypeBase.h.
References CVRMask.
Referenced by CastsAwayConstness(), checkConditionalPointerCompatibility(), DeduceTemplateArgumentsByTypeMatch(), clang::InitializationSequence::Diagnose(), DiagnoseBadConversion(), clang::CIRGen::CIRGenFunction::emitExtVectorElementExpr(), clang::CodeGen::CodeGenFunction::EmitObjCIvarRefLValue(), hasCVRQualifiers(), hasInconsistentOrSupersetQualifiersOf(), hasMangledSubstitutionQualifiers(), isEmptyWhenPrinted(), isQualificationConversionStep(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), clang::Sema::PerformImplicitObjectArgumentInitialization(), print(), removeCommonQualifiers(), and TryReferenceInitializationCore().
|
inline |
Definition at line 490 of file TypeBase.h.
References CVRMask.
Referenced by clang::Sema::FindCompositePointerType().
|
inline |
Definition at line 620 of file TypeBase.h.
References FastMask.
Referenced by clang::QualifierCollector::apply(), clang::QualifierCollector::apply(), clang::ASTContext::getQualifiedType(), clang::ASTContext::getQualifiedType(), hasFastQualifiers(), and clang::ASTContext::removeAddrSpaceQualType().
|
inline |
Definition at line 640 of file TypeBase.h.
References Qualifiers(), and setFastQualifiers().
|
inline |
Definition at line 520 of file TypeBase.h.
Referenced by addConsistentQualifiers(), addQualifiers(), compatiblyIncludes(), DiagnoseBadConversion(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CIRGen::CIRGenFunction::emitLValueForField(), clang::Sema::FindCompositePointerType(), hasInconsistentOrSupersetQualifiersOf(), isEmptyWhenPrinted(), isQualificationConversionStep(), isStrictSupersetOf(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), print(), removeCommonQualifiers(), and removeQualifiers().
|
inline |
Definition at line 546 of file TypeBase.h.
Referenced by clang::Sema::ActOnFields(), addConsistentQualifiers(), addQualifiers(), clang::ASTContext::BlockRequiresCopying(), CheckOriginalCallArgDeduction(), checkPointerTypesForAssignment(), compatiblyIncludes(), compatiblyIncludesObjCLifetime(), computeCopyInfoForBlockCapture(), clang::Sema::DiagnoseAssignmentResult(), DiagnoseBadConversion(), clang::CodeGen::CGObjCRuntime::EmitInitOfCatchParam(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::Sema::FindCompositePointerType(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::QualType::getObjCLifetime(), clang::SemaObjC::handleExternallyRetainedAttr(), hasInconsistentOrSupersetQualifiersOf(), hasNonTrivialObjCLifetime(), hasStrongOrWeakObjCLifetime(), InitCatchParam(), initCatchParam(), isEmptyWhenPrinted(), isNonTrivialObjCLifetimeConversion(), clang::QualType::isNonTrivialToPrimitiveCopy(), clang::SemaObjC::isObjCWritebackConversion(), isQualificationConversionStep(), isStrictSupersetOf(), clang::ASTContext::mergeTypes(), print(), removeCommonQualifiers(), removeQualifiers(), clang::tryMakeVariablePseudoStrong(), and TryReferenceInitializationCore().
|
inline |
Definition at line 604 of file TypeBase.h.
References clang::PointerAuthQualifier::fromOpaqueValue().
Referenced by addConsistentQualifiers(), addQualifiers(), checkConditionalPointerCompatibility(), checkPointerTypesForAssignment(), compatiblyIncludes(), clang::Sema::DiagnoseAssignmentResult(), DiagnoseBadConversion(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitScalarInit(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::Sema::FindCompositePointerType(), clang::QualType::getPointerAuth(), isEmptyWhenPrinted(), isQualificationConversionStep(), clang::ASTContext::mergeTypes(), print(), clang::TreeTransform< Derived >::RebuildQualifiedType(), removeCommonQualifiers(), and removeQualifiers().
|
inline |
Definition at line 571 of file TypeBase.h.
Referenced by addConsistentQualifiers(), addQualifiers(), clang::Sema::BuildFieldReferenceExpr(), DeduceTemplateArgumentsByTypeMatch(), clang::ASTContext::getAddrSpaceQualType(), hasInconsistentOrSupersetQualifiersOf(), hasMangledSubstitutionQualifiers(), isStrictSupersetOf(), TryReferenceInitializationCore(), and TryReferenceListInitialization().
|
inline |
Definition at line 458 of file TypeBase.h.
References Const.
Referenced by AddFunctionTypeQuals(), CastsAwayConstness(), clang::Sema::CheckEnumUnderlyingType(), clang::Sema::CheckFunctionDeclaration(), CheckOriginalCallArgDeduction(), compatiblyIncludesObjCLifetime(), DiagnoseCastQual(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), getNextQualifier(), isConstantEmittableObjectType(), isNonTrivialObjCLifetimeConversion(), isQualificationConversionStep(), TryReferenceInitializationCore(), and TryReferenceListInitialization().
|
inline |
Definition at line 488 of file TypeBase.h.
References getCVRQualifiers().
Referenced by clang::Sema::ActOnCXXDelete().
|
inline |
Definition at line 619 of file TypeBase.h.
References getFastQualifiers().
|
inline |
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated.
Definition at line 639 of file TypeBase.h.
References FastMask.
Referenced by clang::QualifierCollector::apply(), clang::QualifierCollector::apply(), clang::ASTContext::getQualifiedType(), clang::ASTContext::getQualifiedType(), and clang::ASTContext::removeAddrSpaceQualType().
|
inline |
True if the lifetime is neither None or ExplicitNone.
Definition at line 560 of file TypeBase.h.
References getObjCLifetime(), and OCL_ExplicitNone.
Referenced by DeduceTemplateArgumentsByTypeMatch(), and clang::QualType::hasNonTrivialObjCLifetime().
|
inline |
Definition at line 519 of file TypeBase.h.
Referenced by addConsistentQualifiers(), addQualifiers(), compatiblyIncludes(), DeduceTemplateArgumentsByTypeMatch(), clang::ASTContext::getObjCGCQualType(), hasInconsistentOrSupersetQualifiersOf(), isQualificationConversionStep(), and isStrictSupersetOf().
|
inline |
Definition at line 545 of file TypeBase.h.
Referenced by addConsistentQualifiers(), addObjCLifetime(), addQualifiers(), checkARCPropertyImpl(), DeduceTemplateArgumentsByTypeMatch(), DiagnoseUninitializedUse(), clang::ASTContext::getCanonicalFunctionResultType(), hasInconsistentOrSupersetQualifiersOf(), isStrictSupersetOf(), clang::TreeTransform< Derived >::RebuildQualifiedType(), and TryDefaultInitialization().
|
inline |
Definition at line 459 of file TypeBase.h.
References Const.
Referenced by AddFunctionTypeQuals(), and TryObjectArgumentInitialization().
|
inline |
Definition at line 479 of file TypeBase.h.
References Restrict.
Referenced by AddFunctionTypeQuals().
|
inline |
Definition at line 469 of file TypeBase.h.
References Volatile.
Referenced by AddFunctionTypeQuals().
|
inline |
Definition at line 603 of file TypeBase.h.
Referenced by addConsistentQualifiers(), and addQualifiers().
|
inline |
Return true if the set contains any qualifiers.
Definition at line 647 of file TypeBase.h.
Referenced by clang::InitializationSequence::Diagnose(), operator bool(), and clang::ASTNodeTraverser< Derived, NodeDelegateType >::Visit().
|
inline |
Definition at line 478 of file TypeBase.h.
References Restrict.
Referenced by AddFunctionTypeQuals(), clang::Sema::BuildQualifiedType(), CollectVRQualifiers(), getNextQualifier(), clang::CXXMethodDecl::getThisType(), and clang::TreeTransform< Derived >::RebuildQualifiedType().
|
inline |
True if the lifetime is either strong or weak.
Definition at line 566 of file TypeBase.h.
References getObjCLifetime(), OCL_Strong, and OCL_Weak.
Referenced by clang::QualType::hasStrongOrWeakObjCLifetime().
|
inline |
Definition at line 575 of file TypeBase.h.
References getAddressSpace(), and clang::isTargetAddressSpace().
Referenced by getAddressSpaceAttributePrintValue().
|
inline |
Definition at line 512 of file TypeBase.h.
Referenced by compatiblyIncludes(), decomposeTypeForEH(), clang::ASTContext::getDeclAlign(), clang::CIRGen::CIRGenModule::getNaturalTypeAlignment(), hasMangledSubstitutionQualifiers(), clang::ASTContext::mergeTypes(), clang::Sema::PerformImplicitConversion(), print(), and clang::Sema::RefersToMemberWithReducedAlignment().
|
inline |
Definition at line 468 of file TypeBase.h.
References Volatile.
Referenced by AddFunctionTypeQuals(), clang::Sema::CheckEnumUnderlyingType(), CollectVRQualifiers(), DiagnoseCastQual(), getNextQualifier(), isConstantEmittableObjectType(), clang::QualType::isNonTrivialToPrimitiveCopy(), TryReferenceInitializationCore(), and TryReferenceListInitialization().
|
inlinestatic |
Returns true if address space A is equal to or a superset of B.
OpenCL v2.0 defines conversion rules (OpenCLC v2.0 s6.5.5) and notion of overlapping address spaces. CL1.1 or CL1.2: every address space is a superset of itself. CL2.0 adds: __generic is a superset of any address space except for __constant.
Definition at line 709 of file TypeBase.h.
References isTargetAddressSpaceSupersetOf().
Referenced by clang::Sema::AddOverloadCandidate(), checkConditionalPointerCompatibility(), checkPointerTypesForAssignment(), compatiblyIncludes(), clang::InitializationSequence::Diagnose(), clang::Sema::FindCompositePointerType(), clang::QualType::isAddressSpaceOverlapping(), isAddressSpaceSupersetOf(), clang::isBetterOverloadCandidate(), isQualificationConversionStep(), clang::ASTContext::mergeTypes(), clang::Sema::PerformImplicitConversion(), TryObjectArgumentInitialization(), TryReferenceInitializationCore(), TryReferenceListInitialization(), and TryReinterpretCast().
|
inline |
Returns true if the address space in these qualifiers is equal to or a superset of the address space in the argument qualifiers.
Definition at line 720 of file TypeBase.h.
References getAddressSpace(), isAddressSpaceSupersetOf(), and Qualifiers().
| bool Qualifiers::isEmptyWhenPrinted | ( | const PrintingPolicy & | Policy | ) | const |
Definition at line 2697 of file TypePrinter.cpp.
References clang::Default, getAddressSpace(), getCVRQualifiers(), getObjCGCAttr(), getObjCLifetime(), getPointerAuth(), OCL_Strong, and clang::PrintingPolicy::SuppressStrongLifetime.
| bool Qualifiers::isStrictSupersetOf | ( | Qualifiers | Other | ) | const |
Determine whether this set of qualifiers is a strict superset of another set of qualifiers, not considering qualifier compatibility.
Definition at line 57 of file Type.cpp.
References CVRMask, getAddressSpace(), getObjCGCAttr(), getObjCLifetime(), hasAddressSpace(), hasObjCGCAttr(), hasObjCLifetime(), clang::Other, and Qualifiers().
Referenced by DeduceTemplateArgumentsByTypeMatch().
|
static |
Definition at line 72 of file Type.cpp.
References clang::cuda_constant, clang::cuda_device, clang::cuda_shared, clang::Default, clang::ASTContext::getTargetInfo(), clang::hlsl_device, clang::hlsl_input, clang::hlsl_output, clang::hlsl_private, clang::hlsl_push_constant, clang::TargetInfo::isAddressSpaceSupersetOf(), clang::isPtrSizeAddressSpace(), clang::opencl_constant, clang::opencl_generic, clang::opencl_global, clang::opencl_global_device, clang::opencl_global_host, clang::sycl_global, clang::sycl_global_device, clang::sycl_global_host, clang::sycl_local, and clang::sycl_private.
Referenced by isAddressSpaceSupersetOf().
|
inlineexplicit |
Definition at line 771 of file TypeBase.h.
References hasQualifiers().
|
inline |
Definition at line 769 of file TypeBase.h.
References clang::Other, and Qualifiers().
|
inline |
Definition at line 773 of file TypeBase.h.
References addQualifiers(), and Qualifiers().
|
inline |
Definition at line 785 of file TypeBase.h.
References Qualifiers(), and removeQualifiers().
|
inline |
Definition at line 768 of file TypeBase.h.
References clang::Other, and Qualifiers().
| void Qualifiers::print | ( | raw_ostream & | OS, |
| const PrintingPolicy & | Policy, | ||
| bool | appendSpaceIfNonEmpty = false ) const |
Definition at line 2777 of file TypePrinter.cpp.
References AppendTypeQualList(), getAddressSpace(), getAddrSpaceAsString(), getCVRQualifiers(), getObjCGCAttr(), getObjCLifetime(), getPointerAuth(), hasUnaligned(), clang::isTargetAddressSpace(), OCL_Autoreleasing, OCL_ExplicitNone, OCL_None, OCL_Strong, OCL_Weak, clang::PrintingPolicy::Restrict, clang::PrintingPolicy::SuppressStrongLifetime, and Weak.
|
inline |
Definition at line 805 of file TypeBase.h.
|
inline |
Definition at line 597 of file TypeBase.h.
References clang::Default, and setAddressSpace().
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildFieldReferenceExpr(), checkBlockPointerTypesForAssignment(), checkConditionalPointerCompatibility(), DeduceTemplateArgumentsByTypeMatch(), clang::Expr::isNullPointerConstant(), clang::ASTContext::mergeTypes(), RemoveAddressSpaceFromPtr(), clang::ASTContext::removeAddrSpaceQualType(), removeCommonQualifiers(), removeQualifiers(), stripUnusedQualifiers(), and withoutAddressSpace().
|
inlinestatic |
Returns the common set of qualifiers while removing them from the given sets.
Definition at line 385 of file TypeBase.h.
References addCVRQualifiers(), CVRMask, clang::Empty, getAddressSpace(), getCVRQualifiers(), clang::PointerAuthQualifier::getKey(), getObjCGCAttr(), getObjCLifetime(), getPointerAuth(), clang::PointerAuthQualifier::isPresent(), clang::PointerAuthQualifier::KeyNoneInternal, Qualifiers(), removeAddressSpace(), removeCVRQualifiers(), removeObjCGCAttr(), removeObjCLifetime(), setAddressSpace(), setObjCGCAttr(), setObjCLifetime(), and setPointerAuth().
Referenced by clang::ASTContext::getCommonSugaredType(), and UnwrapTypeForDebugInfo().
|
inline |
Definition at line 460 of file TypeBase.h.
References Const.
Referenced by clang::Sema::BuildFieldReferenceExpr(), clang::Sema::BuildQualifiedType(), clang::Sema::BuiltinChangeCVRQualifiers(), clang::Sema::BuiltinRemoveReference(), CastsAwayConstness(), clang::Sema::CheckMain(), checkMemberDecomposition(), getNextQualifier(), and TypeInfoIsInStandardLibrary().
|
inline |
Definition at line 500 of file TypeBase.h.
References CVRMask, and removeCVRQualifiers().
Referenced by removeCVRQualifiers().
|
inline |
Definition at line 496 of file TypeBase.h.
References CVRMask.
Referenced by clang::Sema::ActOnCXXDelete(), clang::SemaObjC::actOnObjCTypeParam(), checkConditionalPointerCompatibility(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::GetDecompositionElementCount(), GetFullTypeForDeclarator(), clang::ASTContext::hasCvrSimilarType(), removeCommonQualifiers(), and shouldBeModeledWithNoOp().
|
inline |
Definition at line 629 of file TypeBase.h.
References FastMask, and removeFastQualifiers().
Referenced by removeFastQualifiers().
|
inline |
Definition at line 625 of file TypeBase.h.
References FastMask.
|
inline |
Definition at line 524 of file TypeBase.h.
References GCNone, and setObjCGCAttr().
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildFieldReferenceExpr(), DeduceTemplateArgumentsByTypeMatch(), clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), isQualificationConversionStep(), removeCommonQualifiers(), removeQualifiers(), stripUnusedQualifiers(), TryReferenceInit(), TryStaticCast(), and withoutObjCGCAttr().
|
inline |
Definition at line 552 of file TypeBase.h.
References OCL_None, and setObjCLifetime().
Referenced by BuildSimilarlyQualifiedPointerType(), checkPointerTypesForAssignment(), DeduceTemplateArgumentsByTypeMatch(), clang::ASTContext::getCanonicalFunctionResultType(), clang::ASTContext::getUnqualifiedObjCPointerType(), handleObjCOwnershipTypeAttr(), isQualificationConversionStep(), clang::TreeTransform< Derived >::RebuildQualifiedType(), removeCommonQualifiers(), removeQualifiers(), stripUnusedQualifiers(), TryReferenceInit(), TryStaticCast(), and withoutObjCLifetime().
|
inline |
Definition at line 611 of file TypeBase.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitScalarInit(), and removeQualifiers().
|
inline |
Remove the qualifiers from the given set from this set.
Definition at line 670 of file TypeBase.h.
References CVRMask, getAddressSpace(), getObjCGCAttr(), getObjCLifetime(), getPointerAuth(), Qualifiers(), removeAddressSpace(), removeObjCGCAttr(), removeObjCLifetime(), and removePointerAuth().
Referenced by operator-=().
|
inline |
Definition at line 480 of file TypeBase.h.
References Restrict.
Referenced by clang::Sema::BuildQualifiedType(), clang::Sema::BuiltinChangeCVRQualifiers(), and getNextQualifier().
|
inline |
Definition at line 516 of file TypeBase.h.
Referenced by clang::QualType::isAtLeastAsQualifiedAs(), isQualificationConversionStep(), stripUnusedQualifiers(), TryReferenceInit(), and withoutUnaligned().
|
inline |
Definition at line 470 of file TypeBase.h.
References Volatile.
Referenced by clang::Sema::BuildQualifiedType(), clang::Sema::BuiltinChangeCVRQualifiers(), clang::Sema::BuiltinRemoveReference(), clang::Sema::CheckExplicitlyDefaultedComparison(), getNextQualifier(), and IsOverloadOrOverrideImpl().
|
inline |
Definition at line 592 of file TypeBase.h.
References MaxAddressSpace, and uint32_t.
Referenced by addAddressSpace(), clang::Sema::BuildCallExpr(), checkConditionalPointerCompatibility(), clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue(), clang::Sema::FindCompositePointerType(), clang::ento::MemRegionManager::getElementRegion(), NoteFunctionCandidate(), clang::Sema::PerformObjectMemberConversion(), removeAddressSpace(), and removeCommonQualifiers().
|
inline |
Definition at line 492 of file TypeBase.h.
References CVRMask.
Referenced by DeduceTemplateArgumentsByTypeMatch().
|
inline |
Definition at line 621 of file TypeBase.h.
References FastMask.
Referenced by getNonFastQualifiers().
|
inline |
Definition at line 521 of file TypeBase.h.
References clang::ast_matchers::type.
Referenced by addObjCGCAttr(), clang::Sema::FindCompositePointerType(), removeCommonQualifiers(), and removeObjCGCAttr().
|
inline |
Definition at line 549 of file TypeBase.h.
References clang::ast_matchers::type.
Referenced by checkARCPropertyImpl(), CheckOriginalCallArgDeduction(), clang::Sema::CheckTemplateTypeArgument(), DeduceTemplateArgumentsByTypeMatch(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::Sema::FindCompositePointerType(), clang::ObjCMethodDecl::getSelfType(), clang::SemaObjC::isObjCWritebackConversion(), isStdClassTemplate(), removeCommonQualifiers(), and removeObjCLifetime().
|
inline |
Definition at line 607 of file TypeBase.h.
References clang::PointerAuthQualifier::getAsOpaqueValue().
Referenced by addPointerAuth(), clang::Sema::FindCompositePointerType(), clang::ASTContext::getPointerAuthType(), and removeCommonQualifiers().
|
inline |
Definition at line 513 of file TypeBase.h.
Referenced by clang::Sema::BuildQualifiedType().
|
inline |
Definition at line 462 of file TypeBase.h.
References addConst(), and Qualifiers().
|
inline |
Definition at line 539 of file TypeBase.h.
References Qualifiers(), and removeAddressSpace().
Referenced by TryReferenceInitializationCore(), and TryReferenceListInitialization().
|
inline |
Definition at line 529 of file TypeBase.h.
References Qualifiers(), and removeObjCGCAttr().
Referenced by checkPointerTypesForAssignment().
|
inline |
Definition at line 534 of file TypeBase.h.
References Qualifiers(), and removeObjCLifetime().
Referenced by checkPointerTypesForAssignment(), DeduceTemplateArgumentsByTypeMatch(), clang::SemaObjC::isObjCWritebackConversion(), and TryReferenceInitializationCore().
|
inline |
Definition at line 482 of file TypeBase.h.
References addRestrict(), and Qualifiers().
|
inline |
Definition at line 472 of file TypeBase.h.
References addVolatile(), and Qualifiers().
|
friend |
Definition at line 780 of file TypeBase.h.
References Qualifiers().
|
friend |
Compute the difference between two qualifier sets.
Definition at line 791 of file TypeBase.h.
References Qualifiers().