================
@@ -6107,6 +6109,29 @@ static bool isFromSystemHeader(SourceManager &SM, const 
Decl *D) {
          SM.isInSystemMacro(D->getLocation());
 }
 
+static bool isKeywordInCPlusPlus(const Sema &S, const IdentifierInfo *II) {
+  if (!II)
+    return false;
+
+  // Build a static map of identifiers for all of the keywords in C++ that are
+  // not keywords in C. This allows us to do pointer comparisons instead of
+  // string comparisons when deciding whether the given identifier is a keyword
+  // or not. Note, this treats all keywords as being enabled, regardless of the
+  // setting of other language options. It intentionally disables the modules
+  // keywords because those are conditional keywords, so may be safe to use.
+  static llvm::SmallPtrSet<IdentifierInfo *, 32> Keywords;
----------------
erichkeane wrote:

note llvm::SmallPtrSet vs SmallSet is irrelevant here, the specialization for 
SmallSet on pointers is SmallPtrSet, but don't mind this being here, just 
interesting note :) 

https://github.com/llvm/llvm-project/pull/137234
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to