[llvm] 9e4033b - [TableGen] Use ListSeparator (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 20 21:46:41 PST 2021
Author: Kazu Hirata
Date: 2021-02-20T21:46:01-08:00
New Revision: 9e4033b06bec48b2e9399d24aaa8c975cd3bd10b
URL: https://github.com/llvm/llvm-project/commit/9e4033b06bec48b2e9399d24aaa8c975cd3bd10b
DIFF: https://github.com/llvm/llvm-project/commit/9e4033b06bec48b2e9399d24aaa8c975cd3bd10b.diff
LOG: [TableGen] Use ListSeparator (NFC)
Added:
Modified:
llvm/utils/TableGen/FastISelEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/FastISelEmitter.cpp b/llvm/utils/TableGen/FastISelEmitter.cpp
index 0729ab70d696..2892c7d818dd 100644
--- a/llvm/utils/TableGen/FastISelEmitter.cpp
+++ b/llvm/utils/TableGen/FastISelEmitter.cpp
@@ -290,7 +290,9 @@ struct OperandsSignature {
}
void PrintParameters(raw_ostream &OS) const {
+ ListSeparator LS;
for (unsigned i = 0, e = Operands.size(); i != e; ++i) {
+ OS << LS;
if (Operands[i].isReg()) {
OS << "unsigned Op" << i << ", bool Op" << i << "IsKill";
} else if (Operands[i].isImm()) {
@@ -300,31 +302,25 @@ struct OperandsSignature {
} else {
llvm_unreachable("Unknown operand kind!");
}
- if (i + 1 != e)
- OS << ", ";
}
}
void PrintArguments(raw_ostream &OS,
const std::vector<std::string> &PR) const {
assert(PR.size() == Operands.size());
- bool PrintedArg = false;
+ ListSeparator LS;
for (unsigned i = 0, e = Operands.size(); i != e; ++i) {
if (PR[i] != "")
// Implicit physical register operand.
continue;
- if (PrintedArg)
- OS << ", ";
+ OS << LS;
if (Operands[i].isReg()) {
OS << "Op" << i << ", Op" << i << "IsKill";
- PrintedArg = true;
} else if (Operands[i].isImm()) {
OS << "imm" << i;
- PrintedArg = true;
} else if (Operands[i].isFP()) {
OS << "f" << i;
- PrintedArg = true;
} else {
llvm_unreachable("Unknown operand kind!");
}
@@ -332,7 +328,9 @@ struct OperandsSignature {
}
void PrintArguments(raw_ostream &OS) const {
+ ListSeparator LS;
for (unsigned i = 0, e = Operands.size(); i != e; ++i) {
+ OS << LS;
if (Operands[i].isReg()) {
OS << "Op" << i << ", Op" << i << "IsKill";
} else if (Operands[i].isImm()) {
@@ -342,8 +340,6 @@ struct OperandsSignature {
} else {
llvm_unreachable("Unknown operand kind!");
}
- if (i + 1 != e)
- OS << ", ";
}
}
More information about the llvm-commits
mailing list