clang 20.0.0git
|
A qualifier set is used to build a set of qualifiers. More...
#include "clang/AST/Type.h"
Public Member Functions | |
QualifierCollector (Qualifiers Qs=Qualifiers()) | |
const Type * | strip (QualType type) |
Collect any qualifiers on the given type and return an unqualified type. | |
QualType | apply (const ASTContext &Context, QualType QT) const |
Apply the collected qualifiers to the given type. | |
QualType | apply (const ASTContext &Context, const Type *T) const |
Apply the collected qualifiers to the given type. | |
Public Member Functions inherited from clang::Qualifiers | |
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 |
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 |
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 |
Additional Inherited Members | |
Public Types inherited from clang::Qualifiers | |
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 } |
Static Public Member Functions inherited from clang::Qualifiers | |
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) |
Returns true if address space A is equal to or a superset of B. | |
static std::string | getAddrSpaceAsString (LangAS AS) |
|
inline |
QualType QualifierCollector::apply | ( | const ASTContext & | Context, |
const Type * | T | ||
) | const |
Apply the collected qualifiers to the given type.
Definition at line 4364 of file Type.cpp.
References clang::Qualifiers::getFastQualifiers(), clang::ASTContext::getQualifiedType(), clang::Qualifiers::hasNonFastQualifiers(), and clang::T.
QualType QualifierCollector::apply | ( | const ASTContext & | Context, |
QualType | QT | ||
) | const |
Apply the collected qualifiers to the given type.
Definition at line 4356 of file Type.cpp.
References clang::Qualifiers::getFastQualifiers(), clang::ASTContext::getQualifiedType(), clang::Qualifiers::hasNonFastQualifiers(), and clang::QualType::withFastQualifiers().
Referenced by clang::desugarForDiagnostic(), DiagnoseBadDeduction(), clang::CodeGen::CGOpenMPRuntimeGPU::translateParameter(), and TryToFixInvalidVariablyModifiedType().
Collect any qualifiers on the given type and return an unqualified type.
The qualifiers are assumed to be consistent with those already in the type.
Definition at line 7697 of file Type.h.
References clang::ExtQuals::getBaseType(), clang::ExtQuals::getQualifiers(), and clang::ast_matchers::type.
Referenced by clang::Sema::CheckMain(), clang::desugarForDiagnostic(), DiagnoseBadDeduction(), clang::ASTContext::getAddrSpaceQualType(), clang::ASTContext::getObjCGCQualType(), clang::CodeGen::CGOpenMPRuntimeGPU::getParameterAddress(), clang::ASTContext::getQualifiedType(), clang::ASTContext::removeAddrSpaceQualType(), clang::CodeGen::CGOpenMPRuntimeGPU::translateParameter(), and TryToFixInvalidVariablyModifiedType().