[llvm] 64557e0 - [TableGen] Use ListSeparator (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 12 23:45:12 PST 2021
Author: Kazu Hirata
Date: 2021-02-12T23:44:30-08:00
New Revision: 64557e096d4af44dbeb51d0cc16722dc78144861
URL: https://github.com/llvm/llvm-project/commit/64557e096d4af44dbeb51d0cc16722dc78144861
DIFF: https://github.com/llvm/llvm-project/commit/64557e096d4af44dbeb51d0cc16722dc78144861.diff
LOG: [TableGen] Use ListSeparator (NFC)
Added:
Modified:
llvm/utils/TableGen/RegisterInfoEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/RegisterInfoEmitter.cpp b/llvm/utils/TableGen/RegisterInfoEmitter.cpp
index ad60295f0afc..41d5720b70a6 100644
--- a/llvm/utils/TableGen/RegisterInfoEmitter.cpp
+++ b/llvm/utils/TableGen/RegisterInfoEmitter.cpp
@@ -1029,9 +1029,10 @@ RegisterInfoEmitter::runMCDesc(raw_ostream &OS, CodeGenTarget &Target,
ArrayRef<const CodeGenRegister*> Roots = RegBank.getRegUnit(i).getRoots();
assert(!Roots.empty() && "All regunits must have a root register.");
assert(Roots.size() <= 2 && "More than two roots not supported yet.");
- OS << " { " << getQualifiedName(Roots.front()->TheDef);
- for (unsigned r = 1; r != Roots.size(); ++r)
- OS << ", " << getQualifiedName(Roots[r]->TheDef);
+ OS << " { ";
+ ListSeparator LS;
+ for (const CodeGenRegister *R : Roots)
+ OS << LS << getQualifiedName(R->TheDef);
OS << " },\n";
}
OS << "};\n\n";
More information about the llvm-commits
mailing list