clang 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
clang::ExtQuals Class Reference

We can encode up to four bits in the low bits of a type pointer, but there are many more type qualifiers that we want to be able to apply to an arbitrary type. More...

#include "clang/AST/Type.h"

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

Public Member Functions

 ExtQuals (const Type *baseType, QualType canon, Qualifiers quals)
 
Qualifiers getQualifiers () const
 
bool hasObjCGCAttr () const
 
Qualifiers::GC getObjCGCAttr () const
 
bool hasObjCLifetime () const
 
Qualifiers::ObjCLifetime getObjCLifetime () const
 
bool hasAddressSpace () const
 
LangAS getAddressSpace () const
 
const TypegetBaseType () const
 
void Profile (llvm::FoldingSetNodeID &ID) const
 

Static Public Member Functions

static void Profile (llvm::FoldingSetNodeID &ID, const Type *BaseType, Qualifiers Quals)
 

Detailed Description

We can encode up to four bits in the low bits of a type pointer, but there are many more type qualifiers that we want to be able to apply to an arbitrary type.

Therefore we have this struct, intended to be heap-allocated and used by QualType to store qualifiers.

The current design tags the 'const', 'restrict', and 'volatile' qualifiers in three low bits on the QualType pointer; a fourth bit records whether the pointer is an ExtQuals node. The extended qualifiers (address spaces, Objective-C GC attributes) are much more rare.

Definition at line 1712 of file Type.h.

Constructor & Destructor Documentation

◆ ExtQuals()

clang::ExtQuals::ExtQuals ( const Type baseType,
QualType  canon,
Qualifiers  quals 
)
inline

Definition at line 1734 of file Type.h.

Member Function Documentation

◆ getAddressSpace()

LangAS clang::ExtQuals::getAddressSpace ( ) const
inline

Definition at line 1755 of file Type.h.

◆ getBaseType()

const Type * clang::ExtQuals::getBaseType ( ) const
inline

Definition at line 1757 of file Type.h.

Referenced by clang::QualType::split(), and clang::QualifierCollector::strip().

◆ getObjCGCAttr()

Qualifiers::GC clang::ExtQuals::getObjCGCAttr ( ) const
inline

Definition at line 1747 of file Type.h.

◆ getObjCLifetime()

Qualifiers::ObjCLifetime clang::ExtQuals::getObjCLifetime ( ) const
inline

Definition at line 1750 of file Type.h.

◆ getQualifiers()

Qualifiers clang::ExtQuals::getQualifiers ( ) const
inline

Definition at line 1744 of file Type.h.

Referenced by clang::QualType::split(), and clang::QualifierCollector::strip().

◆ hasAddressSpace()

bool clang::ExtQuals::hasAddressSpace ( ) const
inline

Definition at line 1754 of file Type.h.

◆ hasObjCGCAttr()

bool clang::ExtQuals::hasObjCGCAttr ( ) const
inline

Definition at line 1746 of file Type.h.

◆ hasObjCLifetime()

bool clang::ExtQuals::hasObjCLifetime ( ) const
inline

Definition at line 1749 of file Type.h.

◆ Profile() [1/2]

void clang::ExtQuals::Profile ( llvm::FoldingSetNodeID &  ID) const
inline

Definition at line 1760 of file Type.h.

References ID.

◆ Profile() [2/2]

static void clang::ExtQuals::Profile ( llvm::FoldingSetNodeID &  ID,
const Type BaseType,
Qualifiers  Quals 
)
inlinestatic

Definition at line 1764 of file Type.h.

References clang::Qualifiers::hasFastQualifiers(), ID, and clang::Qualifiers::Profile().


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