diff options
| author | Dylan Noblesmith <nobled@dreamwidth.org> | 2011-04-09 13:34:05 +0000 |
|---|---|---|
| committer | Dylan Noblesmith <nobled@dreamwidth.org> | 2011-04-09 13:34:05 +0000 |
| commit | 92c07c27be6fd548fb3dcf8905c93d9f5d87139b (patch) | |
| tree | d23193776f437e09dd43c4b8849c4aa1831bcd52 /clang/lib | |
| parent | 70e73a3d60b77a1001c97ba2f640f828a695bbfe (diff) | |
| download | bcm5719-llvm-92c07c27be6fd548fb3dcf8905c93d9f5d87139b.tar.gz bcm5719-llvm-92c07c27be6fd548fb3dcf8905c93d9f5d87139b.zip | |
refactor flags for TokenKinds.def
Make KEYALL a combination of all other flags instead
of its own separate flag. Also rewrite the enum
definitions in hex instead of decimal.
llvm-svn: 129213
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Basic/IdentifierTable.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index 7647f0776d8..cfe8d27927d 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/lib/Basic/IdentifierTable.cpp @@ -81,17 +81,17 @@ IdentifierTable::IdentifierTable(const LangOptions &LangOpts, // Constants for TokenKinds.def namespace { enum { - KEYALL = 1, - KEYC99 = 2, - KEYCXX = 4, - KEYCXX0X = 8, - KEYGNU = 16, - KEYMS = 32, - BOOLSUPPORT = 64, - KEYALTIVEC = 128, - KEYNOCXX = 256, - KEYBORLAND = 512, - KEYOPENCL = 1024 + KEYC99 = 0x1, + KEYCXX = 0x2, + KEYCXX0X = 0x4, + KEYGNU = 0x8, + KEYMS = 0x10, + BOOLSUPPORT = 0x20, + KEYALTIVEC = 0x40, + KEYNOCXX = 0x80, + KEYBORLAND = 0x100, + KEYOPENCL = 0x200, + KEYALL = 0x3ff }; } @@ -107,7 +107,7 @@ static void AddKeyword(llvm::StringRef Keyword, tok::TokenKind TokenCode, unsigned Flags, const LangOptions &LangOpts, IdentifierTable &Table) { unsigned AddResult = 0; - if (Flags & KEYALL) AddResult = 2; + if (Flags == KEYALL) AddResult = 2; else if (LangOpts.CPlusPlus && (Flags & KEYCXX)) AddResult = 2; else if (LangOpts.CPlusPlus0x && (Flags & KEYCXX0X)) AddResult = 2; else if (LangOpts.C99 && (Flags & KEYC99)) AddResult = 2; |

