[llvm] [NFC][LLVM] Adopt ListSeparator in more places (PR #172909)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 9 12:12:29 PST 2026


================
@@ -24,15 +25,9 @@ using namespace llvm;
 
 void llvm::dumpBytes(ArrayRef<uint8_t> bytes, raw_ostream &OS) {
   static const char hex_rep[] = "0123456789abcdef";
-  bool First = true;
-  for (char i: bytes) {
-    if (First)
-      First = false;
-    else
-      OS << ' ';
-    OS << hex_rep[(i & 0xF0) >> 4];
-    OS << hex_rep[i & 0xF];
-  }
+  ListSeparator LS(" ");
+  for (char i : bytes)
+    OS << LS << hex_rep[(i & 0xF0) >> 4] << hex_rep[i & 0xF];
----------------
jurahul wrote:

Resolving in favor of not using formatv() per comment below.

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


More information about the llvm-commits mailing list