|
clang 22.0.0git
|
#include "clang/Basic/IdentifierTable.h"#include "clang/Basic/CharInfo.h"#include "clang/Basic/DiagnosticLex.h"#include "clang/Basic/LangOptions.h"#include "clang/Basic/OperatorKinds.h"#include "clang/Basic/Specifiers.h"#include "clang/Basic/TargetBuiltins.h"#include "clang/Basic/TokenKinds.h"#include "llvm/ADT/DenseMapInfo.h"#include "llvm/ADT/FoldingSet.h"#include "llvm/ADT/StringMap.h"#include "llvm/ADT/StringRef.h"#include "llvm/Support/Allocator.h"#include "llvm/Support/raw_ostream.h"#include <cassert>#include <cstdio>#include <cstring>#include <string>#include "clang/Basic/TokenKinds.def"#include "clang/Basic/OperatorKinds.def"Go to the source code of this file.
Macros | |
| #define | KEYWORD(NAME, FLAGS) |
| #define | ALIAS(NAME, TOK, FLAGS) |
| #define | CXX_KEYWORD_OPERATOR(NAME, ALIAS) |
| #define | OBJC_AT_KEYWORD(NAME) |
| #define | NOTABLE_IDENTIFIER(NAME) |
| #define | TESTING_KEYWORD(NAME, FLAGS) |
| #define | KEYWORD(NAME, FLAGS) |
| #define | HASH(LEN, FIRST, THIRD) |
| #define | CASE(LEN, FIRST, THIRD, NAME) |
| #define | OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemberOnly) |
| #define | KEYWORD(NAME, FLAGS) |
Functions | |
| static KeywordStatus | getKeywordStatusHelper (const LangOptions &LangOpts, TokenKey Flag) |
| static bool | IsKeywordInCpp (unsigned Flags) |
| static void | MarkIdentifierAsKeywordInCpp (IdentifierTable &Table, StringRef Name) |
| static void | AddKeyword (StringRef Keyword, tok::TokenKind TokenCode, unsigned Flags, const LangOptions &LangOpts, IdentifierTable &Table) |
| AddKeyword - This method is used to associate a token ID with specific identifiers because they are language keywords. | |
| static void | AddCXXOperatorKeyword (StringRef Keyword, tok::TokenKind TokenCode, IdentifierTable &Table) |
| AddCXXOperatorKeyword - Register a C++ operator keyword alternative representations. | |
| static void | AddObjCKeyword (StringRef Name, tok::ObjCKeywordKind ObjCID, IdentifierTable &Table) |
| AddObjCKeyword - Register an Objective-C @keyword like "class" "selector" or "property". | |
| static void | AddNotableIdentifier (StringRef Name, tok::NotableIdentifierKind BTID, IdentifierTable &Table) |
| static KeywordStatus | getTokenKwStatus (const LangOptions &LangOpts, tok::TokenKind K) |
| Checks if the specified token kind represents a keyword in the specified language. | |
| static bool | startsWithWord (StringRef name, StringRef word) |
| Interpreting the given string using the normal CamelCase conventions, determine whether the given string starts with the given "word", which is assumed to end in a lowercase letter. | |
| static SelectorTableImpl & | getSelectorTableImpl (void *P) |
| #define ALIAS | ( | NAME, | |
| TOK, | |||
| FLAGS ) |
Referenced by sanitizeFilenameAsIdentifier().
| #define CASE | ( | LEN, | |
| FIRST, | |||
| THIRD, | |||
| NAME ) |
Referenced by clang::IdentifierInfo::getPPKeywordID(), and getStableLevel().
| #define CXX_KEYWORD_OPERATOR | ( | NAME, | |
| ALIAS ) |
| #define HASH | ( | LEN, | |
| FIRST, | |||
| THIRD ) |
Referenced by clang::IdentifierInfo::getPPKeywordID().
| #define KEYWORD | ( | NAME, | |
| FLAGS ) |
Referenced by sanitizeFilenameAsIdentifier().
| #define KEYWORD | ( | NAME, | |
| FLAGS ) |
| #define KEYWORD | ( | NAME, | |
| FLAGS ) |
| #define NOTABLE_IDENTIFIER | ( | NAME | ) |
| #define OBJC_AT_KEYWORD | ( | NAME | ) |
| #define OVERLOADED_OPERATOR | ( | Name, | |
| Spelling, | |||
| Token, | |||
| Unary, | |||
| Binary, | |||
| MemberOnly ) |
| #define TESTING_KEYWORD | ( | NAME, | |
| FLAGS ) |
|
static |
AddCXXOperatorKeyword - Register a C++ operator keyword alternative representations.
Definition at line 242 of file IdentifierTable.cpp.
References clang::IdentifierTable::get(), clang::Keyword, and clang::IdentifierInfo::setIsCPlusPlusOperatorKeyword().
|
static |
AddKeyword - This method is used to associate a token ID with specific identifiers because they are language keywords.
This causes the lexer to automatically map matching identifiers to specialized token codes.
Definition at line 216 of file IdentifierTable.cpp.
References clang::IdentifierTable::get(), clang::getKeywordStatus(), IsKeywordInCpp(), clang::Keyword, clang::KS_Disabled, clang::KS_Extension, clang::KS_Future, MarkIdentifierAsKeywordInCpp(), clang::IdentifierInfo::setIsExtensionToken(), and clang::IdentifierInfo::setIsFutureCompatKeyword().
Referenced by clang::IdentifierTable::AddKeywords().
|
static |
Definition at line 257 of file IdentifierTable.cpp.
References clang::IdentifierTable::get(), and clang::IdentifierInfo::setNotableIdentifierID().
|
static |
AddObjCKeyword - Register an Objective-C @keyword like "class" "selector" or "property".
Definition at line 251 of file IdentifierTable.cpp.
References clang::IdentifierTable::get(), and clang::IdentifierInfo::setObjCKeywordID().
|
static |
Definition at line 86 of file IdentifierTable.cpp.
References clang::BOOLSUPPORT, clang::CHAR8SUPPORT, clang::HALFSUPPORT, clang::LangOptions::isSYCL(), clang::KEYALTIVEC, clang::KEYBORLAND, clang::KEYC23, clang::KEYC99, clang::KEYCOROUTINES, clang::KEYCUDA, clang::KEYCXX, clang::KEYCXX11, clang::KEYCXX20, clang::KEYDEFERTS, clang::KEYFIXEDPOINT, clang::KEYGNU, clang::KEYHLSL, clang::KEYMODULES, clang::KEYMS, clang::KEYMSCOMPAT, clang::KEYNOCXX, clang::KEYNOMS18, clang::KEYNOOPENCL, clang::KEYNOZOS, clang::KEYOBJC, clang::KEYOPENCLC, clang::KEYOPENCLCXX, clang::KEYSYCL, clang::KEYZOS, clang::KEYZVECTOR, clang::KS_Disabled, clang::KS_Enabled, clang::KS_Extension, clang::KS_Future, clang::KS_Unknown, and clang::WCHARSUPPORT.
Referenced by clang::getKeywordStatus().
|
static |
Definition at line 702 of file IdentifierTable.cpp.
Referenced by clang::SelectorTable::getSelector(), clang::SelectorTable::getTotalMemory(), and clang::SelectorTable::~SelectorTable().
|
static |
Checks if the specified token kind represents a keyword in the specified language.
Definition at line 308 of file IdentifierTable.cpp.
References clang::KS_Disabled.
Referenced by clang::IdentifierInfo::isKeyword().
Definition at line 201 of file IdentifierTable.cpp.
References clang::BOOLSUPPORT, clang::CHAR8SUPPORT, clang::KEYCXX, clang::KEYCXX11, clang::KEYCXX20, and clang::WCHARSUPPORT.
Referenced by AddKeyword().
|
static |
Definition at line 206 of file IdentifierTable.cpp.
References clang::IdentifierTable::get(), clang::IdentifierInfo::setHandleIdentifierCase(), and clang::IdentifierInfo::setIsKeywordInCPlusPlus().
Referenced by AddKeyword().
|
static |
Interpreting the given string using the normal CamelCase conventions, determine whether the given string starts with the given "word", which is assumed to end in a lowercase letter.
Definition at line 585 of file IdentifierTable.cpp.
References clang::isLowercase().
Referenced by clang::Selector::getInstTypeMethodFamily().