[llvm] [TableGen] Improvements to Named operands in InstrInfoEmitter (PR #124960)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 29 09:53:47 PST 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 27e01d1d74bf5990e2ec69b8d588eb1baa401ed9 2066026ffa9afd6bae0319ca2d694f9f855a7642 --extensions cpp -- llvm/utils/TableGen/InstrInfoEmitter.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp
index 4f1bbe117b..8570b85439 100644
--- a/llvm/utils/TableGen/InstrInfoEmitter.cpp
+++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp
@@ -277,7 +277,7 @@ void InstrInfoEmitter::emitOperandNameMappings(
}
OperandEnumToID.reserve(NumOperandNames);
- for (const auto & Op: OperandNameToID)
+ for (const auto &Op : OperandNameToID)
OperandEnumToID.push_back(Op.second);
OS << "#ifdef GET_INSTRINFO_OPERAND_ENUM\n";
@@ -297,8 +297,11 @@ void InstrInfoEmitter::emitOperandNameMappings(
OS << "int16_t getNamedOperandIdx(uint16_t Opcode, uint16_t NamedIdx) {\n";
if (NumOperandNames != 0) {
assert(MaxOperandNo <= std::numeric_limits<int16_t>::max());
- StringRef Type = MaxOperandNo <= std::numeric_limits<int8_t>::max() ? "int8_t" : "int16_t";
- OS << " static constexpr " << Type << " OperandMap[][" << NumOperandNames << "] = {\n";
+ StringRef Type = MaxOperandNo <= std::numeric_limits<int8_t>::max()
+ ? "int8_t"
+ : "int16_t";
+ OS << " static constexpr " << Type << " OperandMap[][" << NumOperandNames
+ << "] = {\n";
for (const auto &Entry : OperandMap) {
const std::map<unsigned, unsigned> &OpList = Entry.first;
``````````
</details>
https://github.com/llvm/llvm-project/pull/124960
More information about the llvm-commits
mailing list