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

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

#include <Type.h>

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

Public Member Functions

 QualifierCollector (Qualifiers Qs=Qualifiers())
 
const Typestrip (QualType type)
 
QualType apply (const ASTContext &Context, QualType QT) const
 Apply the collected qualifiers to the given type. More...
 
QualType apply (const ASTContext &Context, const Type *T) const
 Apply the collected qualifiers to the given type. More...
 
- Public Member Functions inherited from clang::Qualifiers
 Qualifiers ()
 
unsigned getAsOpaqueValue () const
 
bool hasConst () const
 
void setConst (bool flag)
 
void removeConst ()
 
void addConst ()
 
bool hasVolatile () const
 
void setVolatile (bool flag)
 
void removeVolatile ()
 
void addVolatile ()
 
bool hasRestrict () const
 
void setRestrict (bool flag)
 
void removeRestrict ()
 
void addRestrict ()
 
bool hasCVRQualifiers () const
 
unsigned getCVRQualifiers () const
 
void setCVRQualifiers (unsigned mask)
 
void removeCVRQualifiers (unsigned mask)
 
void removeCVRQualifiers ()
 
void addCVRQualifiers (unsigned mask)
 
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
 
unsigned getAddressSpace () const
 
void setAddressSpace (unsigned space)
 
void removeAddressSpace ()
 
void addAddressSpace (unsigned space)
 
bool hasFastQualifiers () const
 
unsigned getFastQualifiers () const
 
void setFastQualifiers (unsigned mask)
 
void removeFastQualifiers (unsigned mask)
 
void removeFastQualifiers ()
 
void addFastQualifiers (unsigned mask)
 
bool hasNonFastQualifiers () const
 
Qualifiers getNonFastQualifiers () const
 
bool hasQualifiers () const
 hasQualifiers - 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. 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. More...
 
bool compatiblyIncludes (Qualifiers other) const
 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. 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
 
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 = 0xffffffu, 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. More...
 
static Qualifiers fromFastMask (unsigned Mask)
 
static Qualifiers fromCVRMask (unsigned CVR)
 
static Qualifiers fromOpaqueValue (unsigned opaque)
 

Detailed Description

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

Definition at line 4982 of file Type.h.

Constructor & Destructor Documentation

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

Definition at line 4984 of file Type.h.

Member Function Documentation

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

Apply the collected qualifiers to the given type.

Definition at line 3037 of file Type.cpp.

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

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

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