clang API Documentation
#include <DeclarationName.h>
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) | |
LLVM_EXPLICIT | operator bool () const |
bool | isEmpty () const |
Evaluates true when this declaration name is empty. | |
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. | |
IdentifierInfo * | getAsIdentifierInfo () const |
uintptr_t | getAsOpaqueInteger () const |
void * | getAsOpaquePtr () const |
QualType | getCXXNameType () const |
OverloadedOperatorKind | getCXXOverloadedOperator () const |
IdentifierInfo * | getCXXLiteralIdentifier () 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) |
Static Public Attributes | |
static const unsigned | NumNameKinds = CXXUsingDirective + 1 |
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. |
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 47 of file DeclarationName.h.
NameKind - The kind of name this object contains.
Identifier | |
ObjCZeroArgSelector | |
ObjCOneArgSelector | |
ObjCMultiArgSelector | |
CXXConstructorName | |
CXXDestructorName | |
CXXConversionFunctionName | |
CXXOperatorName | |
CXXLiteralOperatorName | |
CXXUsingDirective |
Definition at line 50 of file DeclarationName.h.
clang::DeclarationName::DeclarationName | ( | ) | [inline] |
DeclarationName - Used to create an empty selector.
Definition at line 171 of file DeclarationName.h.
Referenced by getEmptyMarker(), getTombstoneMarker(), and getUsingDirectiveName().
clang::DeclarationName::DeclarationName | ( | const IdentifierInfo * | II | ) | [inline] |
Definition at line 174 of file DeclarationName.h.
clang::DeclarationName::DeclarationName | ( | Selector | Sel | ) | [inline] |
Definition at line 180 of file DeclarationName.h.
int clang::DeclarationName::compare | ( | DeclarationName | LHS, |
DeclarationName | RHS | ||
) | [static] |
Definition at line 80 of file DeclarationName.cpp.
References clang::compareInt(), CXXConstructorName, CXXConversionFunctionName, CXXDestructorName, CXXLiteralOperatorName, CXXOperatorName, CXXUsingDirective, getAsIdentifierInfo(), getCXXLiteralIdentifier(), getCXXNameType(), getCXXOverloadedOperator(), clang::IdentifierInfo::getName(), clang::Selector::getNameForSlot(), getNameKind(), clang::Selector::getNumArgs(), getObjCSelector(), Identifier, ObjCMultiArgSelector, ObjCOneArgSelector, and ObjCZeroArgSelector.
Referenced by clang::operator<(), clang::operator<=(), clang::operator>(), and clang::operator>=().
void DeclarationName::dump | ( | ) | const |
Definition at line 336 of file DeclarationName.cpp.
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 223 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(), clang::Sema::CheckTemplateTypeArgument(), compare(), clang::Sema::CorrectTypo(), clang::Sema::CorrectTypoDelayed(), clang::UnresolvedUsingTypenameDecl::Create(), CreateNewFunctionDecl(), DiagnoseDirectIsaAccess(), DiagnoseInvalidRedeclaration(), clang::TypoCorrection::getCorrectionAsIdentifierInfo(), getFETokenInfo(), clang::NamedDecl::getIdentifier(), clang::serialization::reader::ASTDeclContextNameLookupTrait::GetInternalKey(), getOrderedName(), clang::Sema::HandleExprPropertyRefExpr(), clang::Sema::HandlePropertyInClassExtension(), clang::ASTImporter::Import(), clang::IdentifierResolver::InsertDeclAfter(), isCXXSharedPtrDtor(), 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::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(), clang::ASTNodeImporter::VisitVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
uintptr_t clang::DeclarationName::getAsOpaqueInteger | ( | ) | const [inline] |
getAsOpaqueInteger - Get the representation of this declaration name as an opaque integer.
Definition at line 231 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 235 of file DeclarationName.h.
Referenced by llvm::DenseMapInfo< clang::DeclarationName >::getHashValue(), hasMember(), and clang::Sema::LookupQualifiedName().
std::string DeclarationName::getAsString | ( | ) | const |
getNameAsString - Retrieve the human-readable string for this name.
Definition at line 248 of file DeclarationName.cpp.
Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildQualifiedDeclarationNameExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), CalculateHiddenNames(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::CorrectTypo(), clang::Sema::DiagnoseEmptyLookup(), clang::ento::FunctionTextRegion::dumpToStream(), clang::TypoCorrection::getAsString(), clang::NamedDecl::getNameAsString(), getOrderedName(), getPrintableNameForEntity(), LookupMemberExprInRecord(), and clang::Sema::LookupTemplateName().
getCXXLiteralIdentifier - If this name is the name of a literal operator, retrieve the identifier associated with it.
Definition at line 272 of file DeclarationName.cpp.
Referenced by clang::ASTWriter::AddDeclarationName(), clang::Sema::CheckLiteralOperatorDeclaration(), compare(), clang::serialization::reader::ASTDeclContextNameLookupTrait::GetInternalKey(), clang::FunctionDecl::getLiteralIdentifier(), and clang::ASTImporter::Import().
QualType DeclarationName::getCXXNameType | ( | ) | const |
getCXXNameType - If this name is one of the C++ names (of a constructor, destructor, or conversion function), return the type associated with that name.
Definition at line 255 of file DeclarationName.cpp.
Referenced by clang::Sema::ActOnIdExpression(), clang::ASTWriter::AddDeclarationName(), compare(), computeDeclRefDependence(), clang::DeclarationNameInfo::containsUnexpandedParameterPack(), clang::Sema::diagnoseQualifiedDeclaration(), clang::Sema::DiagnoseUnexpandedParameterPack(), clang::ASTImporter::Import(), isDependentName(), clang::DeclarationNameInfo::isInstantiationDependent(), LookupDirect(), and clang::TreeTransform< Derived >::TransformDeclarationNameInfo().
getCXXOverloadedOperator - If this name is the name of an overloadable operator in C++ (e.g., operator+
), retrieve the kind of overloaded operator.
Definition at line 262 of file DeclarationName.cpp.
References clang::DeclarationNameExtra::CXXConversionFunction, and clang::OO_None.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnOpenMPReductionClause(), clang::ASTWriter::AddDeclarationName(), canBeDeclaredInNamespace(), clang::Sema::CheckEquivalentExceptionSpec(), compare(), clang::Sema::DeclareGlobalAllocationFunction(), DeclareImplicitMemberFunctionsWithName(), clang::ASTReader::FindExternalVisibleDeclsByName(), clang::FunctionDecl::getCorrespondingUnsizedGlobalDeallocationFunction(), clang::serialization::reader::ASTDeclContextNameLookupTrait::GetInternalKey(), clang::FunctionDecl::getOverloadedOperator(), clang::hasImplicitExceptionSpec(), clang::ASTImporter::Import(), isImplicitlyDeclaredMemberFunctionName(), and clang::CXXMethodDecl::isStatic().
static DeclarationName clang::DeclarationName::getEmptyMarker | ( | ) | [inline, static] |
Definition at line 296 of file DeclarationName.h.
References DeclarationName().
Referenced by llvm::DenseMapInfo< clang::DeclarationName >::getEmptyKey().
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 278 of file DeclarationName.h.
References getAsIdentifierInfo().
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 243 of file DeclarationName.h.
References P.
Referenced by clang::FormatASTNodeDiagnosticArgument().
static DeclarationName clang::DeclarationName::getFromOpaquePtr | ( | void * | P | ) | [inline, static] |
Definition at line 237 of file DeclarationName.h.
References P.
Referenced by clang::CXXRecordDecl::FindNestedNameSpecifierMember(), clang::CXXRecordDecl::FindOrdinaryMember(), clang::CXXRecordDecl::FindTagMember(), and LookupAnyMember().
getNameKind - Determine what kind of name this is.
Definition at line 206 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(), CheckArityMismatch(), compare(), computeDeclRefDependence(), clang::DeclarationNameInfo::containsUnexpandedParameterPack(), clang::CXXConstructorDecl::Create(), clang::CXXDestructorDecl::Create(), clang::CXXConversionDecl::Create(), CreateNewFunctionDecl(), clang::DeclarationNameLoc::DeclarationNameLoc(), DeclareImplicitMemberFunctionsWithName(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::diagnoseQualifiedDeclaration(), clang::Sema::DiagnoseUnexpandedParameterPack(), clang::ASTReader::FindExternalVisibleDeclsByName(), FindHiddenVirtualMethod(), FindOverriddenMethod(), clang::FunctionDecl::getCorrespondingUnsizedGlobalDeallocationFunction(), clang::DeclarationNameInfo::getEndLoc(), clang::serialization::reader::ASTDeclContextNameLookupTrait::GetInternalKey(), getObjCSelector(), 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::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), and clang::ASTDeclWriter::VisitVarDecl().
Selector clang::DeclarationName::getObjCSelector | ( | ) | const [inline] |
getObjCSelector - Get the Objective-C selector stored in this declaration name.
Definition at line 265 of file DeclarationName.h.
References getNameKind(), ObjCMultiArgSelector, ObjCOneArgSelector, and ObjCZeroArgSelector.
Referenced by clang::ASTWriter::AddDeclarationName(), compare(), clang::serialization::reader::ASTDeclContextNameLookupTrait::GetInternalKey(), getOrderedName(), clang::ObjCMethodDecl::getSelector(), hasDefaultGetterName(), hasDefaultSetterName(), clang::ASTImporter::Import(), and clang::ASTNodeImporter::VisitObjCMethodDecl().
static DeclarationName clang::DeclarationName::getTombstoneMarker | ( | ) | [inline, static] |
Definition at line 300 of file DeclarationName.h.
References DeclarationName().
Referenced by llvm::DenseMapInfo< clang::DeclarationName >::getTombstoneKey().
DeclarationName DeclarationName::getUsingDirectiveName | ( | ) | [static] |
getUsingDirectiveName - Return name for all using-directives.
Definition at line 325 of file DeclarationName.cpp.
References DeclarationName().
Referenced by clang::ASTImporter::Import(), clang::DeclContext::all_lookups_iterator::operator++(), 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 243 of file DeclarationName.cpp.
References getCXXNameType(), clang::Type::isDependentType(), and clang::QualType::isNull().
Referenced by clang::Sema::ActOnDependentMemberExpr(), clang::Sema::ActOnMemberAccessExpr(), and clang::Sema::CheckMicrosoftIfExistsSymbol().
bool clang::DeclarationName::isEmpty | ( | ) | const [inline] |
Evaluates true when this declaration name is empty.
Definition at line 193 of file DeclarationName.h.
Referenced by clang::ASTNodeImporter::VisitIndirectFieldDecl().
bool clang::DeclarationName::isIdentifier | ( | ) | const [inline] |
Predicate functions for querying what type of name this is.
Definition at line 198 of file DeclarationName.h.
Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::FindHiddenVirtualMethods(), getAsIdentifierInfo(), clang::NamedDecl::getName(), and clang::Sema::HandleExprPropertyRefExpr().
bool clang::DeclarationName::isObjCOneArgSelector | ( | ) | const [inline] |
Definition at line 202 of file DeclarationName.h.
Referenced by hasDefaultSetterName().
bool clang::DeclarationName::isObjCZeroArgSelector | ( | ) | const [inline] |
Definition at line 199 of file DeclarationName.h.
Referenced by getOrderedName(), and hasDefaultGetterName().
LLVM_EXPLICIT clang::DeclarationName::operator bool | ( | ) | const [inline] |
Definition at line 187 of file DeclarationName.h.
void DeclarationName::setFETokenInfo | ( | void * | T | ) |
Definition at line 300 of file DeclarationName.cpp.
References CXXConstructorName, CXXConversionFunctionName, CXXDestructorName, CXXLiteralOperatorName, CXXOperatorName, clang::CXXSpecialName::FETokenInfo, clang::CXXOperatorIdName::FETokenInfo, clang::CXXLiteralOperatorIdName::FETokenInfo, getAsIdentifierInfo(), getNameKind(), Identifier, and clang::IdentifierInfo::setFETokenInfo().
Referenced by clang::IdentifierResolver::AddDecl(), clang::IdentifierResolver::IdDeclInfoMap::operator[](), clang::IdentifierResolver::RemoveDecl(), and clang::IdentifierResolver::tryAddTopLevelDecl().
friend class DeclarationNameTable [friend] |
Definition at line 162 of file DeclarationName.h.
friend class NamedDecl [friend] |
Definition at line 163 of file DeclarationName.h.
bool operator!= | ( | DeclarationName | LHS, |
DeclarationName | RHS | ||
) | [friend] |
operator!= - Determine whether the specified names are different.
Definition at line 292 of file DeclarationName.h.
bool operator== | ( | DeclarationName | LHS, |
DeclarationName | RHS | ||
) | [friend] |
operator== - Determine whether the specified names are identical..
Definition at line 287 of file DeclarationName.h.
const unsigned clang::DeclarationName::NumNameKinds = CXXUsingDirective + 1 [static] |
Definition at line 62 of file DeclarationName.h.