[llvm] [TableGen] Use `contains` instead of `count`. NFC. (PR #143156)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 08:43:28 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);
----------------
jayfoad wrote:

I assumed they were deliberately `int` because of `IsEndA < IsEndB` below, which would look a bit unusual if they were `bool`.

https://github.com/llvm/llvm-project/pull/143156


More information about the llvm-commits mailing list