clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Friends
clang::DeclarationName Class Reference

#include <DeclarationName.h>

List of all members.

Public Types

enum  NameKind {
  Identifier, ObjCZeroArgSelector, ObjCOneArgSelector, ObjCMultiArgSelector,
  CXXConstructorName, CXXDestructorName, CXXConversionFunctionName, CXXOperatorName,
  CXXLiteralOperatorName, CXXUsingDirective
}
 NameKind - The kind of name this object contains. More...

Public Member Functions

 DeclarationName ()
 DeclarationName - Used to create an empty selector.
 DeclarationName (const IdentifierInfo *II)
 DeclarationName (Selector Sel)
 operator bool () const
bool isIdentifier () const
 Predicate functions for querying what type of name this is.
bool isObjCZeroArgSelector () const
bool isObjCOneArgSelector () const
NameKind getNameKind () const
 getNameKind - Determine what kind of name this is.
bool isDependentName () const
 Determines whether the name itself is dependent, e.g., because it involves a C++ type that is itself dependent.
std::string getAsString () const
 getNameAsString - Retrieve the human-readable string for this name.
void printName (raw_ostream &OS) const
 printName - Print the human-readable name to a stream.
IdentifierInfogetAsIdentifierInfo () const
uintptr_t getAsOpaqueInteger () const
void * getAsOpaquePtr () const
QualType getCXXNameType () const
OverloadedOperatorKind getCXXOverloadedOperator () const
IdentifierInfogetCXXLiteralIdentifier () const
Selector getObjCSelector () const
template<typename T >
T * getFETokenInfo () const
void setFETokenInfo (void *T)
void dump () const

Static Public Member Functions

static DeclarationName getUsingDirectiveName ()
 getUsingDirectiveName - Return name for all using-directives.
static DeclarationName getFromOpaquePtr (void *P)
static DeclarationName getFromOpaqueInteger (uintptr_t P)
static DeclarationName getEmptyMarker ()
static DeclarationName getTombstoneMarker ()
static int compare (DeclarationName LHS, DeclarationName RHS)

Friends

class DeclarationNameTable
class NamedDecl
bool operator== (DeclarationName LHS, DeclarationName RHS)
 operator== - Determine whether the specified names are identical..
bool operator!= (DeclarationName LHS, DeclarationName RHS)
 operator!= - Determine whether the specified names are different.

Detailed Description

DeclarationName - 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) and special C++ names for constructors, destructors, and conversion functions.

Definition at line 41 of file DeclarationName.h.


Member Enumeration Documentation

NameKind - The kind of name this object contains.

Enumerator:
Identifier 
ObjCZeroArgSelector 
ObjCOneArgSelector 
ObjCMultiArgSelector 
CXXConstructorName 
CXXDestructorName 
CXXConversionFunctionName 
CXXOperatorName 
CXXLiteralOperatorName 
CXXUsingDirective 

Definition at line 44 of file DeclarationName.h.


Constructor & Destructor Documentation

clang::DeclarationName::DeclarationName ( ) [inline]

DeclarationName - Used to create an empty selector.

Definition at line 161 of file DeclarationName.h.

Referenced by getEmptyMarker(), getTombstoneMarker(), and getUsingDirectiveName().

clang::DeclarationName::DeclarationName ( const IdentifierInfo II) [inline]

Definition at line 164 of file DeclarationName.h.

DeclarationName::DeclarationName ( Selector  Sel)

Member Function Documentation

int clang::DeclarationName::compare ( DeclarationName  LHS,
DeclarationName  RHS 
) [static]
void DeclarationName::dump ( ) const

Definition at line 379 of file DeclarationName.cpp.

References printName().

IdentifierInfo* clang::DeclarationName::getAsIdentifierInfo ( ) const [inline]

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

Definition at line 211 of file DeclarationName.h.

References isIdentifier().

Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnVariableDeclarator(), clang::IdentifierResolver::AddDecl(), clang::ASTWriter::AddDeclarationName(), clang::IdentifierResolver::begin(), CalculateHiddenNames(), clang::Sema::CheckFieldDecl(), compare(), clang::Sema::CorrectTypo(), clang::UnresolvedUsingTypenameDecl::Create(), CreateNewFunctionDecl(), DiagnoseInvalidRedeclaration(), clang::TypoCorrection::getCorrectionAsIdentifierInfo(), clang::idx::EntityImpl::getDecl(), clang::NamedDecl::getIdentifier(), clang::serialization::reader::ASTDeclContextNameLookupTrait::GetInternalKey(), getOrderedName(), clang::Sema::HandleExprPropertyRefExpr(), clang::Sema::HandlePropertyInClassExtension(), clang::ASTImporter::Import(), clang::IdentifierResolver::InsertDeclAfter(), LookupBuiltin(), clang::IdentifierResolver::RemoveDecl(), setFETokenInfo(), clang::IdentifierResolver::tryAddTopLevelDecl(), clang::ASTNodeImporter::VisitClassTemplateDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitImplicitParamDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::idx::EntityGetter::VisitNamedDecl(), clang::ASTNodeImporter::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitNonTypeTemplateParmDecl(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), clang::ASTNodeImporter::VisitObjCInterfaceDecl(), clang::ASTNodeImporter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), clang::ASTNodeImporter::VisitObjCProtocolDecl(), clang::ASTNodeImporter::VisitParmVarDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitTemplateTemplateParmDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), and clang::ASTNodeImporter::VisitVarDecl().

uintptr_t clang::DeclarationName::getAsOpaqueInteger ( ) const [inline]

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

Definition at line 219 of file DeclarationName.h.

Referenced by clang::operator<<().

void* clang::DeclarationName::getAsOpaquePtr ( ) const [inline]

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

Definition at line 223 of file DeclarationName.h.

Referenced by llvm::DenseMapInfo< clang::DeclarationName >::getHashValue(), clang::Sema::LookupQualifiedName(), and clang::idx::EntityImpl::Profile().

std::string DeclarationName::getAsString ( ) const
IdentifierInfo * DeclarationName::getCXXLiteralIdentifier ( ) const
QualType DeclarationName::getCXXNameType ( ) const
OverloadedOperatorKind DeclarationName::getCXXOverloadedOperator ( ) const
static DeclarationName clang::DeclarationName::getEmptyMarker ( ) [inline, static]
template<typename T >
T* clang::DeclarationName::getFETokenInfo ( ) const [inline]

getFETokenInfo/setFETokenInfo - 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.

Definition at line 260 of file DeclarationName.h.

Referenced by clang::IdentifierResolver::AddDecl(), clang::IdentifierResolver::begin(), clang::IdentifierResolver::iterator::incrementSlowCase(), clang::IdentifierResolver::InsertDeclAfter(), clang::IdentifierResolver::IdDeclInfoMap::operator[](), clang::IdentifierResolver::RemoveDecl(), and clang::IdentifierResolver::tryAddTopLevelDecl().

static DeclarationName clang::DeclarationName::getFromOpaqueInteger ( uintptr_t  P) [inline, static]

Definition at line 231 of file DeclarationName.h.

Referenced by clang::FormatASTNodeDiagnosticArgument().

static DeclarationName clang::DeclarationName::getFromOpaquePtr ( void *  P) [inline, static]
DeclarationName::NameKind DeclarationName::getNameKind ( ) const

getNameKind - Determine what kind of name this is.

Definition at line 161 of file DeclarationName.cpp.

References clang::DeclarationNameExtra::CXXConstructor, CXXConstructorName, clang::DeclarationNameExtra::CXXConversionFunction, CXXConversionFunctionName, clang::DeclarationNameExtra::CXXDestructor, CXXDestructorName, CXXLiteralOperatorName, CXXOperatorName, CXXUsingDirective, Identifier, ObjCMultiArgSelector, ObjCOneArgSelector, and ObjCZeroArgSelector.

Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIdExpression(), clang::ASTWriter::AddDeclarationName(), clang::ASTWriter::AddDeclarationNameLoc(), clang::Sema::BuildUsingDeclaration(), compare(), computeDeclRefDependence(), clang::DeclarationNameInfo::containsUnexpandedParameterPack(), clang::CXXConstructorDecl::Create(), clang::CXXDestructorDecl::Create(), clang::CXXConversionDecl::Create(), CreateNewFunctionDecl(), clang::DeclarationNameLoc::DeclarationNameLoc(), DeclareImplicitMemberFunctionsWithName(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::DiagnoseHiddenVirtualMethods(), clang::Sema::DiagnoseUnexpandedParameterPack(), FindHiddenVirtualMethod(), FindOverriddenMethod(), clang::DeclarationNameInfo::getEndLoc(), clang::serialization::reader::ASTDeclContextNameLookupTrait::GetInternalKey(), getObjCSelector(), clang::Sema::HandleDeclarator(), clang::Sema::HandleExprPropertyRefExpr(), clang::Sema::HideUsingShadowDecl(), clang::ASTImporter::Import(), clang::ASTNodeImporter::ImportDeclarationNameLoc(), isImplicitlyDeclaredMemberFunctionName(), clang::DeclarationNameInfo::isInstantiationDependent(), LookupDirect(), clang::DeclarationNameInfo::printName(), clang::ASTReader::ReadDeclarationNameLoc(), setFETokenInfo(), clang::TreeTransform< Derived >::TransformDeclarationNameInfo(), clang::RecursiveASTVisitor< Derived >::TraverseDeclarationNameInfo(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), and clang::ASTDeclWriter::VisitVarDecl().

Selector DeclarationName::getObjCSelector ( ) const
static DeclarationName clang::DeclarationName::getTombstoneMarker ( ) [inline, static]
DeclarationName DeclarationName::getUsingDirectiveName ( ) [static]

getUsingDirectiveName - Return name for all using-directives.

Definition at line 368 of file DeclarationName.cpp.

References DeclarationName().

Referenced by clang::serialization::reader::ASTDeclContextNameLookupTrait::GetExternalKey(), clang::ASTImporter::Import(), and clang::ASTReader::ReadDeclarationName().

bool DeclarationName::isDependentName ( ) const

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.

Definition at line 198 of file DeclarationName.cpp.

References getCXXNameType(), and clang::QualType::isNull().

Referenced by clang::Sema::ActOnDependentMemberExpr(), clang::Sema::ActOnMemberAccessExpr(), and clang::Sema::CheckMicrosoftIfExistsSymbol().

bool clang::DeclarationName::isIdentifier ( ) const [inline]

Predicate functions for querying what type of name this is.

Definition at line 183 of file DeclarationName.h.

Referenced by getAsIdentifierInfo(), and clang::NamedDecl::getName().

bool clang::DeclarationName::isObjCOneArgSelector ( ) const [inline]

Definition at line 187 of file DeclarationName.h.

bool clang::DeclarationName::isObjCZeroArgSelector ( ) const [inline]

Definition at line 184 of file DeclarationName.h.

Referenced by getOrderedName().

clang::DeclarationName::operator bool ( ) const [inline]

Definition at line 177 of file DeclarationName.h.

void clang::DeclarationName::printName ( raw_ostream &  OS) const
void DeclarationName::setFETokenInfo ( void *  T)

Friends And Related Function Documentation

friend class DeclarationNameTable [friend]

Definition at line 152 of file DeclarationName.h.

friend class NamedDecl [friend]

Definition at line 153 of file DeclarationName.h.

bool operator!= ( DeclarationName  LHS,
DeclarationName  RHS 
) [friend]

operator!= - Determine whether the specified names are different.

Definition at line 270 of file DeclarationName.h.

bool operator== ( DeclarationName  LHS,
DeclarationName  RHS 
) [friend]

operator== - Determine whether the specified names are identical..

Definition at line 265 of file DeclarationName.h.


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