|
clang
5.0.0
|
DeclarationName - The name of a declaration. More...
#include "clang/AST/DeclarationName.h"
Public Types | |
| enum | NameKind { Identifier, ObjCZeroArgSelector, ObjCOneArgSelector, ObjCMultiArgSelector, CXXConstructorName, CXXDestructorName, CXXConversionFunctionName, CXXDeductionGuideName, CXXOperatorName, CXXLiteralOperatorName, CXXUsingDirective } |
| NameKind - The kind of name this object contains. More... | |
Public Member Functions | |
| DeclarationName () | |
| DeclarationName - Used to create an empty selector. More... | |
| DeclarationName (const IdentifierInfo *II) | |
| DeclarationName (Selector Sel) | |
| operator bool () const | |
| bool | isEmpty () const |
| Evaluates true when this declaration name is empty. More... | |
| bool | isIdentifier () const |
| Predicate functions for querying what type of name this is. More... | |
| bool | isObjCZeroArgSelector () const |
| bool | isObjCOneArgSelector () const |
| NameKind | getNameKind () const |
| getNameKind - Determine what kind of name this is. More... | |
| bool | isDependentName () const |
| Determines whether the name itself is dependent, e.g., because it involves a C++ type that is itself dependent. More... | |
| std::string | getAsString () const |
| getNameAsString - Retrieve the human-readable string for this name. More... | |
| IdentifierInfo * | getAsIdentifierInfo () const |
| getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in this declaration name, or NULL if this declaration name isn't a simple identifier. More... | |
| uintptr_t | getAsOpaqueInteger () const |
| getAsOpaqueInteger - Get the representation of this declaration name as an opaque integer. More... | |
| void * | getAsOpaquePtr () const |
| getAsOpaquePtr - Get the representation of this declaration name as an opaque pointer. More... | |
| QualType | 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. More... | |
| TemplateDecl * | getCXXDeductionGuideTemplate () const |
| If this name is the name of a C++ deduction guide, return the template associated with that name. More... | |
| OverloadedOperatorKind | getCXXOverloadedOperator () const |
getCXXOverloadedOperator - If this name is the name of an overloadable operator in C++ (e.g., operator+), retrieve the kind of overloaded operator. More... | |
| IdentifierInfo * | getCXXLiteralIdentifier () const |
| getCXXLiteralIdentifier - If this name is the name of a literal operator, retrieve the identifier associated with it. More... | |
| Selector | getObjCSelector () const |
| getObjCSelector - Get the Objective-C selector stored in this declaration name. More... | |
| template<typename T > | |
| T * | getFETokenInfo () const |
| 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. More... | |
| void | setFETokenInfo (void *T) |
| void | print (raw_ostream &OS, const PrintingPolicy &Policy) |
| void | dump () const |
Static Public Member Functions | |
| static DeclarationName | getUsingDirectiveName () |
| getUsingDirectiveName - Return name for all using-directives. More... | |
| 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.. More... | |
| bool | operator!= (DeclarationName LHS, DeclarationName RHS) |
| operator!= - Determine whether the specified names are different. More... | |
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 50 of file DeclarationName.h.
NameKind - The kind of name this object contains.
Definition at line 53 of file DeclarationName.h.
|
inline |
DeclarationName - Used to create an empty selector.
Definition at line 169 of file DeclarationName.h.
Referenced by getEmptyMarker(), getTombstoneMarker(), and getUsingDirectiveName().
|
inline |
Definition at line 172 of file DeclarationName.h.
|
inline |
Definition at line 178 of file DeclarationName.h.
|
static |
Definition at line 96 of file DeclarationName.cpp.
References clang::compareInt(), CXXConstructorName, CXXConversionFunctionName, CXXDeductionGuideName, CXXDestructorName, CXXLiteralOperatorName, CXXOperatorName, CXXUsingDirective, getAsIdentifierInfo(), getCXXDeductionGuideTemplate(), getCXXLiteralIdentifier(), getCXXNameType(), getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), clang::IdentifierInfo::getName(), clang::Selector::getNameForSlot(), getNameKind(), clang::Selector::getNumArgs(), getObjCSelector(), I, Identifier, min(), ObjCMultiArgSelector, ObjCOneArgSelector, and ObjCZeroArgSelector.
Referenced by CmpProtocolNames(), clang::operator<(), clang::operator<=(), clang::operator>(), and clang::operator>=().
| LLVM_DUMP_METHOD void DeclarationName::dump | ( | ) | const |
Definition at line 415 of file DeclarationName.cpp.
|
inline |
getAsIdentifierInfo - Retrieve the IdentifierInfo * stored in this declaration name, or NULL if this declaration name isn't a simple identifier.
Definition at line 221 of file DeclarationName.h.
References isIdentifier().
Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnVariableDeclarator(), clang::IdentifierResolver::AddDecl(), clang::ODRHash::AddDeclarationName(), clang::ASTRecordWriter::AddDeclarationName(), clang::IdentifierResolver::begin(), clang::Sema::BuildUsingDeclaration(), CalculateHiddenNames(), clang::Sema::CheckFieldDecl(), clang::Sema::CheckTemplateTypeArgument(), compare(), clang::Sema::CorrectTypo(), clang::Sema::CorrectTypoDelayed(), clang::UnresolvedUsingTypenameDecl::Create(), CreateNewFunctionDecl(), clang::serialization::DeclarationNameKey::DeclarationNameKey(), DiagnoseDirectIsaAccess(), DiagnoseInvalidRedeclaration(), clang::TypoCorrection::getCorrectionAsIdentifierInfo(), getFETokenInfo(), clang::NamedDecl::getIdentifier(), getOrderedName(), clang::Sema::HandleExprPropertyRefExpr(), clang::ASTImporter::Import(), clang::IdentifierResolver::InsertDeclAfter(), isCXXSharedPtrDtor(), LookupBuiltin(), print(), clang::IdentifierResolver::RemoveDecl(), setFETokenInfo(), clang::IdentifierResolver::tryAddTopLevelDecl(), clang::ASTNodeImporter::VisitEnumConstantDecl(), clang::ASTNodeImporter::VisitEnumDecl(), clang::ASTNodeImporter::VisitFieldDecl(), clang::ASTNodeImporter::VisitImplicitParamDecl(), clang::ASTNodeImporter::VisitIndirectFieldDecl(), clang::ASTNodeImporter::VisitLabelDecl(), clang::ASTNodeImporter::VisitNamespaceDecl(), clang::ASTNodeImporter::VisitNonTypeTemplateParmDecl(), clang::ASTNodeImporter::VisitObjCCategoryDecl(), clang::ASTNodeImporter::VisitObjCInterfaceDecl(), clang::ASTNodeImporter::VisitObjCIvarDecl(), clang::ASTNodeImporter::VisitObjCPropertyDecl(), clang::ASTNodeImporter::VisitObjCProtocolDecl(), clang::ASTNodeImporter::VisitObjCTypeParamDecl(), clang::ASTNodeImporter::VisitParmVarDecl(), clang::ASTNodeImporter::VisitRecordDecl(), clang::ASTNodeImporter::VisitTemplateTemplateParmDecl(), clang::ASTNodeImporter::VisitTypedefNameDecl(), clang::ASTNodeImporter::VisitVarDecl(), and clang::ASTNodeImporter::VisitVarTemplateDecl().
|
inline |
getAsOpaqueInteger - Get the representation of this declaration name as an opaque integer.
Definition at line 229 of file DeclarationName.h.
Referenced by clang::operator<<().
|
inline |
getAsOpaquePtr - Get the representation of this declaration name as an opaque pointer.
Definition at line 233 of file DeclarationName.h.
Referenced by llvm::DenseMapInfo< clang::DeclarationName >::getHashValue().
| std::string DeclarationName::getAsString | ( | ) | const |
getNameAsString - Retrieve the human-readable string for this name.
Definition at line 314 of file DeclarationName.cpp.
References clang::Result.
Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildQualifiedDeclarationNameExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), CalculateHiddenNames(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::CorrectTypo(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::diagnoseExprIntendedAsTemplateName(), clang::ento::FunctionCodeRegion::dumpToStream(), emitEmptyLookupTypoDiagnostic(), clang::TypoCorrection::getAsString(), clang::NamedDecl::getNameAsString(), getOrderedName(), getPrintableNameForEntity(), LookupMemberExprInRecord(), and clang::Sema::LookupTemplateName().
| TemplateDecl * DeclarationName::getCXXDeductionGuideTemplate | ( | ) | const |
If this name is the name of a C++ deduction guide, return the template associated with that name.
Definition at line 328 of file DeclarationName.cpp.
Referenced by clang::ODRHash::AddDeclarationName(), clang::ASTRecordWriter::AddDeclarationName(), compare(), clang::serialization::DeclarationNameKey::DeclarationNameKey(), DeclareImplicitMemberFunctionsWithName(), clang::CXXDeductionGuideDecl::getDeducedTemplate(), clang::ASTImporter::Import(), isDependentName(), print(), clang::TreeTransform< Derived >::TransformDeclarationNameInfo(), and clang::RecursiveASTVisitor< Derived >::TraverseDeclarationNameInfo().
| IdentifierInfo * DeclarationName::getCXXLiteralIdentifier | ( | ) | const |
getCXXLiteralIdentifier - If this name is the name of a literal operator, retrieve the identifier associated with it.
Definition at line 344 of file DeclarationName.cpp.
Referenced by clang::ODRHash::AddDeclarationName(), clang::ASTRecordWriter::AddDeclarationName(), clang::Sema::CheckLiteralOperatorDeclaration(), compare(), clang::serialization::DeclarationNameKey::DeclarationNameKey(), 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 321 of file DeclarationName.cpp.
Referenced by clang::Sema::ActOnIdExpression(), clang::ODRHash::AddDeclarationName(), clang::ASTRecordWriter::AddDeclarationName(), AddTypedNameChunk(), compare(), computeDeclRefDependence(), clang::DeclarationNameInfo::containsUnexpandedParameterPack(), clang::Sema::diagnoseQualifiedDeclaration(), clang::Sema::DiagnoseUnexpandedParameterPack(), clang::ASTImporter::Import(), isDependentName(), clang::DeclarationNameInfo::isInstantiationDependent(), LookupDirect(), print(), and clang::TreeTransform< Derived >::TransformDeclarationNameInfo().
| OverloadedOperatorKind DeclarationName::getCXXOverloadedOperator | ( | ) | const |
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 334 of file DeclarationName.cpp.
References clang::DeclarationNameExtra::CXXConversionFunction, and clang::OO_None.
Referenced by clang::Sema::ActOnFunctionDeclarator(), ActOnOMPReductionKindClause(), clang::ODRHash::AddDeclarationName(), clang::ASTRecordWriter::AddDeclarationName(), AddTypedNameChunk(), canBeDeclaredInNamespace(), clang::Sema::CheckEquivalentExceptionSpec(), compare(), clang::serialization::DeclarationNameKey::DeclarationNameKey(), clang::Sema::DeclareGlobalAllocationFunction(), DeclareImplicitMemberFunctionsWithName(), EmitDiagForCXXThrowInNonThrowingFunc(), clang::Sema::FindAllocationFunctions(), clang::FunctionDecl::getOverloadedOperator(), clang::hasImplicitExceptionSpec(), clang::ASTImporter::Import(), isImplicitlyDeclaredMemberFunctionName(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::CXXMethodDecl::isStatic(), and resolveAllocationOverload().
|
inlinestatic |
Definition at line 298 of file DeclarationName.h.
References DeclarationName().
Referenced by llvm::DenseMapInfo< clang::DeclarationName >::getEmptyKey().
|
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 280 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().
|
inlinestatic |
Definition at line 241 of file DeclarationName.h.
References P.
Referenced by clang::FormatASTNodeDiagnosticArgument().
|
inlinestatic |
Definition at line 235 of file DeclarationName.h.
References P.
| DeclarationName::NameKind DeclarationName::getNameKind | ( | ) | const |
getNameKind - Determine what kind of name this is.
Definition at line 261 of file DeclarationName.cpp.
References clang::DeclarationNameExtra::CXXConstructor, CXXConstructorName, clang::DeclarationNameExtra::CXXConversionFunction, CXXConversionFunctionName, clang::DeclarationNameExtra::CXXDeductionGuide, CXXDeductionGuideName, clang::DeclarationNameExtra::CXXDestructor, CXXDestructorName, clang::DeclarationNameExtra::CXXLiteralOperator, CXXLiteralOperatorName, CXXOperatorName, CXXUsingDirective, clang::DeclarationNameExtra::CXXUsingDirective, Identifier, ObjCMultiArgSelector, ObjCOneArgSelector, and ObjCZeroArgSelector.
Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIdExpression(), clang::ODRHash::AddDeclarationName(), clang::ASTRecordWriter::AddDeclarationName(), clang::ASTRecordWriter::AddDeclarationNameLoc(), AddTypedNameChunk(), clang::Sema::BuildMemberPointerType(), 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::DeclarationNameInfo::getCXXLiteralOperatorNameLoc(), clang::DeclarationNameInfo::getCXXOperatorNameRange(), clang::DeclarationNameInfo::getEndLoc(), clang::DeclarationNameInfo::getNamedTypeInfo(), getObjCSelector(), clang::Sema::HideUsingShadowDecl(), clang::ASTImporter::Import(), clang::ASTNodeImporter::ImportDeclarationNameLoc(), isImplicitlyDeclaredMemberFunctionName(), clang::DeclarationNameInfo::isInstantiationDependent(), LookupDirect(), print(), clang::DeclarationNameInfo::printName(), clang::ASTReader::ReadDeclarationNameLoc(), clang::DeclarationNameInfo::setCXXLiteralOperatorNameLoc(), clang::DeclarationNameInfo::setCXXOperatorNameRange(), setFETokenInfo(), clang::DeclarationNameInfo::setNamedTypeInfo(), clang::TreeTransform< Derived >::TransformDeclarationNameInfo(), clang::RecursiveASTVisitor< Derived >::TraverseDeclarationNameInfo(), clang::ASTDeclWriter::VisitCXXMethodDecl(), clang::ASTDeclWriter::VisitEnumDecl(), clang::ASTDeclWriter::VisitRecordDecl(), clang::ASTDeclWriter::VisitTypedefDecl(), and clang::ASTDeclWriter::VisitVarDecl().
|
inline |
getObjCSelector - Get the Objective-C selector stored in this declaration name.
Definition at line 267 of file DeclarationName.h.
References getNameKind(), ObjCMultiArgSelector, ObjCOneArgSelector, and ObjCZeroArgSelector.
Referenced by clang::ODRHash::AddDeclarationName(), clang::ASTRecordWriter::AddDeclarationName(), compare(), clang::serialization::DeclarationNameKey::DeclarationNameKey(), getOrderedName(), clang::ObjCMethodDecl::getSelector(), hasDefaultGetterName(), hasDefaultSetterName(), clang::ASTImporter::Import(), print(), clang::ASTNodeImporter::VisitObjCMethodDecl(), and clang::ASTDeclReader::VisitObjCPropertyDecl().
|
inlinestatic |
Definition at line 302 of file DeclarationName.h.
References DeclarationName().
Referenced by llvm::DenseMapInfo< clang::DeclarationName >::getTombstoneKey().
|
static |
getUsingDirectiveName - Return name for all using-directives.
Definition at line 404 of file DeclarationName.cpp.
References clang::DeclarationNameExtra::CXXUsingDirective, and 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 301 of file DeclarationName.cpp.
References getCXXDeductionGuideTemplate(), getCXXNameType(), clang::Type::isDependentType(), and clang::QualType::isNull().
Referenced by clang::Sema::ActOnDependentMemberExpr(), clang::Sema::ActOnMemberAccessExpr(), and clang::Sema::CheckMicrosoftIfExistsSymbol().
|
inline |
Evaluates true when this declaration name is empty.
Definition at line 191 of file DeclarationName.h.
Referenced by clang::ODRHash::AddDeclarationName(), clang::index::printSymbolName(), shouldSkipNamelessDecl(), and clang::ASTNodeImporter::VisitIndirectFieldDecl().
|
inline |
Predicate functions for querying what type of name this is.
Definition at line 196 of file DeclarationName.h.
Referenced by clang::Sema::ActOnCXXMemberDeclarator(), clang::Sema::FindHiddenVirtualMethods(), getAsIdentifierInfo(), clang::NamedDecl::getName(), and clang::Sema::HandleExprPropertyRefExpr().
|
inline |
Definition at line 200 of file DeclarationName.h.
Referenced by hasDefaultSetterName().
|
inline |
Definition at line 197 of file DeclarationName.h.
Referenced by getOrderedName(), and hasDefaultGetterName().
|
inlineexplicit |
Definition at line 185 of file DeclarationName.h.
| void clang::DeclarationName::print | ( | raw_ostream & | OS, |
| const PrintingPolicy & | Policy | ||
| ) |
Definition at line 183 of file DeclarationName.cpp.
References clang::PrintingPolicy::adjustForCPlusPlus(), CXXConstructorName, CXXDeductionGuideName, CXXDestructorName, CXXUsingDirective, getAsIdentifierInfo(), getCXXDeductionGuideTemplate(), getCXXNameType(), clang::NamedDecl::getDeclName(), getNameKind(), getObjCSelector(), Identifier, ObjCMultiArgSelector, ObjCOneArgSelector, ObjCZeroArgSelector, print(), clang::Selector::print(), and clang::printCXXConstructorDestructorName().
Referenced by clang::operator<<(), print(), and clang::index::printSymbolName().
| void DeclarationName::setFETokenInfo | ( | void * | T | ) |
Definition at line 375 of file DeclarationName.cpp.
References CXXConstructorName, CXXConversionFunctionName, CXXDeductionGuideName, CXXDestructorName, CXXLiteralOperatorName, CXXOperatorName, clang::CXXSpecialName::FETokenInfo, clang::CXXDeductionGuideNameExtra::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 |
Definition at line 160 of file DeclarationName.h.
|
friend |
Definition at line 161 of file DeclarationName.h.
|
friend |
operator!= - Determine whether the specified names are different.
Definition at line 294 of file DeclarationName.h.
|
friend |
operator== - Determine whether the specified names are identical..
Definition at line 289 of file DeclarationName.h.
|
static |
Definition at line 66 of file DeclarationName.h.
1.8.6