[llvm] [utils][TableGen] Handle versions on clause/directive spellings (PR #143021)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 07:22:14 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- llvm/include/llvm/Frontend/Directive/Spelling.h llvm/lib/Frontend/Directive/Spelling.cpp llvm/include/llvm/TableGen/DirectiveEmitter.h llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/utils/TableGen/Basic/DirectiveEmitter.cpp b/llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
index c2e707955..f45d701fd 100644
--- a/llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
+++ b/llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
@@ -417,8 +417,8 @@ static void generateGetName(ArrayRef<const Record *> Records, raw_ostream &OS,
     } else {
       OS << " {\n";
       std::string SpellingsName = Ident + "_spellings";
-      OS << "      static constexpr llvm::directive::Spelling "
-         << SpellingsName << "[] = {\n";
+      OS << "      static constexpr llvm::directive::Spelling " << SpellingsName
+         << "[] = {\n";
       for (auto &S : Spellings) {
         OS << "          {\"" << S.Name << "\", {" << S.Versions.Min << ", "
            << S.Versions.Max << "}},\n";

``````````

</details>


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


More information about the llvm-commits mailing list