|
clang
5.0.0
|
Implements an efficient mapping from strings to IdentifierInfo nodes. More...
#include "clang/Basic/IdentifierTable.h"
Public Types | |
| typedef HashTableTy::const_iterator | iterator |
| typedef HashTableTy::const_iterator | const_iterator |
Public Member Functions | |
| 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 |
| void | PrintStats () const |
| Print some statistics to stderr that indicate how well the hashing is doing. More... | |
| void | AddKeywords (const LangOptions &LangOpts) |
| AddKeywords - Add all keywords to the symbol table. 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 465 of file IdentifierTable.h.
| typedef HashTableTy::const_iterator clang::IdentifierTable::const_iterator |
Definition at line 555 of file IdentifierTable.h.
| typedef HashTableTy::const_iterator clang::IdentifierTable::iterator |
Definition at line 554 of file IdentifierTable.h.
| IdentifierTable::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.
Definition at line 75 of file IdentifierTable.cpp.
References AddKeywords().
| void IdentifierTable::AddKeywords | ( | const LangOptions & | LangOpts | ) |
AddKeywords - Add all keywords to the symbol table.
Definition at line 204 of file IdentifierTable.cpp.
References AddKeyword().
Referenced by IdentifierTable().
|
inline |
Definition at line 557 of file IdentifierTable.h.
|
inline |
Definition at line 558 of file IdentifierTable.h.
|
inline |
Return the identifier token info for the specified named identifier.
Definition at line 495 of file IdentifierTable.h.
References clang::IdentifierInfoLookup::get(), getAllocator(), and Name.
Referenced by clang::Sema::ActOnCapturedRegionStart(), clang::Sema::ActOnCharacterConstant(), clang::Sema::ActOnInstanceMessage(), clang::Sema::ActOnNumericConstant(), clang::Sema::ActOnObjCBoolLiteral(), clang::Sema::ActOnStringLiteral(), AddCXXOperatorKeyword(), addFunctionPointerConversion(), clang::Sema::addImplicitTypedef(), clang::format::AdditionalKeywords::AdditionalKeywords(), AddKeyword(), clang::Sema::AddKnownFunctionAttributes(), AddObjCKeyValueCompletions(), AddObjCKeyword(), buildBuiltinCall(), buildCapture(), buildCoroutineHandle(), clang::ASTContext::buildImplicitRecord(), clang::ASTContext::buildImplicitTypedef(), buildMemberCall(), buildMemcpyForAssignmentOp(), BuildNonArrayForRange(), clang::Sema::BuildObjCArrayLiteral(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::BuildObjCDictionaryLiteral(), clang::Sema::BuildObjCStringLiteral(), buildSingleCopyAssignRecursively(), buildStdNoThrowDeclRef(), clang::CodeGen::CGCXXABI::buildThisParam(), buildVarDecl(), CheckKeyForObjCARCConversion(), clang::Sema::CheckObjCForCollectionOperand(), CheckProtocolMethodDefs(), cleanupDeallocOrFinalize(), configureBlocksRuntimeObject(), clang::SelectorTable::constructSetterSelector(), CreateAAPCSABIBuiltinVaListDecl(), CreateAArch64ABIBuiltinVaListDecl(), clang::Sema::CreateBuiltinBinOp(), clang::ObjCMethodDecl::createImplicitParams(), CreatePowerABIBuiltinVaListDecl(), clang::Sema::CreatePropertyDecl(), CreateSystemZBuiltinVaListDecl(), CreateX86_64ABIBuiltinVaListDecl(), CXXRecordMembersNamed(), clang::Sema::DeclareGlobalNewDelete(), clang::ASTReader::DecodeIdentifierInfo(), clang::Sema::DefaultLvalueConversion(), DiagnoseDirectIsaAccess(), clang::CodeGen::CodeGenFunction::EmitBlockCopyAndAutorelease(), clang::CodeGen::CodeGenFunction::EmitObjCForCollectionStmt(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPop(), clang::CodeGen::CodeGenFunction::EmitObjCMRRAutoreleasePoolPush(), emitOutlinedFunctionPrologue(), emitReplacement(), clang::Builtin::Context::forgetBuiltin(), GCRewriteFinalize(), clang::CodeGen::CodeGenFunction::GenerateBlockFunction(), generateByrefCopyHelper(), generateByrefDisposeHelper(), clang::CodeGen::CodeGenFunction::GenerateCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateDestroyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(), clang::CodeGen::CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(), clang::CodeGen::CodeGenModule::GetAddrOfConstantCFString(), clang::ASTContext::getBlockDescriptorExtendedType(), clang::ASTContext::getBlockDescriptorType(), clang::ASTContext::getBoolName(), clang::ASTContext::getCFConstantStringDecl(), clang::ObjCPropertyDecl::getDefaultSynthIvarName(), clang::Sema::getFloat128Identifier(), clang::Preprocessor::getIdentifierInfo(), clang::ento::getKeywordSelector(), clang::CXXRecordDecl::getLambdaStaticInvoker(), 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(), clang::Sema::getOrCreateStdNamespace(), GetRuntimeFunctionDecl(), clang::Sema::getSuperIdentifier(), clang::ASTContext::getTypePackElementName(), clang::GetUnarySelector(), handleAvailabilityAttr(), handleFormatAttr(), handleIBOutletCollection(), handleOwnershipAttr(), hasMember(), clang::ASTImporter::Import(), clang::Parser::Initialize(), clang::Sema::Initialize(), clang::Builtin::Context::initializeBuiltins(), isCFStringType(), clang::Sema::isKnownName(), isMacroDefined(), clang::NSAPI::isMacroDefined(), clang::Preprocessor::isMacroDefined(), isNSStringType(), clang::Sema::isStdInitializerList(), IsValidIdentifier(), lookupCoroutineHandleType(), clang::Sema::LookupInlineAsmField(), clang::Sema::LookupInlineAsmVarDeclField(), clang::Sema::LookupInObjCMethod(), LookupPredefedObjCSuperType(), lookupPromiseType(), clang::Sema::lookupStdExperimentalNamespace(), LookupStdInitializerList(), lookupStdTypeTraitMember(), mergeDeclAttribute(), clang::ObjCNoReturn::ObjCNoReturn(), PropertyMemoryAttribute(), shouldRunOnFunctionOrMethod(), and transferARCOwnershipToDeclaratorChunk().
|
inline |
Definition at line 519 of file IdentifierTable.h.
References Name.
|
inline |
Definition at line 489 of file IdentifierTable.h.
|
inline |
Retrieve the external identifier lookup object, if any.
Definition at line 485 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 532 of file IdentifierTable.h.
References getAllocator(), and 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 327 of file IdentifierTable.cpp.
Referenced by clang::FrontendAction::EndSourceFile().
|
inline |
Set the external identifier lookup mechanism.
Definition at line 480 of file IdentifierTable.h.
|
inline |
Definition at line 559 of file IdentifierTable.h.
1.8.6