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
- public DeclarationName(clang::Selector Sel)
- private DeclarationName(detail::DeclarationNameExtra * Name)
- private DeclarationName(detail::CXXSpecialNameExtra * Name, clang::DeclarationName::StoredNameKind StoredKind)
- private DeclarationName(detail::CXXOperatorIdName * Name)
- public DeclarationName(const clang::IdentifierInfo * II)
- public DeclarationName()
- private detail::CXXDeductionGuideNameExtra * castAsCXXDeductionGuideNameExtra() const
- private detail::CXXLiteralOperatorIdName * castAsCXXLiteralOperatorIdName() const
- private detail::CXXOperatorIdName * castAsCXXOperatorIdName() const
- private detail::CXXSpecialNameExtra * castAsCXXSpecialNameExtra() const
- private detail::DeclarationNameExtra * castAsExtra() const
- private clang::IdentifierInfo * castAsIdentifierInfo() const
- public static int compare(clang::DeclarationName LHS, clang::DeclarationName RHS)
- public void dump() const
- public clang::IdentifierInfo * getAsIdentifierInfo() const
- public uintptr_t getAsOpaqueInteger() const
- public void * getAsOpaquePtr() const
- public std::string getAsString() const
- public clang::TemplateDecl * getCXXDeductionGuideTemplate() const
- public clang::IdentifierInfo * getCXXLiteralIdentifier() const
- public clang::QualType getCXXNameType() const
- public clang::OverloadedOperatorKind getCXXOverloadedOperator() const
- public static clang::DeclarationName getEmptyMarker()
- public void * getFETokenInfo() const
- private void * getFETokenInfoSlow() const
- public static clang::DeclarationName getFromOpaqueInteger(uintptr_t P)
- public static clang::DeclarationName getFromOpaquePtr(void * P)
- public clang::DeclarationName::NameKind getNameKind() const
- public clang::Selector getObjCSelector() const
- private void * getPtr() const
- private clang::DeclarationName::StoredNameKind getStoredNameKind() const
- public static clang::DeclarationName getTombstoneMarker()
- public static clang::DeclarationName getUsingDirectiveName()
- public bool isDependentName() const
- public bool isEmpty() const
- public bool isIdentifier() const
- public bool isObjCOneArgSelector() const
- public bool isObjCZeroArgSelector() const
- public bool operator bool() const
- public void print(llvm::raw_ostream & OS, const clang::PrintingPolicy & Policy) const
- public void setFETokenInfo(void * T)
- private void setFETokenInfoSlow(void * T)
- private void setPtrAndKind(const void * P, clang::DeclarationName::StoredNameKind Kind)
Methods
¶DeclarationName(clang::Selector Sel)
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)
DeclarationName(
detail::DeclarationNameExtra* Name)
Description
Construct a declaration name from a DeclarationNameExtra.
Declared at: clang/include/clang/AST/DeclarationName.h:281
Parameters
¶DeclarationName(
detail::CXXSpecialNameExtra* Name,
clang::DeclarationName::StoredNameKind
StoredKind)
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)
DeclarationName(detail::CXXOperatorIdName* Name)
Description
Construct a DeclarationName from a CXXOperatorIdName.
Declared at: clang/include/clang/AST/DeclarationName.h:297
Parameters
¶DeclarationName(const clang::IdentifierInfo* II)
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()
DeclarationName()
Description
Construct an empty declaration name.
Declared at: clang/include/clang/AST/DeclarationName.h:357
¶detail::CXXDeductionGuideNameExtra*
castAsCXXDeductionGuideNameExtra() const
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
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
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
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
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
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)
static int compare(clang::DeclarationName LHS,
clang::DeclarationName RHS)
Declared at: clang/include/clang/AST/DeclarationName.h:538
Parameters
¶void dump() const
void dump() const
Declared at: clang/include/clang/AST/DeclarationName.h:542
¶clang::IdentifierInfo* getAsIdentifierInfo() const
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
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
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
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
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
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
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
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()
static clang::DeclarationName getEmptyMarker()
Declared at: clang/include/clang/AST/DeclarationName.h:526
¶void* getFETokenInfo() const
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
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)
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)
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
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
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
void* getPtr() const
Declared at: clang/include/clang/AST/DeclarationName.h:269
¶clang::DeclarationName::StoredNameKind
getStoredNameKind() const
clang::DeclarationName::StoredNameKind
getStoredNameKind() const
Declared at: clang/include/clang/AST/DeclarationName.h:265
¶static clang::DeclarationName getTombstoneMarker()
static clang::DeclarationName getTombstoneMarker()
Declared at: clang/include/clang/AST/DeclarationName.h:532
¶static clang::DeclarationName
getUsingDirectiveName()
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
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
bool isEmpty() const
Description
Evaluates true when this declaration name is empty.
Declared at: clang/include/clang/AST/DeclarationName.h:381
¶bool isIdentifier() const
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
bool isObjCOneArgSelector() const
Declared at: clang/include/clang/AST/DeclarationName.h:388
¶bool isObjCZeroArgSelector() const
bool isObjCZeroArgSelector() const
Declared at: clang/include/clang/AST/DeclarationName.h:385
¶bool operator bool() const
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
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)
void setFETokenInfo(void* T)
Declared at: clang/include/clang/AST/DeclarationName.h:508
Parameters
- void* T
¶void setFETokenInfoSlow(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)
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