[llvm] [GlobalISel] Add `combine` action for C++ combine rules (PR #135941)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 16 02:12:00 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 -- llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
index a2afd6c77..2d1f0d06a 100644
--- a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
@@ -806,14 +806,12 @@ bool CombineRuleBuilder::parseAll() {
 
   if (Act0Op == "match" && Act1Op == "apply") {
     if (!Parser.parsePatternList(
-      Act0,
-            [this](auto Pat) { return addMatchPattern(std::move(Pat)); },
+            Act0, [this](auto Pat) { return addMatchPattern(std::move(Pat)); },
             "match", (RuleDef.getName() + "_match").str()))
       return false;
 
     if (!Parser.parsePatternList(
-      Act1,
-            [this](auto Pat) { return addApplyPattern(std::move(Pat)); },
+            Act1, [this](auto Pat) { return addApplyPattern(std::move(Pat)); },
             "apply", (RuleDef.getName() + "_apply").str()))
       return false;
 
@@ -830,12 +828,13 @@ bool CombineRuleBuilder::parseAll() {
       return false;
 
     if (MatchPats.empty() || ApplyPats.empty()) {
-      PrintError("'combine' action needs at least one pattern to match, and C++ code to apply");
+      PrintError("'combine' action needs at least one pattern to match, and "
+                 "C++ code to apply");
       return false;
     }
   } else {
     PrintError("Expected both a 'match' and 'apply' action in combine rule, "
-      "or a single 'combine' action");
+               "or a single 'combine' action");
     return false;
   }
 

``````````

</details>


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


More information about the llvm-commits mailing list