clang 20.0.0git
|
Implements an efficient mapping from strings to IdentifierInfo nodes. More...
#include "clang/Basic/IdentifierTable.h"
Public Types | |
using | iterator = HashTableTy::const_iterator |
using | const_iterator = HashTableTy::const_iterator |
Public Member Functions | |
IdentifierTable (IdentifierInfoLookup *ExternalLookup=nullptr) | |
Create the identifier table. | |
IdentifierTable (const LangOptions &LangOpts, IdentifierInfoLookup *ExternalLookup=nullptr) | |
Create the identifier table, populating it with info about the language keywords for the language specified by LangOpts . | |
void | setExternalIdentifierLookup (IdentifierInfoLookup *IILookup) |
Set the external identifier lookup mechanism. | |
IdentifierInfoLookup * | getExternalIdentifierLookup () const |
Retrieve the external identifier lookup object, if any. | |
llvm::BumpPtrAllocator & | getAllocator () |
IdentifierInfo & | get (StringRef Name) |
Return the identifier token info for the specified named identifier. | |
IdentifierInfo & | get (StringRef Name, tok::TokenKind TokenCode) |
IdentifierInfo & | getOwn (StringRef Name) |
Gets an IdentifierInfo for the given name without consulting external sources. | |
iterator | begin () const |
iterator | end () const |
unsigned | size () const |
iterator | find (StringRef Name) const |
void | PrintStats () const |
Print some statistics to stderr that indicate how well the hashing is doing. | |
void | AddKeywords (const LangOptions &LangOpts) |
Populate the identifier table with info about the language keywords for the language specified by LangOpts . | |
diag::kind | getFutureCompatDiagKind (const IdentifierInfo &II, const LangOptions &LangOpts) |
Returns the correct diagnostic to issue for a future-compat diagnostic warning. | |
Implements an efficient mapping from strings to IdentifierInfo nodes.
This has no other purpose, but this is an extremely performance-critical piece of the code, as each occurrence of every identifier goes through here when lexed.
Definition at line 655 of file IdentifierTable.h.
using clang::IdentifierTable::const_iterator = HashTableTy::const_iterator |
Definition at line 748 of file IdentifierTable.h.
using clang::IdentifierTable::iterator = HashTableTy::const_iterator |
Definition at line 747 of file IdentifierTable.h.
|
explicit |
Create the identifier table.
Definition at line 65 of file IdentifierTable.cpp.
|
explicit |
Create the identifier table, populating it with info about the language keywords for the language specified by LangOpts
.
Definition at line 69 of file IdentifierTable.cpp.
References AddKeywords().
void IdentifierTable::AddKeywords | ( | const LangOptions & | LangOpts | ) |
Populate the identifier table with info about the language keywords for the language specified by LangOpts
.
AddKeywords - Add all keywords to the symbol table.
Definition at line 299 of file IdentifierTable.cpp.
References AddKeyword(), get(), and clang::IdentifierInfo::setModulesImport().
Referenced by IdentifierTable(), and clang::Preprocessor::Initialize().
|
inline |
Definition at line 750 of file IdentifierTable.h.
|
inline |
Definition at line 751 of file IdentifierTable.h.
Referenced by clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::Builtin::Context::initializeBuiltins().
|
inline |
Definition at line 754 of file IdentifierTable.h.
Referenced by clang::api_notes::APINotesReader::Implementation::getIdentifier(), and clang::Builtin::Context::initializeBuiltins().
|
inline |
Return the identifier token info for the specified named identifier.
Definition at line 688 of file IdentifierTable.h.
References clang::IdentifierInfoLookup::get().
Referenced by clang::Sema::ActOnCapturedRegionStart(), clang::Sema::ActOnCharacterConstant(), clang::Sema::ActOnCompoundRequirement(), clang::Sema::ActOnCXXTypeid(), clang::SemaObjC::ActOnInstanceMessage(), clang::Sema::ActOnNumericConstant(), clang::SemaObjC::ActOnObjCBoolLiteral(), clang::SemaOpenMP::ActOnOpenMPInterchangeDirective(), clang::SemaOpenMP::ActOnOpenMPReverseDirective(), clang::SemaOpenMP::ActOnOpenMPTileDirective(), clang::SemaOpenMP::ActOnOpenMPUnrollDirective(), clang::SemaOpenMP::ActOnOpenMPUsesAllocatorClause(), clang::SemaOpenMP::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(), clang::Sema::ActOnStringLiteral(), AddCXXOperatorKeyword(), addFunctionPointerConversion(), clang::Sema::addImplicitTypedef(), AddKeyword(), AddKeywords(), clang::Sema::AddKnownFunctionAttributes(), AddNotableIdentifier(), AddObjCKeyValueCompletions(), AddObjCKeyword(), clang::Sema::BuildBuiltinCallExpr(), buildCapture(), buildCoroutineHandle(), clang::Sema::buildCoroutinePromise(), buildImplicitMapper(), clang::ASTContext::buildImplicitRecord(), clang::ASTContext::buildImplicitTypedef(), clang::SemaObjC::BuildIvarRefExpr(), buildMemberCall(), buildMemcpyForAssignmentOp(), BuildNonArrayForRange(), clang::SemaObjC::BuildObjCArrayLiteral(), clang::SemaObjC::BuildObjCBoxedExpr(), clang::SemaObjC::BuildObjCDictionaryLiteral(), clang::SemaObjC::BuildObjCStringLiteral(), buildSingleCopyAssignRecursively(), buildStdNoThrowDeclRef(), clang::CodeGen::CGCXXABI::buildThisParam(), buildVarDecl(), CheckKeyForObjCARCConversion(), clang::SemaOpenMP::checkOpenMPDeclareVariantFunction(), CheckProtocolMethodDefs(), cleanupDeallocOrFinalize(), configureBlocksRuntimeObject(), constructBufferConceptDecl(), clang::SelectorTable::constructSetterSelector(), CreateAAPCSABIBuiltinVaListDecl(), CreateAArch64ABIBuiltinVaListDecl(), clang::Sema::CreateBuiltinBinOp(), CreateHexagonBuiltinVaListDecl(), clang::ObjCMethodDecl::createImplicitParams(), CreatePowerABIBuiltinVaListDecl(), clang::SemaObjC::CreatePropertyDecl(), CreateSystemZBuiltinVaListDecl(), CreateX86_64ABIBuiltinVaListDecl(), CXXRecordMembersNamed(), clang::Sema::DeclareGlobalNewDelete(), clang::ASTReader::DecodeIdentifierInfo(), clang::Sema::DefaultLvalueConversion(), DiagnoseDirectIsaAccess(), emitOutlinedFunctionPrologue(), emitReplacement(), clang::ExternalSource::FindExternalVisibleDeclsByName(), findOMPAllocatorHandleT(), findOMPAlloctraitT(), findOMPDependT(), findOMPEventHandleT(), GCRewriteFinalize(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::ASTContext::getBlockDescriptorExtendedType(), clang::ASTContext::getBlockDescriptorType(), clang::ASTContext::getBoolName(), clang::ASTContext::getBuiltinCommonTypeName(), clang::ASTContext::getCFConstantStringDecl(), clang::ObjCPropertyDecl::getDefaultSynthIvarName(), getGlobalStreamPointerByName(), clang::Preprocessor::getIdentifierInfo(), clang::getKeywordSelector(), getLambdaStaticInvokers(), clang::ASTContext::getMakeIntegerSeqName(), clang::NSAPI::getNSArraySelector(), clang::NSAPI::getNSClassId(), clang::ASTContext::getNSCopyingName(), clang::NSAPI::getNSDictionarySelector(), getNSNumberFactoryMethod(), clang::NSAPI::getNSNumberLiteralSelector(), clang::ASTContext::getNSObjectName(), clang::NSAPI::getNSSetSelector(), clang::NSAPI::getNSStringSelector(), clang::GetNullarySelector(), clang::ASTContext::getObjCProtocolDecl(), getOpenCLEnumType(), getOpenCLTypedefType(), clang::Sema::getOrCreateStdNamespace(), clang::Sema::getSuperIdentifier(), clang::ASTContext::getTypePackElementName(), clang::GetUnarySelector(), handleAvailabilityAttr(), handleFormatAttr(), handleOwnershipAttr(), hasMember(), hasTypedefNamed(), clang::ASTImporter::Import(), clang::Parser::Initialize(), clang::Sema::Initialize(), clang::Builtin::Context::initializeBuiltins(), clang::HLSLExternalSemaSource::InitializeSema(), clang::Sema::InventAbbreviatedTemplateParameterTypeName(), clang::SemaObjC::isCFStringType(), isImplicitMapperNeeded(), clang::SemaObjC::isKnownName(), isMacroDefined(), clang::Preprocessor::isMacroDefined(), clang::NSAPI::isMacroDefined(), isNSStringType(), clang::SemaObjC::isNSStringType(), clang::Sema::isStdInitializerList(), IsValidIdentifier(), isValidInteropVariable(), clang::CompilerInstance::loadModule(), lookupBuiltinFunction(), lookupCoroutineHandleType(), clang::Sema::lookupCoroutineTraits(), lookupCXXRecordDecl(), clang::Sema::LookupInlineAsmField(), clang::Sema::LookupInlineAsmVarDeclField(), clang::LookupNamed(), clang::LookupNamespace(), LookupPredefedObjCSuperType(), lookupPromiseType(), LookupStdInitializerList(), lookupStdNamespace(), LookupStdSourceLocationImpl(), lookupStdTypeTraitMember(), markUsedForAliasOrIfunc(), mergeDeclAttribute(), ProcessAPINotes(), processImplicitMapsWithDefaultMappers(), PropertyMemoryAttribute(), clang::TreeTransform< Derived >::RebuildShuffleVectorExpr(), shouldRunOnFunctionOrMethod(), clang::syntax::tokenize(), and transferARCOwnershipToDeclaratorChunk().
|
inline |
Definition at line 712 of file IdentifierTable.h.
|
inline |
Definition at line 682 of file IdentifierTable.h.
|
inline |
Retrieve the external identifier lookup object, if any.
Definition at line 678 of file IdentifierTable.h.
Referenced by highlightLines().
diag::kind IdentifierTable::getFutureCompatDiagKind | ( | const IdentifierInfo & | II, |
const LangOptions & | LangOpts | ||
) |
Returns the correct diagnostic to issue for a future-compat diagnostic warning.
Note, this function assumes the identifier passed has already been determined to be a future compatible keyword.
Definition at line 847 of file IdentifierTable.cpp.
References clang::IdentifierInfo::getName(), and clang::IdentifierInfo::isFutureCompatKeyword().
|
inline |
Gets an IdentifierInfo for the given name without consulting external sources.
This is a version of get() meant for external sources that want to introduce or modify an identifier. If they called get(), they would likely end up in a recursion.
Definition at line 725 of file IdentifierTable.h.
References clang::IdentifierInfo::setModulesImport().
void IdentifierTable::PrintStats | ( | ) | const |
Print some statistics to stderr that indicate how well the hashing is doing.
PrintStats - Print statistics about how well the identifier table is doing at hashing identifiers.
Definition at line 489 of file IdentifierTable.cpp.
References E.
Referenced by clang::FrontendAction::EndSourceFile().
|
inline |
Set the external identifier lookup mechanism.
Definition at line 673 of file IdentifierTable.h.
|
inline |
Definition at line 752 of file IdentifierTable.h.