[llvm] b16c6b2 - [TableGen] Use ListSeparator (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 10 20:01:49 PST 2021
Author: Kazu Hirata
Date: 2021-02-10T20:01:20-08:00
New Revision: b16c6b2a83d9ba94cde7cc03dfea932077442859
URL: https://github.com/llvm/llvm-project/commit/b16c6b2a83d9ba94cde7cc03dfea932077442859
DIFF: https://github.com/llvm/llvm-project/commit/b16c6b2a83d9ba94cde7cc03dfea932077442859.diff
LOG: [TableGen] Use ListSeparator (NFC)
Added:
Modified:
llvm/utils/TableGen/CodeGenSchedule.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/CodeGenSchedule.cpp b/llvm/utils/TableGen/CodeGenSchedule.cpp
index 14d0ee6d5565..95c269ec9d12 100644
--- a/llvm/utils/TableGen/CodeGenSchedule.cpp
+++ b/llvm/utils/TableGen/CodeGenSchedule.cpp
@@ -708,10 +708,10 @@ void CodeGenSchedModels::collectSchedRW() {
/// Compute a SchedWrite name from a sequence of writes.
std::string CodeGenSchedModels::genRWName(ArrayRef<unsigned> Seq, bool IsRead) {
std::string Name("(");
- for (auto I = Seq.begin(), E = Seq.end(); I != E; ++I) {
- if (I != Seq.begin())
- Name += '_';
- Name += getSchedRW(*I, IsRead).Name;
+ ListSeparator LS("_");
+ for (unsigned I : Seq) {
+ Name += LS;
+ Name += getSchedRW(I, IsRead).Name;
}
Name += ')';
return Name;
@@ -990,10 +990,10 @@ CodeGenSchedModels::createSchedClassName(Record *ItinClassDef,
std::string CodeGenSchedModels::createSchedClassName(const RecVec &InstDefs) {
std::string Name;
- for (RecIter I = InstDefs.begin(), E = InstDefs.end(); I != E; ++I) {
- if (I != InstDefs.begin())
- Name += '_';
- Name += (*I)->getName();
+ ListSeparator LS("_");
+ for (const Record *InstDef : InstDefs) {
+ Name += LS;
+ Name += InstDef->getName();
}
return Name;
}
More information about the llvm-commits
mailing list