From 14e0945738b918227af3d7b0395f98847db0647c Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 9 Feb 2021 22:14:26 -0800 Subject: [PATCH] [TableGen] Use ListSeparator (NFC) --- utils/TableGen/InfoByHwMode.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/utils/TableGen/InfoByHwMode.cpp b/utils/TableGen/InfoByHwMode.cpp index 7cd1b0f0813..3d236b82803 100644 --- a/utils/TableGen/InfoByHwMode.cpp +++ b/utils/TableGen/InfoByHwMode.cpp @@ -91,13 +91,10 @@ void ValueTypeByHwMode::writeToStream(raw_ostream &OS) const { llvm::sort(Pairs, deref>()); 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>()); 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 << '}'; }