class Qualifiers
Declaration
class Qualifiers { /* full declaration omitted */ };
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)
Declared at: clang/include/clang/AST/Type.h:147
Member Variables
- private uint32_t Mask = 0
- private static const uint32_t UMask = 8
- private static const uint32_t UShift = 3
- private static const uint32_t GCAttrMask = 48
- private static const uint32_t GCAttrShift = 4
- private static const uint32_t LifetimeMask = 448
- private static const uint32_t LifetimeShift = 6
- private static const uint32_t AddressSpaceMask = ~(CVRMask | UMask | GCAttrMask | LifetimeMask)
- private static const uint32_t AddressSpaceShift = 9
Method Overview
- public void Profile(llvm::FoldingSetNodeID & ID) const
- public void addAddressSpace(clang::LangAS space)
- public void addCVRQualifiers(unsigned int mask)
- public void addCVRUQualifiers(unsigned int mask)
- public void addConsistentQualifiers(clang::Qualifiers qs)
- public void addConst()
- public void addFastQualifiers(unsigned int mask)
- public void addObjCGCAttr(clang::Qualifiers::GC type)
- public void addObjCLifetime(clang::Qualifiers::ObjCLifetime type)
- public void addQualifiers(clang::Qualifiers Q)
- public void addRestrict()
- public void addUnaligned()
- public void addVolatile()
- public bool compatiblyIncludes(clang::Qualifiers other) const
- public bool compatiblyIncludesObjCLifetime(clang::Qualifiers other) const
- public bool empty() const
- public static clang::Qualifiers fromCVRMask(unsigned int CVR)
- public static clang::Qualifiers fromCVRUMask(unsigned int CVRU)
- public static clang::Qualifiers fromFastMask(unsigned int Mask)
- public static clang::Qualifiers fromOpaqueValue(unsigned int opaque)
- public static std::string getAddrSpaceAsString(clang::LangAS AS)
- public clang::LangAS getAddressSpace() const
- public unsigned int getAddressSpaceAttributePrintValue() const
- public unsigned int getAsOpaqueValue() const
- public std::string getAsString() const
- public std::string getAsString(const clang::PrintingPolicy & Policy) const
- public unsigned int getCVRQualifiers() const
- public unsigned int getCVRUQualifiers() const
- public unsigned int getFastQualifiers() const
- public clang::Qualifiers getNonFastQualifiers() const
- public clang::Qualifiers::GC getObjCGCAttr() const
- public clang::Qualifiers::ObjCLifetime getObjCLifetime() const
- public bool hasAddressSpace() const
- public bool hasCVRQualifiers() const
- public bool hasConst() const
- public bool hasFastQualifiers() const
- public bool hasNonFastQualifiers() const
- public bool hasNonTrivialObjCLifetime() const
- public bool hasObjCGCAttr() const
- public bool hasObjCLifetime() const
- public bool hasOnlyConst() const
- public bool hasOnlyRestrict() const
- public bool hasOnlyVolatile() const
- public bool hasQualifiers() const
- public bool hasRestrict() const
- public bool hasStrongOrWeakObjCLifetime() const
- public bool hasTargetSpecificAddressSpace() const
- public bool hasUnaligned() const
- public bool hasVolatile() const
- public bool isAddressSpaceSupersetOf(clang::Qualifiers other) const
- public static bool isAddressSpaceSupersetOf(clang::LangAS A, clang::LangAS B)
- public bool isEmptyWhenPrinted(const clang::PrintingPolicy & Policy) const
- public bool isStrictSupersetOf(clang::Qualifiers Other) const
- public bool operator bool() const
- public void print(llvm::raw_ostream & OS, const clang::PrintingPolicy & Policy, bool appendSpaceIfNonEmpty = false) const
- public void removeAddressSpace()
- public void removeCVRQualifiers()
- public void removeCVRQualifiers(unsigned int mask)
- public static clang::Qualifiers removeCommonQualifiers(clang::Qualifiers & L, clang::Qualifiers & R)
- public void removeConst()
- public void removeFastQualifiers()
- public void removeFastQualifiers(unsigned int mask)
- public void removeObjCGCAttr()
- public void removeObjCLifetime()
- public void removeQualifiers(clang::Qualifiers Q)
- public void removeRestrict()
- public void removeUnaligned()
- public void removeVolatile()
- public void setAddressSpace(clang::LangAS space)
- public void setCVRQualifiers(unsigned int mask)
- public void setFastQualifiers(unsigned int mask)
- public void setObjCGCAttr(clang::Qualifiers::GC type)
- public void setObjCLifetime(clang::Qualifiers::ObjCLifetime type)
- public void setUnaligned(bool flag)
- public clang::Qualifiers withConst() const
- public clang::Qualifiers withRestrict() const
- public clang::Qualifiers withVolatile() const
- public clang::Qualifiers withoutAddressSpace() const
- public clang::Qualifiers withoutObjCGCAttr() const
- public clang::Qualifiers withoutObjCLifetime() const
Methods
¶void Profile(llvm::FoldingSetNodeID& ID) const
void Profile(llvm::FoldingSetNodeID& ID) const
Declared at: clang/include/clang/AST/Type.h:607
Parameters
¶void addAddressSpace(clang::LangAS space)
void addAddressSpace(clang::LangAS space)
Declared at: clang/include/clang/AST/Type.h:404
Parameters
- clang::LangAS space
¶void addCVRQualifiers(unsigned int mask)
void addCVRQualifiers(unsigned int mask)
Declared at: clang/include/clang/AST/Type.h:309
Parameters
- unsigned int mask
¶void addCVRUQualifiers(unsigned int mask)
void addCVRUQualifiers(unsigned int mask)
Declared at: clang/include/clang/AST/Type.h:313
Parameters
- unsigned int mask
¶void addConsistentQualifiers(clang::Qualifiers qs)
void addConsistentQualifiers(clang::Qualifiers qs)
Description
Add the qualifiers from the given set to this set, given that they don't conflict.
Declared at: clang/include/clang/AST/Type.h:478
Parameters
¶void addConst()
void addConst()
Declared at: clang/include/clang/AST/Type.h:267
¶void addFastQualifiers(unsigned int mask)
void addFastQualifiers(unsigned int mask)
Declared at: clang/include/clang/AST/Type.h:424
Parameters
- unsigned int mask
¶void addObjCGCAttr(clang::Qualifiers::GC type)
void addObjCGCAttr(clang::Qualifiers::GC type)
Declared at: clang/include/clang/AST/Type.h:331
Parameters
- clang::Qualifiers::GC type
¶void addObjCLifetime(
clang::Qualifiers::ObjCLifetime type)
void addObjCLifetime(
clang::Qualifiers::ObjCLifetime type)
Declared at: clang/include/clang/AST/Type.h:359
Parameters
- clang::Qualifiers::ObjCLifetime type
¶void addQualifiers(clang::Qualifiers Q)
void addQualifiers(clang::Qualifiers Q)
Description
Add the qualifiers from the given set to this set.
Declared at: clang/include/clang/AST/Type.h:443
Parameters
¶void addRestrict()
void addRestrict()
Declared at: clang/include/clang/AST/Type.h:287
¶void addUnaligned()
void addUnaligned()
Declared at: clang/include/clang/AST/Type.h:323
¶void addVolatile()
void addVolatile()
Declared at: clang/include/clang/AST/Type.h:277
¶bool compatiblyIncludes(
clang::Qualifiers other) const
bool compatiblyIncludes(
clang::Qualifiers other) const
Description
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.
Declared at: clang/include/clang/AST/Type.h:532
Parameters
- clang::Qualifiers other
¶bool compatiblyIncludesObjCLifetime(
clang::Qualifiers other) const
bool compatiblyIncludesObjCLifetime(
clang::Qualifiers other) const
Description
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).
Declared at: clang/include/clang/AST/Type.h:553
Parameters
- clang::Qualifiers other
¶bool empty() const
bool empty() const
Declared at: clang/include/clang/AST/Type.h:440
¶static clang::Qualifiers fromCVRMask(
unsigned int CVR)
static clang::Qualifiers fromCVRMask(
unsigned int CVR)
Declared at: clang/include/clang/AST/Type.h:240
Parameters
- unsigned int CVR
¶static clang::Qualifiers fromCVRUMask(
unsigned int CVRU)
static clang::Qualifiers fromCVRUMask(
unsigned int CVRU)
Declared at: clang/include/clang/AST/Type.h:246
Parameters
- unsigned int CVRU
¶static clang::Qualifiers fromFastMask(
unsigned int Mask)
static clang::Qualifiers fromFastMask(
unsigned int Mask)
Declared at: clang/include/clang/AST/Type.h:234
Parameters
- unsigned int Mask
¶static clang::Qualifiers fromOpaqueValue(
unsigned int opaque)
static clang::Qualifiers fromOpaqueValue(
unsigned int opaque)
Declared at: clang/include/clang/AST/Type.h:253
Parameters
- unsigned int opaque
¶static std::string getAddrSpaceAsString(
clang::LangAS AS)
static std::string getAddrSpaceAsString(
clang::LangAS AS)
Declared at: clang/include/clang/AST/Type.h:601
Parameters
- clang::LangAS AS
¶clang::LangAS getAddressSpace() const
clang::LangAS getAddressSpace() const
Declared at: clang/include/clang/AST/Type.h:378
¶unsigned int getAddressSpaceAttributePrintValue()
const
unsigned int getAddressSpaceAttributePrintValue()
const
Description
Get the address space attribute value to be printed by diagnostics.
Declared at: clang/include/clang/AST/Type.h:385
¶unsigned int getAsOpaqueValue() const
unsigned int getAsOpaqueValue() const
Declared at: clang/include/clang/AST/Type.h:260
¶std::string getAsString() const
std::string getAsString() const
Declared at: clang/include/clang/AST/Type.h:598
¶std::string getAsString(
const clang::PrintingPolicy& Policy) const
std::string getAsString(
const clang::PrintingPolicy& Policy) const
Declared at: clang/include/clang/AST/Type.h:599
Parameters
- const clang::PrintingPolicy& Policy
¶unsigned int getCVRQualifiers() const
unsigned int getCVRQualifiers() const
Declared at: clang/include/clang/AST/Type.h:295
¶unsigned int getCVRUQualifiers() const
unsigned int getCVRUQualifiers() const
Declared at: clang/include/clang/AST/Type.h:296
¶unsigned int getFastQualifiers() const
unsigned int getFastQualifiers() const
Declared at: clang/include/clang/AST/Type.h:412
¶clang::Qualifiers getNonFastQualifiers() const
clang::Qualifiers getNonFastQualifiers() const
Declared at: clang/include/clang/AST/Type.h:432
¶clang::Qualifiers::GC getObjCGCAttr() const
clang::Qualifiers::GC getObjCGCAttr() const
Declared at: clang/include/clang/AST/Type.h:326
¶clang::Qualifiers::ObjCLifetime getObjCLifetime()
const
clang::Qualifiers::ObjCLifetime getObjCLifetime()
const
Declared at: clang/include/clang/AST/Type.h:352
¶bool hasAddressSpace() const
bool hasAddressSpace() const
Declared at: clang/include/clang/AST/Type.h:377
¶bool hasCVRQualifiers() const
bool hasCVRQualifiers() const
Declared at: clang/include/clang/AST/Type.h:294
¶bool hasConst() const
bool hasConst() const
Declared at: clang/include/clang/AST/Type.h:264
¶bool hasFastQualifiers() const
bool hasFastQualifiers() const
Declared at: clang/include/clang/AST/Type.h:411
¶bool hasNonFastQualifiers() const
bool hasNonFastQualifiers() const
Description
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated.
Declared at: clang/include/clang/AST/Type.h:431
¶bool hasNonTrivialObjCLifetime() const
bool hasNonTrivialObjCLifetime() const
Description
True if the lifetime is neither None or ExplicitNone.
Declared at: clang/include/clang/AST/Type.h:366
¶bool hasObjCGCAttr() const
bool hasObjCGCAttr() const
Declared at: clang/include/clang/AST/Type.h:325
¶bool hasObjCLifetime() const
bool hasObjCLifetime() const
Declared at: clang/include/clang/AST/Type.h:351
¶bool hasOnlyConst() const
bool hasOnlyConst() const
Declared at: clang/include/clang/AST/Type.h:265
¶bool hasOnlyRestrict() const
bool hasOnlyRestrict() const
Declared at: clang/include/clang/AST/Type.h:285
¶bool hasOnlyVolatile() const
bool hasOnlyVolatile() const
Declared at: clang/include/clang/AST/Type.h:275
¶bool hasQualifiers() const
bool hasQualifiers() const
Description
Return true if the set contains any qualifiers.
Declared at: clang/include/clang/AST/Type.h:439
¶bool hasRestrict() const
bool hasRestrict() const
Declared at: clang/include/clang/AST/Type.h:284
¶bool hasStrongOrWeakObjCLifetime() const
bool hasStrongOrWeakObjCLifetime() const
Description
True if the lifetime is either strong or weak.
Declared at: clang/include/clang/AST/Type.h:372
¶bool hasTargetSpecificAddressSpace() const
bool hasTargetSpecificAddressSpace() const
Declared at: clang/include/clang/AST/Type.h:381
¶bool hasUnaligned() const
bool hasUnaligned() const
Declared at: clang/include/clang/AST/Type.h:318
¶bool hasVolatile() const
bool hasVolatile() const
Declared at: clang/include/clang/AST/Type.h:274
¶bool isAddressSpaceSupersetOf(
clang::Qualifiers other) const
bool isAddressSpaceSupersetOf(
clang::Qualifiers other) const
Description
Returns true if the address space in these qualifiers is equal to or a superset of the address space in the argument qualifiers.
Declared at: clang/include/clang/AST/Type.h:525
Parameters
- clang::Qualifiers other
¶static bool isAddressSpaceSupersetOf(
clang::LangAS A,
clang::LangAS B)
static bool isAddressSpaceSupersetOf(
clang::LangAS A,
clang::LangAS B)
Description
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.
Declared at: clang/include/clang/AST/Type.h:495
Parameters
- clang::LangAS A
- clang::LangAS B
¶bool isEmptyWhenPrinted(
const clang::PrintingPolicy& Policy) const
bool isEmptyWhenPrinted(
const clang::PrintingPolicy& Policy) const
Declared at: clang/include/clang/AST/Type.h:603
Parameters
- const clang::PrintingPolicy& Policy
¶bool isStrictSupersetOf(
clang::Qualifiers Other) const
bool isStrictSupersetOf(
clang::Qualifiers Other) const
Description
Determine whether this set of qualifiers is a strict superset of another set of qualifiers, not considering qualifier compatibility.
Declared at: clang/include/clang/AST/Type.h:568
Parameters
- clang::Qualifiers Other
¶bool operator bool() const
bool operator bool() const
Declared at: clang/include/clang/AST/Type.h:573
¶void print(
llvm::raw_ostream& OS,
const clang::PrintingPolicy& Policy,
bool appendSpaceIfNonEmpty = false) const
void print(
llvm::raw_ostream& OS,
const clang::PrintingPolicy& Policy,
bool appendSpaceIfNonEmpty = false) const
Declared at: clang/include/clang/AST/Type.h:604
Parameters
- llvm::raw_ostream& OS
- const clang::PrintingPolicy& Policy
- bool appendSpaceIfNonEmpty = false
¶void removeAddressSpace()
void removeAddressSpace()
Declared at: clang/include/clang/AST/Type.h:403
¶void removeCVRQualifiers()
void removeCVRQualifiers()
Declared at: clang/include/clang/AST/Type.h:306
¶void removeCVRQualifiers(unsigned int mask)
void removeCVRQualifiers(unsigned int mask)
Declared at: clang/include/clang/AST/Type.h:302
Parameters
- unsigned int mask
¶static clang::Qualifiers removeCommonQualifiers(
clang::Qualifiers& L,
clang::Qualifiers& R)
static clang::Qualifiers removeCommonQualifiers(
clang::Qualifiers& L,
clang::Qualifiers& R)
Description
Returns the common set of qualifiers while removing them from the given sets.
Declared at: clang/include/clang/AST/Type.h:198
Parameters
¶void removeConst()
void removeConst()
Declared at: clang/include/clang/AST/Type.h:266
¶void removeFastQualifiers()
void removeFastQualifiers()
Declared at: clang/include/clang/AST/Type.h:421
¶void removeFastQualifiers(unsigned int mask)
void removeFastQualifiers(unsigned int mask)
Declared at: clang/include/clang/AST/Type.h:417
Parameters
- unsigned int mask
¶void removeObjCGCAttr()
void removeObjCGCAttr()
Declared at: clang/include/clang/AST/Type.h:330
¶void removeObjCLifetime()
void removeObjCLifetime()
Declared at: clang/include/clang/AST/Type.h:358
¶void removeQualifiers(clang::Qualifiers Q)
void removeQualifiers(clang::Qualifiers Q)
Description
Remove the qualifiers from the given set from this set.
Declared at: clang/include/clang/AST/Type.h:460
Parameters
¶void removeRestrict()
void removeRestrict()
Declared at: clang/include/clang/AST/Type.h:286
¶void removeUnaligned()
void removeUnaligned()
Declared at: clang/include/clang/AST/Type.h:322
¶void removeVolatile()
void removeVolatile()
Declared at: clang/include/clang/AST/Type.h:276
¶void setAddressSpace(clang::LangAS space)
void setAddressSpace(clang::LangAS space)
Declared at: clang/include/clang/AST/Type.h:398
Parameters
- clang::LangAS space
¶void setCVRQualifiers(unsigned int mask)
void setCVRQualifiers(unsigned int mask)
Declared at: clang/include/clang/AST/Type.h:298
Parameters
- unsigned int mask
¶void setFastQualifiers(unsigned int mask)
void setFastQualifiers(unsigned int mask)
Declared at: clang/include/clang/AST/Type.h:413
Parameters
- unsigned int mask
¶void setObjCGCAttr(clang::Qualifiers::GC type)
void setObjCGCAttr(clang::Qualifiers::GC type)
Declared at: clang/include/clang/AST/Type.h:327
Parameters
- clang::Qualifiers::GC type
¶void setObjCLifetime(
clang::Qualifiers::ObjCLifetime type)
void setObjCLifetime(
clang::Qualifiers::ObjCLifetime type)
Declared at: clang/include/clang/AST/Type.h:355
Parameters
- clang::Qualifiers::ObjCLifetime type
¶void setUnaligned(bool flag)
void setUnaligned(bool flag)
Declared at: clang/include/clang/AST/Type.h:319
Parameters
- bool flag
¶clang::Qualifiers withConst() const
clang::Qualifiers withConst() const
Declared at: clang/include/clang/AST/Type.h:268
¶clang::Qualifiers withRestrict() const
clang::Qualifiers withRestrict() const
Declared at: clang/include/clang/AST/Type.h:288
¶clang::Qualifiers withVolatile() const
clang::Qualifiers withVolatile() const
Declared at: clang/include/clang/AST/Type.h:278
¶clang::Qualifiers withoutAddressSpace() const
clang::Qualifiers withoutAddressSpace() const
Declared at: clang/include/clang/AST/Type.h:345
¶clang::Qualifiers withoutObjCGCAttr() const
clang::Qualifiers withoutObjCGCAttr() const
Declared at: clang/include/clang/AST/Type.h:335
¶clang::Qualifiers withoutObjCLifetime() const
clang::Qualifiers withoutObjCLifetime() const
Declared at: clang/include/clang/AST/Type.h:340