clang
15.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. More... | |
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 . More... | |
void | setExternalIdentifierLookup (IdentifierInfoLookup *IILookup) |
Set the external identifier lookup mechanism. More... | |
IdentifierInfoLookup * | getExternalIdentifierLookup () const |
Retrieve the external identifier lookup object, if any. More... | |
llvm::BumpPtrAllocator & | getAllocator () |
IdentifierInfo & | get (StringRef Name) |
Return the identifier token info for the specified named identifier. More... | |
IdentifierInfo & | get (StringRef Name, tok::TokenKind TokenCode) |
IdentifierInfo & | getOwn (StringRef Name) |
Gets an IdentifierInfo for the given name without consulting external sources. More... | |
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. More... | |
void | AddKeywords (const LangOptions &LangOpts) |
Populate the identifier table with info about the language keywords for the language specified by LangOpts . More... | |
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 563 of file IdentifierTable.h.
using clang::IdentifierTable::const_iterator = HashTableTy::const_iterator |
Definition at line 656 of file IdentifierTable.h.
using clang::IdentifierTable::iterator = HashTableTy::const_iterator |
Definition at line 655 of file IdentifierTable.h.
|
explicit |
Create the identifier table.
Definition at line 66 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 70 of file IdentifierTable.cpp.
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 213 of file IdentifierTable.cpp.
Referenced by clang::Preprocessor::Initialize().
|
inline |
Definition at line 658 of file IdentifierTable.h.
|
inline |
Definition at line 659 of file IdentifierTable.h.
|
inline |
Definition at line 662 of file IdentifierTable.h.
|
inline |
Return the identifier token info for the specified named identifier.
Definition at line 596 of file IdentifierTable.h.
Referenced by clang::Sema::ActOnCapturedRegionStart(), clang::Sema::ActOnCharacterConstant(), clang::Sema::ActOnCompoundRequirement(), clang::Sema::ActOnNumericConstant(), clang::Sema::ActOnObjCBoolLiteral(), clang::Sema::ActOnOpenMPTileDirective(), clang::Sema::ActOnOpenMPUnrollDirective(), clang::Sema::ActOnStringLiteral(), AddCXXOperatorKeyword(), clang::format::AdditionalKeywords::AdditionalKeywords(), clang::Sema::AddKnownFunctionAttributes(), BuildNonArrayForRange(), clang::Sema::BuildObjCArrayLiteral(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::BuildObjCDictionaryLiteral(), clang::CodeGen::CGCXXABI::buildThisParam(), checkMappableExpressionList(), clang::Sema::CheckObjCForCollectionOperand(), clang::Sema::checkOpenMPDeclareVariantFunction(), cleanupDeallocOrFinalize(), configureBlocksRuntimeObject(), CreateAAPCSABIBuiltinVaListDecl(), CreateAArch64ABIBuiltinVaListDecl(), clang::Sema::CreateBuiltinBinOp(), CreateHexagonBuiltinVaListDecl(), CreatePowerABIBuiltinVaListDecl(), CreateSystemZBuiltinVaListDecl(), CreateX86_64ABIBuiltinVaListDecl(), clang::Sema::DeclareGlobalNewDelete(), clang::Sema::DefaultLvalueConversion(), clang::CodeGen::CodeGenFunction::EmitBlockCopyAndAutorelease(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPush(), emitOutlinedFunctionPrologue(), GCRewriteFinalize(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::ASTContext::getBlockDescriptorExtendedType(), clang::ASTContext::getBlockDescriptorType(), clang::ASTContext::getBoolName(), clang::ObjCPropertyDecl::getDefaultSynthIvarName(), getErrnoFunc(), getErrnoVar(), clang::Sema::getFloat128Identifier(), clang::getKeywordSelector(), clang::ASTContext::getMakeIntegerSeqName(), clang::NSAPI::getNSArraySelector(), clang::NSAPI::getNSClassId(), clang::ASTContext::getNSCopyingName(), clang::NSAPI::getNSDictionarySelector(), clang::NSAPI::getNSNumberLiteralSelector(), clang::ASTContext::getNSObjectName(), clang::NSAPI::getNSSetSelector(), clang::NSAPI::getNSStringSelector(), clang::GetNullarySelector(), clang::ASTContext::getObjCProtocolDecl(), clang::Sema::getOrCreateStdNamespace(), clang::Sema::getSuperIdentifier(), clang::ASTContext::getTypePackElementName(), clang::GetUnarySelector(), clang::ASTImporter::Import(), clang::Parser::Initialize(), clang::Sema::Initialize(), isCFStringType(), clang::Sema::isKnownName(), clang::NSAPI::isMacroDefined(), clang::Preprocessor::isMacroDefined(), isNSStringType(), clang::Sema::isStdInitializerList(), isValidInteropVariable(), clang::Sema::lookupCoroutineTraits(), clang::Sema::LookupInlineAsmVarDeclField(), clang::Sema::lookupStdExperimentalNamespace(), lookupStdNamespace(), PropertyMemoryAttribute(), and shouldRunOnFunctionOrMethod().
|
inline |
Definition at line 620 of file IdentifierTable.h.
|
inline |
Definition at line 590 of file IdentifierTable.h.
|
inline |
Retrieve the external identifier lookup object, if any.
Definition at line 586 of file IdentifierTable.h.
|
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 633 of file IdentifierTable.h.
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 383 of file IdentifierTable.cpp.
Referenced by clang::FrontendAction::EndSourceFile().
|
inline |
Set the external identifier lookup mechanism.
Definition at line 581 of file IdentifierTable.h.
|
inline |
Definition at line 660 of file IdentifierTable.h.