[llvm] [MC] Teach checkAsmTiedOperandConstraints about optional operands (PR #81381)

via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 10 13:28:12 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 2a51c56d8e0e410bf896be2c6bebe37344a996e1 22bada0f96087f0e54dcfeadd4938f408af81949 -- 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 bd4a5dab17..c11c6d4d3c 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -3042,11 +3042,11 @@ static void emitAsmTiedOperandConstraints(CodeGenTarget &Target,
   OS << "  const uint8_t *Converter = ConversionTable[Kind];\n";
   if (HasOptionalOperands) {
     OS << "  unsigned DefaultsOffset[" << (MaxNumOperands + 1)
-          << "] = { 0 };\n";
+       << "] = { 0 };\n";
     OS << "  assert(OptionalOperandsMask.size() == " << (MaxNumOperands)
-          << ");\n";
+       << ");\n";
     OS << "  for (unsigned i = 0, NumDefaults = 0; i < " << (MaxNumOperands)
-          << "; ++i) {\n";
+       << "; ++i) {\n";
     OS << "    DefaultsOffset[i + 1] = NumDefaults;\n";
     OS << "    NumDefaults += (OptionalOperandsMask[i] ? 1 : 0);\n";
     OS << "  }\n";

``````````

</details>


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


More information about the llvm-commits mailing list