class DeclarationName

Declaration

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

Description

The name of a declaration. In the common case, this just stores an IdentifierInfo pointer to a normal name. However, it also provides encodings for Objective-C selectors (optimizing zero- and one-argument selectors, which make up 78% percent of all selectors in Cocoa.h), special C++ names for constructors, destructors, and conversion functions, and C++ overloaded operators.

Declared at: clang/include/clang/AST/DeclarationName.h:144

Member Variables

private uintptr_t Ptr = 0
StoredDeclarationNameExtra - Ptr is actually a pointer to a DeclarationNameExtra structure, whose first value will tell us whether this is an Objective-C selector, C++ deduction guide, C++ literal operator, or C++ using directive.

Method Overview

Methods

DeclarationName(clang::Selector Sel)

Description

Construct a declaration name from an Objective-C selector.

Declared at: clang/include/clang/AST/DeclarationName.h:365

Parameters

clang::Selector Sel

DeclarationName(
    detail::DeclarationNameExtra* Name)

Description

Construct a declaration name from a DeclarationNameExtra.

Declared at: clang/include/clang/AST/DeclarationName.h:281

Parameters

detail::DeclarationNameExtra* Name

DeclarationName(
    detail::CXXSpecialNameExtra* Name,
    clang::DeclarationName::StoredNameKind
        StoredKind)

Description

Construct a declaration name from a CXXSpecialNameExtra.

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

Parameters

detail::CXXSpecialNameExtra* Name
clang::DeclarationName::StoredNameKind StoredKind

DeclarationName(detail::CXXOperatorIdName* Name)

Description

Construct a DeclarationName from a CXXOperatorIdName.

Declared at: clang/include/clang/AST/DeclarationName.h:297

Parameters

detail::CXXOperatorIdName* Name

DeclarationName(const clang::IdentifierInfo* II)

Description

Construct a declaration name from an IdentifierInfo *.

Declared at: clang/include/clang/AST/DeclarationName.h:360

Parameters

const clang::IdentifierInfo* II

DeclarationName()

Description

Construct an empty declaration name.

Declared at: clang/include/clang/AST/DeclarationName.h:357

detail::CXXDeductionGuideNameExtra*
castAsCXXDeductionGuideNameExtra() const

Description

Assert that the stored pointer points to a CXXDeductionGuideNameExtra and return it.

Declared at: clang/include/clang/AST/DeclarationName.h:336

detail::CXXLiteralOperatorIdName*
castAsCXXLiteralOperatorIdName() const

Description

Assert that the stored pointer points to a CXXLiteralOperatorIdName and return it.

Declared at: clang/include/clang/AST/DeclarationName.h:344

detail::CXXOperatorIdName*
castAsCXXOperatorIdName() const

Description

Assert that the stored pointer points to a CXXOperatorIdName and return it.

Declared at: clang/include/clang/AST/DeclarationName.h:328

detail::CXXSpecialNameExtra*
castAsCXXSpecialNameExtra() const

Description

Assert that the stored pointer points to a CXXSpecialNameExtra and return it.

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

detail::DeclarationNameExtra* castAsExtra() const

Description

Assert that the stored pointer points to a DeclarationNameExtra and return it.

Declared at: clang/include/clang/AST/DeclarationName.h:310

clang::IdentifierInfo* castAsIdentifierInfo()
    const

Description

Assert that the stored pointer points to an IdentifierInfo and return it.

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

static int compare(clang::DeclarationName LHS,
                   clang::DeclarationName RHS)

Declared at: clang/include/clang/AST/DeclarationName.h:538

Parameters

clang::DeclarationName LHS
clang::DeclarationName RHS

void dump() const

Declared at: clang/include/clang/AST/DeclarationName.h:542

clang::IdentifierInfo* getAsIdentifierInfo() const

Description

Retrieve the IdentifierInfo * stored in this declaration name, or null if this declaration name isn't a simple identifier.

Declared at: clang/include/clang/AST/DeclarationName.h:419

uintptr_t getAsOpaqueInteger() const

Description

Get the representation of this declaration name as an opaque integer.

Declared at: clang/include/clang/AST/DeclarationName.h:426

void* getAsOpaquePtr() const

Description

Get the representation of this declaration name as an opaque pointer.

Declared at: clang/include/clang/AST/DeclarationName.h:429

std::string getAsString() const

Description

Retrieve the human-readable string for this name.

Declared at: clang/include/clang/AST/DeclarationName.h:415

clang::TemplateDecl*
getCXXDeductionGuideTemplate() const

Description

If this name is the name of a C++ deduction guide, return the template associated with that name.

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

clang::IdentifierInfo* getCXXLiteralIdentifier()
    const

Description

If this name is the name of a literal operator, retrieve the identifier associated with it.

Declared at: clang/include/clang/AST/DeclarationName.h:481

clang::QualType getCXXNameType() const

Description

If this name is one of the C++ names (of a constructor, destructor, or conversion function), return the type associated with that name.

Declared at: clang/include/clang/AST/DeclarationName.h:448

clang::OverloadedOperatorKind
getCXXOverloadedOperator() const

Description

If this name is the name of an overloadable operator in C++ (e.g., @c operator+), retrieve the kind of overloaded operator.

Declared at: clang/include/clang/AST/DeclarationName.h:471

static clang::DeclarationName getEmptyMarker()

Declared at: clang/include/clang/AST/DeclarationName.h:526

void* getFETokenInfo() const

Description

Get and set FETokenInfo. The language front-end is allowed to associate arbitrary metadata with some kinds of declaration names, including normal identifiers and C++ constructors, destructors, and conversion functions.

Declared at: clang/include/clang/AST/DeclarationName.h:501

void* getFETokenInfoSlow() const

Description

Get and set the FETokenInfo in the less common cases where the declaration name do not point to an identifier.

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

static clang::DeclarationName
getFromOpaqueInteger(uintptr_t P)

Description

Get a declaration name from an opaque integer returned by getAsOpaqueInteger.

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

Parameters

uintptr_t P

static clang::DeclarationName getFromOpaquePtr(
    void* P)

Description

Get a declaration name from an opaque pointer returned by getAsOpaquePtr.

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

Parameters

void* P

clang::DeclarationName::NameKind getNameKind()
    const

Description

Determine what kind of name this is.

Declared at: clang/include/clang/AST/DeclarationName.h:393

clang::Selector getObjCSelector() const

Description

Get the Objective-C selector stored in this declaration name.

Declared at: clang/include/clang/AST/DeclarationName.h:490

void* getPtr() const

Declared at: clang/include/clang/AST/DeclarationName.h:269

clang::DeclarationName::StoredNameKind
getStoredNameKind() const

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

static clang::DeclarationName getTombstoneMarker()

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

static clang::DeclarationName
getUsingDirectiveName()

Description

Returns the name for all C++ using-directives.

Declared at: clang/include/clang/AST/DeclarationName.h:368

bool isDependentName() const

Description

Determines whether the name itself is dependent, e.g., because it involves a C++ type that is itself dependent. Note that this does not capture all of the notions of "dependent name", because an identifier can be a dependent name if it is used as the callee in a call expression with dependent arguments.

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

bool isEmpty() const

Description

Evaluates true when this declaration name is empty.

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

bool isIdentifier() const

Description

Predicate functions for querying what type of name this is.

Declared at: clang/include/clang/AST/DeclarationName.h:384

bool isObjCOneArgSelector() const

Declared at: clang/include/clang/AST/DeclarationName.h:388

bool isObjCZeroArgSelector() const

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

bool operator bool() const

Description

Evaluates true when this declaration name is non-empty.

Declared at: clang/include/clang/AST/DeclarationName.h:376

void print(
    llvm::raw_ostream& OS,
    const clang::PrintingPolicy& Policy) const

Declared at: clang/include/clang/AST/DeclarationName.h:540

Parameters

llvm::raw_ostream& OS
const clang::PrintingPolicy& Policy

void setFETokenInfo(void* T)

Declared at: clang/include/clang/AST/DeclarationName.h:508

Parameters

void* T

void setFETokenInfoSlow(void* T)

Declared at: clang/include/clang/AST/DeclarationName.h:353

Parameters

void* T

void setPtrAndKind(
    const void* P,
    clang::DeclarationName::StoredNameKind Kind)

Declared at: clang/include/clang/AST/DeclarationName.h:271

Parameters

const void* P
clang::DeclarationName::StoredNameKind Kind