[llvm] [NFC][LLVM] Use ListSeparator in AsmWriter (PR #161422)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 30 14:00:54 PDT 2025


================
@@ -1700,14 +1696,12 @@ static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
   if (const ConstantArray *CA = dyn_cast<ConstantArray>(CV)) {
     Type *ETy = CA->getType()->getElementType();
     Out << '[';
-    WriterCtx.TypePrinter->print(ETy, Out);
-    Out << ' ';
-    WriteAsOperandInternal(Out, CA->getOperand(0), WriterCtx);
-    for (unsigned i = 1, e = CA->getNumOperands(); i != e; ++i) {
-      Out << ", ";
+    ListSeparator LS;
+    for (const Value *Op : CA->operand_values()) {
----------------
jurahul wrote:

Done.

https://github.com/llvm/llvm-project/pull/161422


More information about the llvm-commits mailing list