[llvm] [TableGen] Use `contains` instead of `count`. NFC. (PR #143156)
    Rahul Joshi via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Jun  6 08:49:37 PDT 2025
    
    
  
================
@@ -642,7 +642,8 @@ static void emitLeafTable(const DirectiveLanguage &DirLang, raw_ostream &OS,
     auto &LeavesB = LeafTable[B];
     int DirA = LeavesA[0], DirB = LeavesB[0];
     // First of all, end directives compare greater than non-end directives.
-    int IsEndA = EndDirectives.count(DirA), IsEndB = EndDirectives.count(DirB);
+    int IsEndA = EndDirectives.contains(DirA);
----------------
jurahul wrote:
I think in C++ < operator for bools is defined the natural way: Google search AI overview:
> This behavior is consistent with the numerical interpretation of false and true as 0 and 1, respectively
https://github.com/llvm/llvm-project/pull/143156
    
    
More information about the llvm-commits
mailing list