class Qualifiers

Declaration

class Qualifiers { /* full declaration omitted */ };

Description

The collection of all-type qualifiers we support. Clang supports five independent qualifiers: * C99: const, volatile, and restrict * MS: __unaligned * Embedded C (TR18037): address spaces * Objective C: the GC attributes (none, weak, or strong)

Declared at: clang/include/clang/AST/Type.h:147

Member Variables

private uint32_t Mask = 0
private static const uint32_t UMask = 8
private static const uint32_t UShift = 3
private static const uint32_t GCAttrMask = 48
private static const uint32_t GCAttrShift = 4
private static const uint32_t LifetimeMask = 448
private static const uint32_t LifetimeShift = 6
private static const uint32_t AddressSpaceMask = ~(CVRMask | UMask | GCAttrMask | LifetimeMask)
private static const uint32_t AddressSpaceShift = 9

Method Overview

Methods

void Profile(llvm::FoldingSetNodeID& ID) const

Declared at: clang/include/clang/AST/Type.h:607

Parameters

llvm::FoldingSetNodeID& ID

void addAddressSpace(clang::LangAS space)

Declared at: clang/include/clang/AST/Type.h:404

Parameters

clang::LangAS space

void addCVRQualifiers(unsigned int mask)

Declared at: clang/include/clang/AST/Type.h:309

Parameters

unsigned int mask

void addCVRUQualifiers(unsigned int mask)

Declared at: clang/include/clang/AST/Type.h:313

Parameters

unsigned int mask

void addConsistentQualifiers(clang::Qualifiers qs)

Description

Add the qualifiers from the given set to this set, given that they don't conflict.

Declared at: clang/include/clang/AST/Type.h:478

Parameters

clang::Qualifiers qs

void addConst()

Declared at: clang/include/clang/AST/Type.h:267

void addFastQualifiers(unsigned int mask)

Declared at: clang/include/clang/AST/Type.h:424

Parameters

unsigned int mask

void addObjCGCAttr(clang::Qualifiers::GC type)

Declared at: clang/include/clang/AST/Type.h:331

Parameters

clang::Qualifiers::GC type

void addObjCLifetime(
    clang::Qualifiers::ObjCLifetime type)

Declared at: clang/include/clang/AST/Type.h:359

Parameters

clang::Qualifiers::ObjCLifetime type

void addQualifiers(clang::Qualifiers Q)

Description

Add the qualifiers from the given set to this set.

Declared at: clang/include/clang/AST/Type.h:443

Parameters

clang::Qualifiers Q

void addRestrict()

Declared at: clang/include/clang/AST/Type.h:287

void addUnaligned()

Declared at: clang/include/clang/AST/Type.h:323

void addVolatile()

Declared at: clang/include/clang/AST/Type.h:277

bool compatiblyIncludes(
    clang::Qualifiers other) const

Description

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.

Declared at: clang/include/clang/AST/Type.h:532

Parameters

clang::Qualifiers other

bool compatiblyIncludesObjCLifetime(
    clang::Qualifiers other) const

Description

Determines if these qualifiers compatibly include another set of qualifiers from the narrow perspective of Objective-C ARC lifetime. One set of Objective-C lifetime qualifiers compatibly includes the other if the lifetime qualifiers match, or if both are non-__weak and the including set also contains the 'const' qualifier, or both are non-__weak and one is None (which can only happen in non-ARC modes).

Declared at: clang/include/clang/AST/Type.h:553

Parameters

clang::Qualifiers other

bool empty() const

Declared at: clang/include/clang/AST/Type.h:440

static clang::Qualifiers fromCVRMask(
    unsigned int CVR)

Declared at: clang/include/clang/AST/Type.h:240

Parameters

unsigned int CVR

static clang::Qualifiers fromCVRUMask(
    unsigned int CVRU)

Declared at: clang/include/clang/AST/Type.h:246

Parameters

unsigned int CVRU

static clang::Qualifiers fromFastMask(
    unsigned int Mask)

Declared at: clang/include/clang/AST/Type.h:234

Parameters

unsigned int Mask

static clang::Qualifiers fromOpaqueValue(
    unsigned int opaque)

Declared at: clang/include/clang/AST/Type.h:253

Parameters

unsigned int opaque

static std::string getAddrSpaceAsString(
    clang::LangAS AS)

Declared at: clang/include/clang/AST/Type.h:601

Parameters

clang::LangAS AS

clang::LangAS getAddressSpace() const

Declared at: clang/include/clang/AST/Type.h:378

unsigned int getAddressSpaceAttributePrintValue()
    const

Description

Get the address space attribute value to be printed by diagnostics.

Declared at: clang/include/clang/AST/Type.h:385

unsigned int getAsOpaqueValue() const

Declared at: clang/include/clang/AST/Type.h:260

std::string getAsString() const

Declared at: clang/include/clang/AST/Type.h:598

std::string getAsString(
    const clang::PrintingPolicy& Policy) const

Declared at: clang/include/clang/AST/Type.h:599

Parameters

const clang::PrintingPolicy& Policy

unsigned int getCVRQualifiers() const

Declared at: clang/include/clang/AST/Type.h:295

unsigned int getCVRUQualifiers() const

Declared at: clang/include/clang/AST/Type.h:296

unsigned int getFastQualifiers() const

Declared at: clang/include/clang/AST/Type.h:412

clang::Qualifiers getNonFastQualifiers() const

Declared at: clang/include/clang/AST/Type.h:432

clang::Qualifiers::GC getObjCGCAttr() const

Declared at: clang/include/clang/AST/Type.h:326

clang::Qualifiers::ObjCLifetime getObjCLifetime()
    const

Declared at: clang/include/clang/AST/Type.h:352

bool hasAddressSpace() const

Declared at: clang/include/clang/AST/Type.h:377

bool hasCVRQualifiers() const

Declared at: clang/include/clang/AST/Type.h:294

bool hasConst() const

Declared at: clang/include/clang/AST/Type.h:264

bool hasFastQualifiers() const

Declared at: clang/include/clang/AST/Type.h:411

bool hasNonFastQualifiers() const

Description

Return true if the set contains any qualifiers which require an ExtQuals node to be allocated.

Declared at: clang/include/clang/AST/Type.h:431

bool hasNonTrivialObjCLifetime() const

Description

True if the lifetime is neither None or ExplicitNone.

Declared at: clang/include/clang/AST/Type.h:366

bool hasObjCGCAttr() const

Declared at: clang/include/clang/AST/Type.h:325

bool hasObjCLifetime() const

Declared at: clang/include/clang/AST/Type.h:351

bool hasOnlyConst() const

Declared at: clang/include/clang/AST/Type.h:265

bool hasOnlyRestrict() const

Declared at: clang/include/clang/AST/Type.h:285

bool hasOnlyVolatile() const

Declared at: clang/include/clang/AST/Type.h:275

bool hasQualifiers() const

Description

Return true if the set contains any qualifiers.

Declared at: clang/include/clang/AST/Type.h:439

bool hasRestrict() const

Declared at: clang/include/clang/AST/Type.h:284

bool hasStrongOrWeakObjCLifetime() const

Description

True if the lifetime is either strong or weak.

Declared at: clang/include/clang/AST/Type.h:372

bool hasTargetSpecificAddressSpace() const

Declared at: clang/include/clang/AST/Type.h:381

bool hasUnaligned() const

Declared at: clang/include/clang/AST/Type.h:318

bool hasVolatile() const

Declared at: clang/include/clang/AST/Type.h:274

bool isAddressSpaceSupersetOf(
    clang::Qualifiers other) const

Description

Returns true if the address space in these qualifiers is equal to or a superset of the address space in the argument qualifiers.

Declared at: clang/include/clang/AST/Type.h:525

Parameters

clang::Qualifiers other

static bool isAddressSpaceSupersetOf(
    clang::LangAS A,
    clang::LangAS B)

Description

Returns true if address space A is equal to or a superset of B. 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.

Declared at: clang/include/clang/AST/Type.h:495

Parameters

clang::LangAS A
clang::LangAS B

bool isEmptyWhenPrinted(
    const clang::PrintingPolicy& Policy) const

Declared at: clang/include/clang/AST/Type.h:603

Parameters

const clang::PrintingPolicy& Policy

bool isStrictSupersetOf(
    clang::Qualifiers Other) const

Description

Determine whether this set of qualifiers is a strict superset of another set of qualifiers, not considering qualifier compatibility.

Declared at: clang/include/clang/AST/Type.h:568

Parameters

clang::Qualifiers Other

bool operator bool() const

Declared at: clang/include/clang/AST/Type.h:573

void print(
    llvm::raw_ostream& OS,
    const clang::PrintingPolicy& Policy,
    bool appendSpaceIfNonEmpty = false) const

Declared at: clang/include/clang/AST/Type.h:604

Parameters

llvm::raw_ostream& OS
const clang::PrintingPolicy& Policy
bool appendSpaceIfNonEmpty = false

void removeAddressSpace()

Declared at: clang/include/clang/AST/Type.h:403

void removeCVRQualifiers()

Declared at: clang/include/clang/AST/Type.h:306

void removeCVRQualifiers(unsigned int mask)

Declared at: clang/include/clang/AST/Type.h:302

Parameters

unsigned int mask

static clang::Qualifiers removeCommonQualifiers(
    clang::Qualifiers& L,
    clang::Qualifiers& R)

Description

Returns the common set of qualifiers while removing them from the given sets.

Declared at: clang/include/clang/AST/Type.h:198

Parameters

clang::Qualifiers& L
clang::Qualifiers& R

void removeConst()

Declared at: clang/include/clang/AST/Type.h:266

void removeFastQualifiers()

Declared at: clang/include/clang/AST/Type.h:421

void removeFastQualifiers(unsigned int mask)

Declared at: clang/include/clang/AST/Type.h:417

Parameters

unsigned int mask

void removeObjCGCAttr()

Declared at: clang/include/clang/AST/Type.h:330

void removeObjCLifetime()

Declared at: clang/include/clang/AST/Type.h:358

void removeQualifiers(clang::Qualifiers Q)

Description

Remove the qualifiers from the given set from this set.

Declared at: clang/include/clang/AST/Type.h:460

Parameters

clang::Qualifiers Q

void removeRestrict()

Declared at: clang/include/clang/AST/Type.h:286

void removeUnaligned()

Declared at: clang/include/clang/AST/Type.h:322

void removeVolatile()

Declared at: clang/include/clang/AST/Type.h:276

void setAddressSpace(clang::LangAS space)

Declared at: clang/include/clang/AST/Type.h:398

Parameters

clang::LangAS space

void setCVRQualifiers(unsigned int mask)

Declared at: clang/include/clang/AST/Type.h:298

Parameters

unsigned int mask

void setFastQualifiers(unsigned int mask)

Declared at: clang/include/clang/AST/Type.h:413

Parameters

unsigned int mask

void setObjCGCAttr(clang::Qualifiers::GC type)

Declared at: clang/include/clang/AST/Type.h:327

Parameters

clang::Qualifiers::GC type

void setObjCLifetime(
    clang::Qualifiers::ObjCLifetime type)

Declared at: clang/include/clang/AST/Type.h:355

Parameters

clang::Qualifiers::ObjCLifetime type

void setUnaligned(bool flag)

Declared at: clang/include/clang/AST/Type.h:319

Parameters

bool flag

clang::Qualifiers withConst() const

Declared at: clang/include/clang/AST/Type.h:268

clang::Qualifiers withRestrict() const

Declared at: clang/include/clang/AST/Type.h:288

clang::Qualifiers withVolatile() const

Declared at: clang/include/clang/AST/Type.h:278

clang::Qualifiers withoutAddressSpace() const

Declared at: clang/include/clang/AST/Type.h:345

clang::Qualifiers withoutObjCGCAttr() const

Declared at: clang/include/clang/AST/Type.h:335

clang::Qualifiers withoutObjCLifetime() const

Declared at: clang/include/clang/AST/Type.h:340