https://github.com/Keenuts created 
https://github.com/llvm/llvm-project/pull/158047

Follow up to #157841, replacing the C-array with std::array so iterators can be 
used.

From e42d05ca3c20817d9869f3e4cc3b98087b285175 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?= <brio...@google.com>
Date: Thu, 11 Sep 2025 13:46:04 +0200
Subject: [PATCH] [NFC][clang] replace a C-array with std::array

Follow up to #157841, replacing the C-array with std::array
so iterators can be used.
---
 clang/utils/TableGen/ClangAttrEmitter.cpp | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp 
b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 2e2f32a7a1cb1..cc558722ed6e9 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -5163,7 +5163,7 @@ enum class SpellingKind : size_t {
 static const size_t NumSpellingKinds = (size_t)SpellingKind::NumSpellingKinds;
 
 class SpellingList {
-  std::vector<std::string> Spellings[NumSpellingKinds];
+  std::array<std::vector<std::string>, NumSpellingKinds> Spellings;
 
 public:
   ArrayRef<std::string> operator[](SpellingKind K) const {
@@ -5211,11 +5211,7 @@ class SpellingList {
   }
 
   bool hasSpelling() const {
-    for (size_t Kind = 0; Kind < NumSpellingKinds; ++Kind) {
-      if (Spellings[Kind].size() > 0)
-        return true;
-    }
-    return false;
+    return llvm::any_of(Spellings, [](const auto &L) { return L.size() != 0; 
});
   }
 };
 

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to