diff options
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r-- | clang/lib/Basic/IdentifierTable.cpp | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index 613b43fce95..dd097047dce 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/lib/Basic/IdentifierTable.cpp @@ -122,7 +122,7 @@ namespace { /// \brief Translates flags as specified in TokenKinds.def into keyword status /// in the given language standard. -static KeywordStatus getKeywordStatus(const LangOptions &LangOpts, +static KeywordStatus GetKeywordStatus(const LangOptions &LangOpts, unsigned Flags) { if (Flags == KEYALL) return KS_Enabled; if (LangOpts.CPlusPlus && (Flags & KEYCXX)) return KS_Enabled; @@ -151,7 +151,7 @@ static KeywordStatus getKeywordStatus(const LangOptions &LangOpts, static void AddKeyword(StringRef Keyword, tok::TokenKind TokenCode, unsigned Flags, const LangOptions &LangOpts, IdentifierTable &Table) { - KeywordStatus AddResult = getKeywordStatus(LangOpts, Flags); + KeywordStatus AddResult = GetKeywordStatus(LangOpts, Flags); // Don't add this keyword under MSVCCompat. if (LangOpts.MSVCCompat && (Flags & KEYNOMS)) @@ -209,31 +209,6 @@ void IdentifierTable::AddKeywords(const LangOptions &LangOpts) { LangOpts, *this); } -/// \brief Checks if the specified token kind represents a keyword in the -/// specified language. -/// \returns Status of the keyword in the language. -static KeywordStatus getTokenKwStatus(const LangOptions &LangOpts, - tok::TokenKind K) { - switch (K) { -#define KEYWORD(NAME, FLAGS) \ - case tok::kw_##NAME: return getKeywordStatus(LangOpts, FLAGS); -#include "clang/Basic/TokenKinds.def" - default: return KS_Disabled; - } -} - -/// \brief Returns true if the identifier represents a keyword in the -/// specified language. -bool IdentifierInfo::isKeyword(const LangOptions &LangOpts) { - switch (getTokenKwStatus(LangOpts, getTokenID())) { - case KS_Enabled: - case KS_Extension: - return true; - default: - return false; - } -} - tok::PPKeywordKind IdentifierInfo::getPPKeywordID() const { // We use a perfect hash function here involving the length of the keyword, // the first and third character. For preprocessor ID's there are no |