clang 19.0.0git
Public Member Functions | List of all members
clang::QualifierCollector Class Reference

A qualifier set is used to build a set of qualifiers. More...

#include "clang/AST/Type.h"

Inheritance diagram for clang::QualifierCollector:
Inheritance graph
[legend]

Public Member Functions

 QualifierCollector (Qualifiers Qs=Qualifiers())
 
const Typestrip (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
unsigned 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 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
 
Qualifiersoperator+= (Qualifiers R)
 
Qualifiersoperator-= (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 { 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 }
 
- 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 (unsigned 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)
 

Detailed Description

A qualifier set is used to build a set of qualifiers.

Definition at line 7089 of file Type.h.

Constructor & Destructor Documentation

◆ QualifierCollector()

clang::QualifierCollector::QualifierCollector ( Qualifiers  Qs = Qualifiers())
inline

Definition at line 7091 of file Type.h.

Member Function Documentation

◆ apply() [1/2]

QualType QualifierCollector::apply ( const ASTContext Context,
const Type T 
) const

Apply the collected qualifiers to the given type.

Definition at line 4280 of file Type.cpp.

References clang::Qualifiers::getFastQualifiers(), clang::ASTContext::getQualifiedType(), clang::Qualifiers::hasNonFastQualifiers(), and clang::T.

◆ apply() [2/2]

QualType QualifierCollector::apply ( const ASTContext Context,
QualType  QT 
) const

◆ strip()

const Type * clang::QualifierCollector::strip ( QualType  type)
inline

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