clang
19.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... | |
diag::kind | getFutureCompatDiagKind (const IdentifierInfo &II, const LangOptions &LangOpts) |
Returns the correct diagnostic to issue for a future-compat diagnostic warning. 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 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.
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 295 of file IdentifierTable.cpp.
Referenced by 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().
|
inline |
Definition at line 754 of file IdentifierTable.h.
Referenced by clang::api_notes::APINotesReader::Implementation::getIdentifier().
|
inline |
Return the identifier token info for the specified named identifier.
Definition at line 688 of file IdentifierTable.h.
Referenced by clang::Sema::ActOnCompoundRequirement(), AddCXXOperatorKeyword(), BuildNonArrayForRange(), clang::CodeGen::CGCXXABI::buildThisParam(), checkMappableExpressionList(), cleanupDeallocOrFinalize(), configureBlocksRuntimeObject(), clang::Sema::DeclareGlobalNewDelete(), 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(), 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::ASTContext::getTypePackElementName(), clang::GetUnarySelector(), clang::ASTImporter::Import(), clang::Parser::Initialize(), clang::Sema::Initialize(), isCFStringType(), clang::Preprocessor::isMacroDefined(), clang::NSAPI::isMacroDefined(), isNSStringType(), isValidInteropVariable(), clang::Sema::lookupCoroutineTraits(), lookupStdNamespace(), and shouldRunOnFunctionOrMethod().
|
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.
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 839 of file IdentifierTable.cpp.
|
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.
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 481 of file IdentifierTable.cpp.
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.