[TableGen] Use ListSeparator (NFC)

This commit is contained in:
Kazu Hirata 2021-02-09 22:14:26 -08:00
parent 222d380d2f
commit 0f360fffe7
1 changed files with 7 additions and 13 deletions

View File

@ -91,13 +91,10 @@ void ValueTypeByHwMode::writeToStream(raw_ostream &OS) const {
llvm::sort(Pairs, deref<std::less<PairType>>());
OS << '{';
for (unsigned i = 0, e = Pairs.size(); i != e; ++i) {
const PairType *P = Pairs[i];
OS << '(' << getModeName(P->first)
<< ':' << getMVTName(P->second).str() << ')';
if (i != e-1)
OS << ',';
}
ListSeparator LS(",");
for (const PairType *P : Pairs)
OS << LS << '(' << getModeName(P->first) << ':'
<< getMVTName(P->second).str() << ')';
OS << '}';
}
@ -183,12 +180,9 @@ void RegSizeInfoByHwMode::writeToStream(raw_ostream &OS) const {
llvm::sort(Pairs, deref<std::less<PairType>>());
OS << '{';
for (unsigned i = 0, e = Pairs.size(); i != e; ++i) {
const PairType *P = Pairs[i];
OS << '(' << getModeName(P->first) << ':' << P->second << ')';
if (i != e-1)
OS << ',';
}
ListSeparator LS(",");
for (const PairType *P : Pairs)
OS << LS << '(' << getModeName(P->first) << ':' << P->second << ')';
OS << '}';
}