clang  6.0.0svn
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]
Collaboration diagram for clang::QualifierCollector:
Collaboration 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. More...
 
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
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)
 
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
 
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. More...
 
static Qualifiers fromFastMask (unsigned Mask)
 
static Qualifiers fromCVRMask (unsigned CVR)
 
static Qualifiers fromCVRUMask (unsigned CVRU)
 
static Qualifiers fromOpaqueValue (unsigned opaque)
 

Detailed Description

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

Definition at line 5687 of file Type.h.

Constructor & Destructor Documentation

◆ QualifierCollector()

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

Definition at line 5689 of file Type.h.

Member Function Documentation

◆ apply() [1/2]

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

Apply the collected qualifiers to the given type.

Definition at line 3271 of file Type.cpp.

References clang::ASTContext::getQualifiedType(), and clang::QualType::withFastQualifiers().

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

◆ apply() [2/2]

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

Apply the collected qualifiers to the given type.

Definition at line 3279 of file Type.cpp.

References clang::ASTContext::getQualifiedType(), and clang::ExtQualsTypeCommonBase::QualType.

◆ strip()

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

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