[clang] 84db355 - [clang] Fix KEYALL

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Wed May 11 11:29:29 PDT 2022


Author: Yaxun (Sam) Liu
Date: 2022-05-11T14:28:08-04:00
New Revision: 84db35594953a6f7aff7cbc007f1c5d2fd35b1a9

URL: https://github.com/llvm/llvm-project/commit/84db35594953a6f7aff7cbc007f1c5d2fd35b1a9
DIFF: https://github.com/llvm/llvm-project/commit/84db35594953a6f7aff7cbc007f1c5d2fd35b1a9.diff

LOG: [clang] Fix KEYALL

Update KEYALL to cover KEYCUDA. Introduce KEYMAX and
a generic way to update KEYALL.

Reviewed by: Dan Liew

Differential Revision: https://reviews.llvm.org/D125396

Added: 
    

Modified: 
    clang/lib/Basic/IdentifierTable.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index af19de44bed8..82cee4aa052d 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -109,9 +109,10 @@ namespace {
     KEYMSCOMPAT   = 0x800000,
     KEYSYCL       = 0x1000000,
     KEYCUDA       = 0x2000000,
+    KEYMAX        = KEYCUDA, // The maximum key
     KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20,
-    KEYALL = (0x1ffffff & ~KEYNOMS18 &
-              ~KEYNOOPENCL) // KEYNOMS18 and KEYNOOPENCL are used to exclude.
+    KEYALL = (KEYMAX | (KEYMAX-1)) & ~KEYNOMS18 &
+             ~KEYNOOPENCL // KEYNOMS18 and KEYNOOPENCL are used to exclude.
   };
 
   /// How a keyword is treated in the selected standard.


        


More information about the cfe-commits mailing list