diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2014-12-02 14:52:20 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2014-12-02 14:52:20 +0000 |
commit | 376aee9ae7ca12db767b23a7b9168083772cc311 (patch) | |
tree | 7a6f8658b54b4ef1158e5c7411dc373c877c764c /clang/lib/Basic/IdentifierTable.cpp | |
parent | d035fbb96f58df15964fa6f0cef0110656de678f (diff) | |
download | bcm5719-llvm-376aee9ae7ca12db767b23a7b9168083772cc311.tar.gz bcm5719-llvm-376aee9ae7ca12db767b23a7b9168083772cc311.zip |
Reverted r223114, it caused failure on on clang-native-arm-cortex-a9.
llvm-svn: 223120
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 |