[llvm] [TableGen] Sort matchables depending on predicates. (PR #84483)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 8 05:47:48 PST 2024
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 7457e2c1535acd548d2619dfb34eb93d27d15908 8aea8965690c01a0d1a4dcffc3b86b41646024bb -- llvm/utils/TableGen/AsmMatcherEmitter.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index 7c2f24c289..6ce3500630 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -648,9 +648,11 @@ struct MatchableInfo {
// Sort by the alphabetical naming of the required features.
for (unsigned i = 0, e = RequiredFeatures.size(); i != e; ++i) {
- if (RequiredFeatures[i]->TheDef->getName() < RHS.RequiredFeatures[i]->TheDef->getName())
+ if (RequiredFeatures[i]->TheDef->getName() <
+ RHS.RequiredFeatures[i]->TheDef->getName())
return true;
- if (RHS.RequiredFeatures[i]->TheDef->getName() < RequiredFeatures[i]->TheDef->getName())
+ if (RHS.RequiredFeatures[i]->TheDef->getName() <
+ RequiredFeatures[i]->TheDef->getName())
return false;
}
@@ -697,15 +699,17 @@ struct MatchableInfo {
HasGT = true;
}
- if (HasLT != HasGT)
+ if (HasLT != HasGT)
return false;
// Check if can distringuish by the alphabetical ordering of features.
if (RequiredFeatures.size() != RHS.RequiredFeatures.size())
return false;
for (unsigned i = 0, e = RequiredFeatures.size(); i != e; ++i) {
- if (RequiredFeatures[i]->TheDef->getName() < RHS.RequiredFeatures[i]->TheDef->getName()
- || RHS.RequiredFeatures[i]->TheDef->getName() < RequiredFeatures[i]->TheDef->getName())
+ if (RequiredFeatures[i]->TheDef->getName() <
+ RHS.RequiredFeatures[i]->TheDef->getName() ||
+ RHS.RequiredFeatures[i]->TheDef->getName() <
+ RequiredFeatures[i]->TheDef->getName())
return false;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/84483
More information about the llvm-commits
mailing list