[SCEV] Use ListSeparator (NFC)
GitOrigin-RevId: df35a183d7d447aa4f452ec1c56f9f04d4c02ee7
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 13b07d7..c6152f3 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -321,12 +321,9 @@
llvm_unreachable("There are no other nary expression types.");
}
OS << "(";
- for (SCEVNAryExpr::op_iterator I = NAry->op_begin(), E = NAry->op_end();
- I != E; ++I) {
- OS << **I;
- if (std::next(I) != E)
- OS << OpStr;
- }
+ ListSeparator LS(OpStr);
+ for (const SCEV *Op : NAry->operands())
+ OS << LS << *Op;
OS << ")";
switch (NAry->getSCEVType()) {
case scAddExpr: