clang API Documentation
#include <IdentifierTable.h>
Public Member Functions | |
| IdentifierInfo () | |
| template<std::size_t StrLen> | |
| bool | isStr (const char(&Str)[StrLen]) const |
| const char * | getNameStart () const |
| unsigned | getLength () const |
| StringRef | getName () const |
| getName - Return the actual identifier string. | |
| bool | hasMacroDefinition () const |
| void | setHasMacroDefinition (bool Val) |
| tok::TokenKind | getTokenID () const |
| bool | hasRevertedTokenIDToIdentifier () const |
| True if RevertTokenIDToIdentifier() was called. | |
| void | RevertTokenIDToIdentifier () |
| Revert TokenID to tok::identifier; used for GNU libstdc++ 4.2 compatibility. | |
| tok::PPKeywordKind | getPPKeywordID () const |
| tok::ObjCKeywordKind | getObjCKeywordID () const |
| void | setObjCKeywordID (tok::ObjCKeywordKind ID) |
| unsigned | getBuiltinID () const |
| void | setBuiltinID (unsigned ID) |
| unsigned | getObjCOrBuiltinID () const |
| void | setObjCOrBuiltinID (unsigned ID) |
| bool | isExtensionToken () const |
| void | setIsExtensionToken (bool Val) |
| bool | isCXX11CompatKeyword () const |
| void | setIsCXX11CompatKeyword (bool Val) |
| void | setIsPoisoned (bool Value=true) |
| bool | isPoisoned () const |
| isPoisoned - Return true if this token has been poisoned. | |
| void | setIsCPlusPlusOperatorKeyword (bool Val=true) |
| bool | isCPlusPlusOperatorKeyword () const |
| template<typename T > | |
| T * | getFETokenInfo () const |
| void | setFETokenInfo (void *T) |
| bool | isHandleIdentifierCase () const |
| bool | isFromAST () const |
| void | setIsFromAST () |
| bool | hasChangedSinceDeserialization () const |
| Determine whether this identifier has changed since it was loaded from an AST file. | |
| void | setChangedSinceDeserialization () |
| Note that this identifier has changed since it was loaded from an AST file. | |
| bool | isOutOfDate () const |
| Determine whether the information for this identifier is out of date with respect to the external source. | |
| void | setOutOfDate (bool OOD) |
| Set whether the information for this identifier is out of date with respect to the external source. | |
| bool | isImport () const |
| Determine whether this is the contextual keyword 'import'. | |
| void | setImport (bool I) |
| Set whether this identifier is the contextual keyword 'import'. | |
Friends | |
| class | IdentifierTable |
IdentifierInfo - One of these records is kept for each identifier that is lexed. This contains information about whether the token was #define'd, is a language keyword, or if it is a front-end token of some sort (e.g. a variable or function name). The preprocessor keeps this information in a set, and all tok::identifier tokens have a pointer to one of these.
Definition at line 49 of file IdentifierTable.h.
| IdentifierInfo::IdentifierInfo | ( | ) |
Definition at line 31 of file IdentifierTable.cpp.
| unsigned clang::IdentifierInfo::getBuiltinID | ( | ) | const [inline] |
getBuiltinID - Return a value indicating whether this is a builtin function. 0 is not-built-in. 1 is builtin-for-some-nonprimary-target. 2+ are specific builtin functions.
Definition at line 179 of file IdentifierTable.h.
Referenced by clang::FunctionDecl::getBuiltinID(), LookupBuiltin(), and clang::Sema::LookupInObjCMethod().
| T* clang::IdentifierInfo::getFETokenInfo | ( | ) | const [inline] |
getFETokenInfo/setFETokenInfo - The language front-end is allowed to associate arbitrary metadata with this token.
Definition at line 246 of file IdentifierTable.h.
| unsigned clang::IdentifierInfo::getLength | ( | ) | const [inline] |
getLength - Efficiently return the length of this identifier info.
Definition at line 109 of file IdentifierTable.h.
Referenced by AddObjCKeyValueCompletions(), CheckExtVectorComponent(), getName(), getPPKeywordID(), getStandardSelLoc(), isStr(), and clang::Sema::MergeTypedefNameDecl().
| StringRef clang::IdentifierInfo::getName | ( | ) | const [inline] |
getName - Return the actual identifier string.
Definition at line 122 of file IdentifierTable.h.
References getLength(), and getNameStart().
Referenced by clang::Sema::ActOnAsmStmt(), clang::Sema::ActOnPragmaVisibility(), AddObjCKeyValueCompletions(), AddTemplateParameterChunks(), clang::Sema::CheckEquivalentExceptionSpec(), checkIsPointer(), clang::Sema::CheckLiteralOperatorDeclaration(), clang::Sema::CodeCompleteObjCMethodDeclSelector(), clang::Sema::CodeCompleteObjCPropertySynthesizeIvar(), clang::DeclarationName::compare(), clang::SelectorTable::constructSetterName(), clang::ExtVectorElementExpr::containsDuplicateElements(), clang::Sema::CorrectTypo(), clang::Sema::DeclApplyPragmaWeak(), diagnoseBadTypeAttribute(), clang::Sema::DiagnoseUnknownTemplateName(), clang::Sema::DiagnoseUnknownTypeName(), EvaluateHasIncludeCommon(), clang::analyze_printf::PrintfSpecifier::fixType(), clang::analyze_scanf::ScanfSpecifier::fixType(), clang::Diagnostic::FormatDiagnostic(), FormatFunctionParameter(), clang::idx::GlobalSelector::get(), clang::Selector::getAsString(), GetAssumedMessageSendExprType(), getCalleeName(), getDefaultSynthIvarName(), clang::ExtVectorElementExpr::getEncodedElementAccess(), GetFullTypeForDeclarator(), clang::ento::SubEngine::getInitialState(), getIvarAccessString(), clang::AttributeList::getKind(), clang::CodeGen::CodeGenModule::getMangledName(), clang::NamedDecl::getName(), clang::MacroExpansion::getName(), clang::ObjCImplementationDecl::getName(), clang::Selector::getNameForSlot(), getOrderedName(), clang::idx::GlobalSelector::getSelector(), handleAvailabilityAttr(), clang::Preprocessor::HandleDirective(), handleFormatAttr(), handleModeAttr(), handleObjCMethodFamilyAttr(), handleObjCOwnershipTypeAttr(), handleOwnershipAttr(), clang::PragmaNamespace::HandlePragma(), clang::Preprocessor::HandlePragmaPopMacro(), HasAttribute(), HasExtension(), HasFeature(), clang::Sema::ImplicitlyDefineFunction(), clang::ASTImporter::Import(), InheritsFromClassNamed(), InNamespace(), isAttributeLateParsed(), isCharSpecialization(), clang::ento::CheckerContext::isCLibraryFunction(), isReceiverClassOrSuperclass(), IsStructurallyEquivalent(), clang::Expr::isUnusedResultAWarning(), clang::NestedNameSpecifier::print(), PrintMacroDefinition(), printTypeSpec(), clang::PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(), clang::RewriteMacrosInInput(), and clang::ASTReader::updateOutOfDateIdentifier().
| const char* clang::IdentifierInfo::getNameStart | ( | ) | const [inline] |
getNameStart - Return the beginning of the actual string for this identifier. The returned string is properly null terminated.
Definition at line 96 of file IdentifierTable.h.
Referenced by CheckExtVectorComponent(), getName(), clang::LabelStmt::getName(), clang::ObjCCategoryImplDecl::getName(), clang::ObjCCategoryImplDecl::getNameAsCString(), getPPKeywordID(), and isStr().
| tok::ObjCKeywordKind clang::IdentifierInfo::getObjCKeywordID | ( | ) | const [inline] |
getObjCKeywordID - Return the Objective-C keyword ID for the this identifier. For example, 'class' will return tok::objc_class if ObjC is enabled.
Definition at line 168 of file IdentifierTable.h.
Referenced by clang::Token::getObjCKeywordID().
| unsigned clang::IdentifierInfo::getObjCOrBuiltinID | ( | ) | const [inline] |
Definition at line 191 of file IdentifierTable.h.
| tok::PPKeywordKind IdentifierInfo::getPPKeywordID | ( | ) | const |
getPPKeywordID - Return the preprocessor keyword ID for this identifier. For example, "define" will return tok::pp_define.
Definition at line 188 of file IdentifierTable.cpp.
References CASE, getLength(), getNameStart(), and HASH.
Referenced by clang::Preprocessor::HandleDirective(), and clang::PreprocessingRecord::InclusionDirective().
| tok::TokenKind clang::IdentifierInfo::getTokenID | ( | ) | const [inline] |
getTokenID - If this is a source-language token (e.g. 'for'), this API can be used to cause the lexer to map identifiers to source-language tokens.
Definition at line 144 of file IdentifierTable.h.
Referenced by HasFeature(), clang::PTHLexer::Lex(), and clang::TokenLexer::Lex().
| bool clang::IdentifierInfo::hasChangedSinceDeserialization | ( | ) | const [inline] |
Determine whether this identifier has changed since it was loaded from an AST file.
Definition at line 262 of file IdentifierTable.h.
| bool clang::IdentifierInfo::hasMacroDefinition | ( | ) | const [inline] |
hasMacroDefinition - Return true if this identifier is #defined to some other value.
Definition at line 128 of file IdentifierTable.h.
Referenced by clang::Sema::CodeCompleteObjCPassingType(), EvaluateDefined(), clang::Preprocessor::getMacroInfo(), clang::arcmt::trans::getNilString(), clang::Preprocessor::HandlePragmaPoison(), clang::ASTWriter::IdentifierRead(), isTrivialSingleTokenExpansion(), MaybeAddSentinel(), and clang::Preprocessor::setMacroInfo().
| bool clang::IdentifierInfo::hasRevertedTokenIDToIdentifier | ( | ) | const [inline] |
True if RevertTokenIDToIdentifier() was called.
Definition at line 147 of file IdentifierTable.h.
| bool clang::IdentifierInfo::isCPlusPlusOperatorKeyword | ( | ) | const [inline] |
Definition at line 241 of file IdentifierTable.h.
| bool clang::IdentifierInfo::isCXX11CompatKeyword | ( | ) | const [inline] |
is/setIsCXX11CompatKeyword - Initialize information about whether or not this language token is a keyword in C++11. This controls compatibility warnings, and is only true when not parsing C++11. Once a compatibility problem has been diagnosed with this keyword, the flag will be cleared.
Definition at line 210 of file IdentifierTable.h.
| bool clang::IdentifierInfo::isExtensionToken | ( | ) | const [inline] |
get/setExtension - Initialize information about whether or not this language token is an extension. This controls extension warnings, and is only valid if a custom token ID is set.
Definition at line 197 of file IdentifierTable.h.
| bool clang::IdentifierInfo::isFromAST | ( | ) | const [inline] |
isFromAST - Return true if the identifier in its current state was loaded from an AST file.
Definition at line 256 of file IdentifierTable.h.
Referenced by clang::Preprocessor::HandlePragmaPoison(), and clang::Preprocessor::setMacroInfo().
| bool clang::IdentifierInfo::isHandleIdentifierCase | ( | ) | const [inline] |
isHandleIdentifierCase - Return true if the Preprocessor::HandleIdentifier must be called on a token of this identifier. If this returns false, we know that HandleIdentifier will not affect the token.
Definition at line 252 of file IdentifierTable.h.
Referenced by clang::PTHLexer::Lex(), and clang::TokenLexer::Lex().
| bool clang::IdentifierInfo::isImport | ( | ) | const [inline] |
Determine whether this is the contextual keyword 'import'.
Definition at line 287 of file IdentifierTable.h.
| bool clang::IdentifierInfo::isOutOfDate | ( | ) | const [inline] |
Determine whether the information for this identifier is out of date with respect to the external source.
Definition at line 274 of file IdentifierTable.h.
Referenced by isTrivialSingleTokenExpansion().
| bool clang::IdentifierInfo::isPoisoned | ( | ) | const [inline] |
isPoisoned - Return true if this token has been poisoned.
Definition at line 230 of file IdentifierTable.h.
Referenced by clang::Preprocessor::HandlePragmaPoison(), and clang::TokenLexer::Lex().
| bool clang::IdentifierInfo::isStr | ( | const char(&) | Str[StrLen] | ) | const [inline] |
isStr - Return true if this is the identifier for the specified string. This is intended to be used for string literals only: II->isStr("foo").
Definition at line 89 of file IdentifierTable.h.
References getLength(), and getNameStart().
Referenced by clang::Sema::ActOnClassPropertyRefExpr(), clang::Sema::ActOnPragmaVisibility(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::AddKnownFunctionAttributes(), diagnoseBadTypeAttribute(), clang::CodeGen::CodeGenVTables::GenerateClassData(), clang::FunctionDecl::getMemoryFunctionKind(), handleBlocksAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), clang::PragmaGCCVisibilityHandler::HandlePragma(), clang::PragmaPackHandler::HandlePragma(), clang::PragmaMSStructHandler::HandlePragma(), clang::PragmaOpenCLExtensionHandler::HandlePragma(), clang::Preprocessor::HandlePragmaComment(), clang::TypoCorrection::isKeyword(), clang::FunctionDecl::isMain(), isStd(), isStreamCharSpecialization(), clang::Preprocessor::LexOnOffSwitch(), clang::Sema::LookupMemberExpr(), MakeObjCStringLiteralFixItHint(), clang::Sema::MergeTypedefNameDecl(), ParseAlignPragma(), clang::CodeGen::CodeGenFunction::StartObjCMethod(), and clang::TemplateDeclInstantiator::VisitClassTemplateDecl().
| void clang::IdentifierInfo::RevertTokenIDToIdentifier | ( | ) | [inline] |
Revert TokenID to tok::identifier; used for GNU libstdc++ 4.2 compatibility.
TokenID is normally read-only but there are 2 instances where we revert it to tok::identifier for libstdc++ 4.2. Keep track of when this happens using this method so we can inform serialization about it.
Definition at line 155 of file IdentifierTable.h.
| void clang::IdentifierInfo::setBuiltinID | ( | unsigned | ID | ) | [inline] |
Definition at line 185 of file IdentifierTable.h.
Referenced by clang::Builtin::Context::ForgetBuiltin(), clang::Builtin::Context::InitializeBuiltins(), and clang::Sema::MergeFunctionDecl().
| void clang::IdentifierInfo::setChangedSinceDeserialization | ( | ) | [inline] |
Note that this identifier has changed since it was loaded from an AST file.
Definition at line 268 of file IdentifierTable.h.
Referenced by clang::Preprocessor::HandlePragmaPoison(), and clang::Preprocessor::setMacroInfo().
| void clang::IdentifierInfo::setFETokenInfo | ( | void * | T | ) | [inline] |
Definition at line 247 of file IdentifierTable.h.
Referenced by clang::DeclarationName::setFETokenInfo().
| void clang::IdentifierInfo::setHasMacroDefinition | ( | bool | Val | ) | [inline] |
Definition at line 131 of file IdentifierTable.h.
Referenced by clang::ASTReader::makeNamesVisible(), clang::ASTReader::setIdentifierIsMacro(), and clang::Preprocessor::setMacroInfo().
| void clang::IdentifierInfo::setImport | ( | bool | I | ) | [inline] |
Set whether this identifier is the contextual keyword 'import'.
Definition at line 290 of file IdentifierTable.h.
Referenced by clang::IdentifierTable::get(), and clang::IdentifierTable::getOwn().
| void clang::IdentifierInfo::setIsCPlusPlusOperatorKeyword | ( | bool | Val = true | ) | [inline] |
isCPlusPlusOperatorKeyword/setIsCPlusPlusOperatorKeyword controls whether this identifier is a C++ alternate representation of an operator.
Definition at line 234 of file IdentifierTable.h.
Referenced by AddCXXOperatorKeyword().
| void clang::IdentifierInfo::setIsCXX11CompatKeyword | ( | bool | Val | ) | [inline] |
Definition at line 211 of file IdentifierTable.h.
Referenced by AddKeyword().
| void clang::IdentifierInfo::setIsExtensionToken | ( | bool | Val | ) | [inline] |
Definition at line 198 of file IdentifierTable.h.
Referenced by AddKeyword().
| void clang::IdentifierInfo::setIsFromAST | ( | ) | [inline] |
Definition at line 258 of file IdentifierTable.h.
Referenced by clang::serialization::reader::ASTIdentifierLookupTrait::ReadData().
| void clang::IdentifierInfo::setIsPoisoned | ( | bool | Value = true | ) | [inline] |
setIsPoisoned - Mark this identifier as poisoned. After poisoning, the Preprocessor will emit an error every time this token is used.
Definition at line 221 of file IdentifierTable.h.
Referenced by clang::Preprocessor::HandlePragmaPoison(), clang::PoisonIdentifierRAIIObject::PoisonIdentifierRAIIObject(), clang::Preprocessor::PoisonSEHIdentifiers(), and clang::PoisonIdentifierRAIIObject::~PoisonIdentifierRAIIObject().
| void clang::IdentifierInfo::setObjCKeywordID | ( | tok::ObjCKeywordKind | ID | ) | [inline] |
Definition at line 174 of file IdentifierTable.h.
Referenced by AddObjCKeyword().
| void clang::IdentifierInfo::setObjCOrBuiltinID | ( | unsigned | ID | ) | [inline] |
Definition at line 192 of file IdentifierTable.h.
| void clang::IdentifierInfo::setOutOfDate | ( | bool | OOD | ) | [inline] |
Set whether the information for this identifier is out of date with respect to the external source.
Definition at line 278 of file IdentifierTable.h.
Referenced by clang::ASTReader::markIdentifierUpToDate().
friend class IdentifierTable [friend] |
Definition at line 80 of file IdentifierTable.h.