clang 8.0.0

Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::Qualifiers Class Reference

The collection of all-type qualifiers we support. More...

`#include "clang/AST/Type.h"`

Inheritance diagram for clang::Qualifiers:
[legend]

## Public Types
enum | TQ { 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 | { MaxAddressSpace = 0x7fffffu, FastWidth = 3, FastMask = (1 << FastWidth) - 1 }

## Public Member Functions
unsigned | getAsOpaqueValue () const
bool | hasConst () const
bool | hasOnlyConst () const
void | removeConst ()
void | addConst ()
bool | hasVolatile () const
bool | hasOnlyVolatile () const
void | removeVolatile ()
void | addVolatile ()
bool | hasRestrict () const
bool | hasOnlyRestrict () const
void | removeRestrict ()
void | addRestrict ()
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
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. More...
bool | hasStrongOrWeakObjCLifetime () const
| True if the lifetime is either strong or weak. More...
bool | hasAddressSpace () const
LangAS | getAddressSpace () const
bool | hasTargetSpecificAddressSpace () const
unsigned | getAddressSpaceAttributePrintValue () const
| Get the address space attribute value to be printed by diagnostics. More...
void | setAddressSpace (LangAS space)
void | removeAddressSpace ()
void | addAddressSpace (LangAS space)
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. More...
Qualifiers | getNonFastQualifiers () const
bool | hasQualifiers () const
| Return true if the set contains any qualifiers. More...
bool | empty () const
void | addQualifiers (Qualifiers Q)
| Add the qualifiers from the given set to this set. More...
void | removeQualifiers (Qualifiers Q)
| Remove the qualifiers from the given set from this set. More...
void | addConsistentQualifiers (Qualifiers qs)
| Add the qualifiers from the given set to this set, given that they don't conflict. More...
bool | isAddressSpaceSupersetOf (Qualifiers other) const
| Returns true if this address space is a superset of the other one. More...
bool | compatiblyIncludes (Qualifiers other) const
| Determines if these qualifiers compatibly include another set. More...
bool | compatiblyIncludesObjCLifetime (Qualifiers other) const
| Determines if these qualifiers compatibly include another set of qualifiers from the narrow perspective of Objective-C ARC lifetime. More...
bool | isStrictSupersetOf (Qualifiers Other) const
| Determine whether this set of qualifiers is a strict superset of another set of qualifiers, not considering qualifier compatibility. More...
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. More...
static Qualifiers | fromFastMask (unsigned Mask)
static Qualifiers | fromCVRMask (unsigned CVR)
static Qualifiers | fromCVRUMask (unsigned CVRU)
static Qualifiers | fromOpaqueValue (unsigned opaque)

## Friends
Qualifiers | operator+ (Qualifiers L, Qualifiers R)
Qualifiers | operator- (Qualifiers L, Qualifiers R)
| Compute the difference between two qualifier sets. More...

## Detailed Description

The collection of all-type qualifiers we support.

Clang supports five independent qualifiers:

- C99: const, volatile, and restrict
- MS: __unaligned
- Embedded C (TR18037): address spaces
- Objective C: the GC attributes (none, weak, or strong)

Definition at line 141 of file Type.h.

## Member Enumeration Documentation

## ◆ anonymous enum

anonymous enum

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 178 of file Type.h.

## ◆ GC

enum clang::Qualifiers::GC

Enumerator
GCNone |
Weak |
Strong |

Definition at line 150 of file Type.h.

## ◆ ObjCLifetime

enum clang::Qualifiers::ObjCLifetime

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 156 of file Type.h.

## ◆ TQ

enum clang::Qualifiers::TQ

Enumerator
Const |
Restrict |
Volatile |
CVRMask |

Definition at line 143 of file Type.h.

## Member Function Documentation

## ◆ addAddressSpace()

void clang::Qualifiers::addAddressSpace | ( | LangAS | space | ) |
| inline

Definition at line 378 of file Type.h.

References clang::Default.

Referenced by clang::ASTContext::getAddrSpaceQualType(), clang::CodeGen::CGOpenMPRuntimeNVPTX::translateParameter(), and TryReferenceInitializationCore().

## ◆ addConsistentQualifiers()

void clang::Qualifiers::addConsistentQualifiers | ( | Qualifiers | qs | ) |
| inline

Add the qualifiers from the given set to this set, given that they don't conflict.

Definition at line 452 of file Type.h.

References getAddressSpace(), getObjCGCAttr(), getObjCLifetime(), hasAddressSpace(), hasObjCGCAttr(), and hasObjCLifetime().

Referenced by clang::ASTContext::getASTObjCImplementationLayout(), clang::ASTContext::getBaseElementType(), clang::Type::getLocallyUnqualifiedSingleStepDesugaredType(), clang::SplitQualType::getSingleStepDesugaredType(), and clang::ASTContext::getUnqualifiedArrayType().

## ◆ addConst()

void clang::Qualifiers::addConst | ( |  | ) |
| inline

Definition at line 261 of file Type.h.

Referenced by clang::Sema::ActOnBlockArguments(), clang::Sema::AddBuiltinOperatorCandidates(), clang::Sema::CheckFunctionTemplateSpecialization(), getMissingDeclaratorIdLoc(), and TryObjectArgumentInitialization().

## ◆ addCVRQualifiers()

void clang::Qualifiers::addCVRQualifiers | ( | unsigned | mask | ) |
| inline

Definition at line 288 of file Type.h.

Referenced by clang::Sema::BuildQualifiedType(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), fromCVRMask(), and removeCommonQualifiers().

## ◆ addCVRUQualifiers()

void clang::Qualifiers::addCVRUQualifiers | ( | unsigned | mask | ) |
| inline

Definition at line 292 of file Type.h.

Referenced by fromCVRUMask().

## ◆ addFastQualifiers()

void clang::Qualifiers::addFastQualifiers | ( | unsigned | mask | ) |
| inline

Definition at line 398 of file Type.h.

Referenced by fromFastMask(), clang::QualType::getLocalQualifiers(), clang::QualType::getQualifiers(), and clang::QualType::split().

## ◆ addObjCGCAttr()

void clang::Qualifiers::addObjCGCAttr | ( | GC | type | ) |
| inline

Definition at line 310 of file Type.h.

Referenced by clang::ASTContext::getObjCGCQualType().

## ◆ addObjCLifetime()

void clang::Qualifiers::addObjCLifetime | ( | ObjCLifetime | type | ) |
| inline

Definition at line 333 of file Type.h.

Referenced by clang::ASTContext::getLifetimeQualifiedType(), handleObjCOwnershipTypeAttr(), inferARCWriteback(), and transferARCOwnershipToDeclSpec().

## ◆ addQualifiers()

void clang::Qualifiers::addQualifiers | ( | Qualifiers | Q | ) |
| inline

Add the qualifiers from the given set to this set.

Definition at line 417 of file Type.h.

References getAddressSpace(), getObjCGCAttr(), getObjCLifetime(), hasAddressSpace(), hasObjCGCAttr(), and hasObjCLifetime().

Referenced by clang::CodeGen::CodeGenFunction::EmitUnaryOpLValue().

## ◆ addRestrict()

void clang::Qualifiers::addRestrict | ( |  | ) |
| inline

Definition at line 271 of file Type.h.

Referenced by clang::CodeGen::CGOpenMPRuntimeNVPTX::translateParameter().

## ◆ addUnaligned()

void clang::Qualifiers::addUnaligned | ( |  | ) |
| inline

Definition at line 302 of file Type.h.

## ◆ addVolatile()

void clang::Qualifiers::addVolatile | ( |  | ) |
| inline

Definition at line 266 of file Type.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::AggValueSlot::setVolatile(), and TryObjectArgumentInitialization().

## ◆ compatiblyIncludes()

bool clang::Qualifiers::compatiblyIncludes | ( | Qualifiers | other | ) | const
| 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 482 of file Type.h.

References getObjCGCAttr(), getObjCLifetime(), hasObjCGCAttr(), and hasUnaligned().

Referenced by checkPointerTypesForAssignment(), clang::Sema::handlerCanCatch(), clang::QualType::isMoreQualifiedThan(), TryReferenceInit(), and TryStaticCast().

## ◆ compatiblyIncludesObjCLifetime()

bool clang::Qualifiers::compatiblyIncludesObjCLifetime | ( | Qualifiers | other | ) | const
| 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 503 of file Type.h.

References getObjCLifetime().

Referenced by CastsAwayConstness(), checkPointerTypesForAssignment(), and DiagnoseBadFunctionCast().

## ◆ empty()

bool clang::Qualifiers::empty | ( |  | ) | const
| inline

Definition at line 414 of file Type.h.

Referenced by clang::ASTContext::getAsArrayType(), clang::Type::getLocallyUnqualifiedSingleStepDesugaredType(), clang::getParameterABISpelling(), clang::ASTContext::getUnqualifiedArrayType(), clang::Expr::isNullPointerConstant(), clang::CodeGen::CGDebugInfo::remapDIPath(), splitAccordingToPolicy(), and TypeInfoIsInStandardLibrary().

## ◆ fromCVRMask()

static Qualifiers clang::Qualifiers::fromCVRMask | ( | unsigned | CVR | ) |
| inline static

Definition at line 234 of file Type.h.

References addCVRQualifiers().

Referenced by clang::Sema::BuildQualifiedType(), CastsAwayConstness(), clang::Sema::FindCompositePointerType(), clang::ArrayType::getIndexTypeQualifiers(), and clang::TreeTransform< Derived >::RebuildQualifiedType().

## ◆ fromCVRUMask()

static Qualifiers clang::Qualifiers::fromCVRUMask | ( | unsigned | CVRU | ) |
| inline static

Definition at line 240 of file Type.h.

References addCVRUQualifiers().

Referenced by getMissingDeclaratorIdLoc().

## ◆ fromFastMask()

static Qualifiers clang::Qualifiers::fromFastMask | ( | unsigned | Mask | ) |
| inline static

Definition at line 228 of file Type.h.

References addFastQualifiers().

Referenced by clang::FunctionType::getFastTypeQuals(), and clang::QualType::split().

## ◆ fromOpaqueValue()

static Qualifiers clang::Qualifiers::fromOpaqueValue | ( | unsigned | opaque | ) |
| inline static

Definition at line 247 of file Type.h.

Referenced by clang::FormatASTNodeDiagnosticArgument().

## ◆ getAddressSpace()

LangAS clang::Qualifiers::getAddressSpace | ( |  | ) | const
| inline

Definition at line 352 of file Type.h.

Referenced by addConsistentQualifiers(), addQualifiers(), checkConditionalPointerCompatibility(), clang::CodeGen::LValue::getAddressSpace(), clang::ExtQuals::getAddressSpace(), clang::ASTContext::getTargetAddressSpace(), GetThisType(), HandleAddressSpaceTypeAttribute(), hasInconsistentOrSupersetQualifiersOf(), isAddressSpaceSupersetOf(), IsModifiable(), isStrictSupersetOf(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), clang::InitializationSequence::Perform(), clang::TreeTransform< Derived >::RebuildQualifiedType(), removeCommonQualifiers(), removeQualifiers(), and TryReferenceInitializationCore().

## ◆ getAddressSpaceAttributePrintValue()

unsigned clang::Qualifiers::getAddressSpaceAttributePrintValue | ( |  | ) | const
| inline

Get the address space attribute value to be printed by diagnostics.

Definition at line 359 of file Type.h.

References clang::Default, and clang::toTargetAddressSpace().

Referenced by clang::Sema::ActOnCXXDelete(), and clang::Sema::CheckAllocatedType().

## ◆ getAsOpaqueValue()

unsigned clang::Qualifiers::getAsOpaqueValue | ( |  | ) | const
| inline

Definition at line 254 of file Type.h.

Referenced by addExceptionSpec(), clang::ODRHash::AddQualType(), clang::ASTContext::mergeTypes(), clang::operator<<(), and clang::ASTTypeWriter::Visit().

## ◆ getAsString() [1/2]

std::string Qualifiers::getAsString | ( |  | ) | const

Definition at line 1692 of file TypePrinter.cpp.

Referenced by getFunctionQualifiersAsString(), clang::getParameterABISpelling(), clang::TextNodeDumper::Visit(), and clang::TextNodeDumper::VisitArrayType().

## ◆ getAsString() [2/2]

std::string Qualifiers::getAsString | ( | const PrintingPolicy & | Policy | ) | const

Definition at line 1700 of file TypePrinter.cpp.

## ◆ getCVRQualifiers()

unsigned clang::Qualifiers::getCVRQualifiers | ( |  | ) | const
| inline

Definition at line 274 of file Type.h.

Referenced by CastsAwayConstness(), checkConditionalPointerCompatibility(), DeduceTemplateArgumentsByTypeMatch(), clang::CodeGen::CodeGenFunction::EmitExtVectorElementExpr(), clang::CodeGen::CodeGenFunction::EmitObjCIvarRefLValue(), clang::CodeGen::LValue::getVRQualifiers(), hasInconsistentOrSupersetQualifiersOf(), hasMangledSubstitutionQualifiers(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), removeCommonQualifiers(), and TryReferenceInitializationCore().

## ◆ getCVRUQualifiers()

unsigned clang::Qualifiers::getCVRUQualifiers | ( |  | ) | const
| inline

Definition at line 275 of file Type.h.

## ◆ getFastQualifiers()

unsigned clang::Qualifiers::getFastQualifiers | ( |  | ) | const
| inline

Definition at line 386 of file Type.h.

Referenced by clang::ASTContext::getASTObjCImplementationLayout(), clang::ASTContext::getQualifiedType(), and clang::ASTContext::removeAddrSpaceQualType().

## ◆ getNonFastQualifiers()

Qualifiers clang::Qualifiers::getNonFastQualifiers | ( |  | ) | const
| inline

Definition at line 406 of file Type.h.

References setFastQualifiers().

## ◆ getObjCGCAttr()

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

Definition at line 305 of file Type.h.

Referenced by addConsistentQualifiers(), addQualifiers(), compatiblyIncludes(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::ExtQuals::getObjCGCAttr(), hasInconsistentOrSupersetQualifiersOf(), clang::CodeGen::LValue::isObjCStrong(), clang::CodeGen::LValue::isObjCWeak(), isStrictSupersetOf(), clang::ASTContext::mergeObjCGCQualifiers(), clang::ASTContext::mergeTypes(), removeCommonQualifiers(), and removeQualifiers().

## ◆ getObjCLifetime()

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

Definition at line 326 of file Type.h.

Referenced by clang::Sema::ActOnForEachDeclStmt(), addConsistentQualifiers(), addQualifiers(), clang::ASTContext::BlockRequiresCopying(), buildByrefHelpers(), checkPointerTypesForAssignment(), compatiblyIncludes(), compatiblyIncludesObjCLifetime(), computeCopyInfoForBlockCapture(), DeduceTemplateArgumentsByTypeMatch(), clang::CodeGen::CGObjCRuntime::EmitInitOfCatchParam(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::CodeGen::CodeGenFunction::generateObjCGetterBody(), clang::CodeGen::LValue::getObjCLifetime(), clang::CodeGen::AggValueSlot::getObjCLifetime(), clang::QualType::getObjCLifetime(), clang::ExtQuals::getObjCLifetime(), handleObjCOwnershipTypeAttr(), hasInconsistentOrSupersetQualifiersOf(), InitCatchParam(), isNonTrivialObjCLifetimeConversion(), clang::QualType::isNonTrivialToPrimitiveCopy(), isStrictSupersetOf(), clang::ASTContext::mergeTypes(), removeCommonQualifiers(), and removeQualifiers().

## ◆ hasAddressSpace()

bool clang::Qualifiers::hasAddressSpace | ( |  | ) | const
| inline

Definition at line 351 of file Type.h.

Referenced by addConsistentQualifiers(), addQualifiers(), clang::ASTContext::getAddrSpaceQualType(), clang::ExtQuals::hasAddressSpace(), hasInconsistentOrSupersetQualifiersOf(), hasMangledSubstitutionQualifiers(), isStrictSupersetOf(), clang::InitializationSequence::Perform(), clang::ASTContext::removeAddrSpaceQualType(), and suppressReport().

## ◆ hasConst()

bool clang::Qualifiers::hasConst | ( |  | ) | const
| inline

Definition at line 258 of file Type.h.

Referenced by CastsAwayConstness(), DiagnoseCastQual(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), IsConstNonVolatile(), isNonTrivialObjCLifetimeConversion(), clang::CodeGen::CGDebugInfo::remapDIPath(), TryReferenceInitializationCore(), and TryReferenceListInitialization().

## ◆ hasCVRQualifiers()

bool clang::Qualifiers::hasCVRQualifiers | ( |  | ) | const
| inline

Definition at line 273 of file Type.h.

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

## ◆ hasFastQualifiers()

bool clang::Qualifiers::hasFastQualifiers | ( |  | ) | const
| inline

Definition at line 385 of file Type.h.

Referenced by clang::ExtQuals::ExtQuals(), and clang::ExtQuals::Profile().

## ◆ hasNonFastQualifiers()

bool clang::Qualifiers::hasNonFastQualifiers | ( |  | ) | const
| inline

Return true if the set contains any qualifiers which require an ExtQuals node to be allocated.

Definition at line 405 of file Type.h.

Referenced by clang::ExtQuals::ExtQuals(), clang::ASTContext::getQualifiedType(), and clang::ASTContext::removeAddrSpaceQualType().

## ◆ hasNonTrivialObjCLifetime()

bool clang::Qualifiers::hasNonTrivialObjCLifetime | ( |  | ) | const
| inline

True if the lifetime is neither None or ExplicitNone.

Definition at line 340 of file Type.h.

Referenced by DeduceTemplateArgumentsByTypeMatch(), and clang::QualType::hasNonTrivialObjCLifetime().

## ◆ hasObjCGCAttr()

bool clang::Qualifiers::hasObjCGCAttr | ( |  | ) | const
| inline

Definition at line 304 of file Type.h.

Referenced by addConsistentQualifiers(), addQualifiers(), compatiblyIncludes(), clang::ASTContext::getObjCGCQualType(), hasInconsistentOrSupersetQualifiersOf(), clang::ExtQuals::hasObjCGCAttr(), and isStrictSupersetOf().

## ◆ hasObjCLifetime()

bool clang::Qualifiers::hasObjCLifetime | ( |  | ) | const
| inline

Definition at line 325 of file Type.h.

Referenced by addConsistentQualifiers(), addQualifiers(), computeDestroyInfoForBlockCapture(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), clang::ASTContext::getCanonicalFunctionResultType(), clang::ASTContext::getUnqualifiedObjCPointerType(), hasDirectOwnershipQualifier(), hasInconsistentOrSupersetQualifiersOf(), clang::ExtQuals::hasObjCLifetime(), isStrictSupersetOf(), clang::TreeTransform< Derived >::RebuildQualifiedType(), and rewriteToObjCProperty().

## ◆ hasOnlyConst()

bool clang::Qualifiers::hasOnlyConst | ( |  | ) | const
| inline

Definition at line 259 of file Type.h.

Referenced by TryObjectArgumentInitialization().

## ◆ hasOnlyRestrict()

bool clang::Qualifiers::hasOnlyRestrict | ( |  | ) | const
| inline

Definition at line 269 of file Type.h.

## ◆ hasOnlyVolatile()

bool clang::Qualifiers::hasOnlyVolatile | ( |  | ) | const
| inline

Definition at line 264 of file Type.h.

## ◆ hasQualifiers()

bool clang::Qualifiers::hasQualifiers | ( |  | ) | const
| inline

Return true if the set contains any qualifiers.

Definition at line 413 of file Type.h.

## ◆ hasRestrict()

bool clang::Qualifiers::hasRestrict | ( |  | ) | const
| inline

Definition at line 268 of file Type.h.

Referenced by clang::Sema::BuildQualifiedType(), clang::CodeGen::LValue::isRestrictQualified(), clang::TreeTransform< Derived >::RebuildQualifiedType(), and clang::CodeGen::CGDebugInfo::remapDIPath().

## ◆ hasStrongOrWeakObjCLifetime()

bool clang::Qualifiers::hasStrongOrWeakObjCLifetime | ( |  | ) | const
| inline

True if the lifetime is either strong or weak.

Definition at line 346 of file Type.h.

Referenced by clang::QualType::hasStrongOrWeakObjCLifetime().

## ◆ hasTargetSpecificAddressSpace()

bool clang::Qualifiers::hasTargetSpecificAddressSpace | ( |  | ) | const
| inline

Definition at line 355 of file Type.h.

References clang::isTargetAddressSpace().

## ◆ hasUnaligned()

bool clang::Qualifiers::hasUnaligned | ( |  | ) | const
| inline

Definition at line 297 of file Type.h.

Referenced by compatiblyIncludes(), decomposeTypeForEH(), GetAlignOfType(), clang::CodeGen::CodeGenFunction::getNaturalTypeAlignment(), hasMangledSubstitutionQualifiers(), clang::ASTContext::mergeTypes(), and clang::Sema::RefersToMemberWithReducedAlignment().

## ◆ hasVolatile()

bool clang::Qualifiers::hasVolatile | ( |  | ) | const
| inline

Definition at line 263 of file Type.h.

Referenced by DiagnoseCastQual(), clang::CodeGen::CodeGenFunction::EmitConstructorBody(), IsConstNonVolatile(), clang::QualType::isNonTrivialToPrimitiveCopy(), clang::CodeGen::LValue::isVolatile(), clang::CodeGen::AggValueSlot::isVolatile(), clang::CodeGen::LValue::isVolatileQualified(), clang::CodeGen::CGDebugInfo::remapDIPath(), TryReferenceInitializationCore(), and TryReferenceListInitialization().

## ◆ isAddressSpaceSupersetOf()

bool clang::Qualifiers::isAddressSpaceSupersetOf | ( | Qualifiers | other | ) | const
| inline

Returns true if this address space is a superset of the other one.

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 469 of file Type.h.

References getAddressSpace(), clang::opencl_constant, and clang::opencl_generic.

Referenced by checkConditionalPointerCompatibility(), checkPointerTypesForAssignment(), clang::PointerType::isAddressSpaceOverlapping(), and clang::ASTContext::mergeTypes().

## ◆ isEmptyWhenPrinted()

bool Qualifiers::isEmptyWhenPrinted | ( | const PrintingPolicy & | Policy | ) | const

Definition at line 1707 of file TypePrinter.cpp.

Referenced by splitAccordingToPolicy().

## ◆ isStrictSupersetOf()

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 56 of file Type.cpp.

References CVRMask, getAddressSpace(), getObjCGCAttr(), getObjCLifetime(), hasAddressSpace(), hasObjCGCAttr(), and hasObjCLifetime().

Referenced by DeduceTemplateArgumentsByTypeMatch().

## ◆ operator bool()

clang::Qualifiers::operator bool | ( |  | ) | const
| inline explicit

Definition at line 523 of file Type.h.

## ◆ operator!=()

bool clang::Qualifiers::operator!= | ( | Qualifiers | Other | ) | const
| inline

Definition at line 521 of file Type.h.

## ◆ operator+=()

Qualifiers& clang::Qualifiers::operator+= | ( | Qualifiers | R | ) |
| inline

Definition at line 525 of file Type.h.

## ◆ operator-=()

Qualifiers& clang::Qualifiers::operator-= | ( | Qualifiers | R | ) |
| inline

Definition at line 537 of file Type.h.

## ◆ operator==()

bool clang::Qualifiers::operator== | ( | Qualifiers | Other | ) | const
| inline

Definition at line 520 of file Type.h.

## ◆ print()

void Qualifiers::print | ( | raw_ostream & | OS,
|  | const PrintingPolicy & | Policy,
|  | bool | appendSpaceIfNonEmpty = `false`
| ) |  | const

Definition at line 1727 of file TypePrinter.cpp.

Referenced by splitAccordingToPolicy().

## ◆ Profile()

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

Definition at line 555 of file Type.h.

Referenced by clang::ExtQuals::Profile().

## ◆ removeAddressSpace()

void clang::Qualifiers::removeAddressSpace | ( |  | ) |
| inline

Definition at line 377 of file Type.h.

References clang::Default.

Referenced by checkBlockPointerTypesForAssignment(), checkConditionalPointerCompatibility(), clang::Expr::isNullPointerConstant(), clang::ASTContext::mergeTypes(), clang::CodeGen::CGDebugInfo::remapDIPath(), clang::ASTContext::removeAddrSpaceQualType(), removeCommonQualifiers(), and TryReferenceInitializationCore().

## ◆ removeCommonQualifiers()

static Qualifiers clang::Qualifiers::removeCommonQualifiers | ( | Qualifiers & | L,
|  | Qualifiers & | R
| ) |  |
| inline static

Returns the common set of qualifiers while removing them from the given sets.

Definition at line 192 of file Type.h.

References addCVRQualifiers(), getAddressSpace(), getCVRQualifiers(), getObjCGCAttr(), getObjCLifetime(), removeAddressSpace(), removeCVRQualifiers(), removeObjCGCAttr(), removeObjCLifetime(), setAddressSpace(), setObjCGCAttr(), and setObjCLifetime().

Referenced by UnwrapTypeForDebugInfo().

## ◆ removeConst()

void clang::Qualifiers::removeConst | ( |  | ) |
| inline

Definition at line 260 of file Type.h.

Referenced by clang::Sema::BuildQualifiedType(), CastsAwayConstness(), checkMemberDecomposition(), clang::CodeGen::CGDebugInfo::remapDIPath(), and TypeInfoIsInStandardLibrary().

## ◆ removeCVRQualifiers() [1/2]

void clang::Qualifiers::removeCVRQualifiers | ( | unsigned | mask | ) |
| inline

Definition at line 281 of file Type.h.

Referenced by clang::Sema::ActOnCXXDelete(), checkConditionalPointerCompatibility(), clang::ASTContext::hasCvrSimilarType(), removeCommonQualifiers(), and shouldBeModeledWithNoOp().

## ◆ removeCVRQualifiers() [2/2]

void clang::Qualifiers::removeCVRQualifiers | ( |  | ) |
| inline

Definition at line 285 of file Type.h.

## ◆ removeFastQualifiers() [1/2]

void clang::Qualifiers::removeFastQualifiers | ( | unsigned | mask | ) |
| inline

Definition at line 391 of file Type.h.

Referenced by clang::ASTContext::getASTObjCImplementationLayout().

## ◆ removeFastQualifiers() [2/2]

void clang::Qualifiers::removeFastQualifiers | ( |  | ) |
| inline

Definition at line 395 of file Type.h.

## ◆ removeObjCGCAttr()

void clang::Qualifiers::removeObjCGCAttr | ( |  | ) |
| inline

Definition at line 309 of file Type.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), clang::CodeGen::CGDebugInfo::remapDIPath(), removeCommonQualifiers(), TryReferenceInit(), TryStaticCast(), and withoutObjCGCAttr().

## ◆ removeObjCLifetime()

void clang::Qualifiers::removeObjCLifetime | ( |  | ) |
| inline

Definition at line 332 of file Type.h.

Referenced by checkPointerTypesForAssignment(), clang::ASTContext::getCanonicalFunctionResultType(), clang::ASTContext::getUnqualifiedObjCPointerType(), handleObjCOwnershipTypeAttr(), isTypeSubstitutable(), clang::TreeTransform< Derived >::RebuildQualifiedType(), clang::CodeGen::CGDebugInfo::remapDIPath(), removeCommonQualifiers(), rewriteToObjCProperty(), TryReferenceInit(), TryStaticCast(), and withoutObjCLifetime().

## ◆ removeQualifiers()

void clang::Qualifiers::removeQualifiers | ( | Qualifiers | Q | ) |
| inline

Remove the qualifiers from the given set from this set.

Definition at line 434 of file Type.h.

References getAddressSpace(), getObjCGCAttr(), and getObjCLifetime().

## ◆ removeRestrict()

void clang::Qualifiers::removeRestrict | ( |  | ) |
| inline

Definition at line 270 of file Type.h.

Referenced by clang::Sema::BuildQualifiedType(), and clang::CodeGen::CGDebugInfo::remapDIPath().

## ◆ removeUnaligned()

void clang::Qualifiers::removeUnaligned | ( |  | ) |
| inline

Definition at line 301 of file Type.h.

Referenced by clang::QualType::isAtLeastAsQualifiedAs(), and TryReferenceInit().

## ◆ removeVolatile()

void clang::Qualifiers::removeVolatile | ( |  | ) |
| inline

Definition at line 265 of file Type.h.

Referenced by clang::Sema::BuildQualifiedType(), clang::CodeGen::CGDebugInfo::remapDIPath(), and clang::CodeGen::AggValueSlot::setVolatile().

## ◆ setAddressSpace()

void clang::Qualifiers::setAddressSpace | ( | LangAS | space | ) |
| inline

Definition at line 372 of file Type.h.

Referenced by checkConditionalPointerCompatibility(), clang::ASTContext::InitBuiltinTypes(), and removeCommonQualifiers().

## ◆ setCVRQualifiers()

void clang::Qualifiers::setCVRQualifiers | ( | unsigned | mask | ) |
| inline

Definition at line 277 of file Type.h.

Referenced by DeduceTemplateArgumentsByTypeMatch().

## ◆ setFastQualifiers()

void clang::Qualifiers::setFastQualifiers | ( | unsigned | mask | ) |
| inline

Definition at line 387 of file Type.h.

Referenced by getNonFastQualifiers().

## ◆ setObjCGCAttr()

void clang::Qualifiers::setObjCGCAttr | ( | GC | type | ) |
| inline

Definition at line 306 of file Type.h.

Referenced by removeCommonQualifiers().

## ◆ setObjCLifetime()

void clang::Qualifiers::setObjCLifetime | ( | ObjCLifetime | type | ) |
| inline

Definition at line 329 of file Type.h.

Referenced by removeCommonQualifiers().

## ◆ setUnaligned()

void clang::Qualifiers::setUnaligned | ( | bool | flag | ) |
| inline

Definition at line 298 of file Type.h.

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

## ◆ withoutObjCGCAttr()

Qualifiers clang::Qualifiers::withoutObjCGCAttr | ( |  | ) | const
| inline

Definition at line 314 of file Type.h.

References removeObjCGCAttr().

Referenced by checkPointerTypesForAssignment().

## ◆ withoutObjCLifetime()

Qualifiers clang::Qualifiers::withoutObjCLifetime | ( |  | ) | const
| inline

Definition at line 319 of file Type.h.

References removeObjCLifetime().

Referenced by checkPointerTypesForAssignment(), and DeduceTemplateArgumentsByTypeMatch().

## Friends And Related Function Documentation

## ◆ operator+

Qualifiers operator+ | ( | Qualifiers | L,
|  | Qualifiers | R
| ) |  |
| friend

Definition at line 532 of file Type.h.

## ◆ operator-

Qualifiers operator- | ( | Qualifiers | L,
|  | Qualifiers | R
| ) |  |
| friend

Compute the difference between two qualifier sets.

Definition at line 543 of file Type.h.

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

- include/clang/AST/Type.h
- lib/AST/Type.cpp
- lib/AST/TypePrinter.cpp