[llvm] [DebugInfo] DWARFFormValue use formatv instead of format (PR #180498)

Konrad Kleine via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 10 02:45:53 PST 2026


================
@@ -552,19 +557,20 @@ void DWARFFormValue::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const {
     break;
 
   case DW_FORM_rnglistx:
-    OS << format("indexed (0x%x) rangelist = ", (uint32_t)UValue);
+    OS << formatv("indexed ({0:x+}) rangelist = ", (uint32_t)UValue);
     break;
 
   case DW_FORM_loclistx:
-    OS << format("indexed (0x%x) loclist = ", (uint32_t)UValue);
+    OS << formatv("indexed ({0:x+}) loclist = ", (uint32_t)UValue);
     break;
 
   case DW_FORM_sec_offset:
-    AddrOS << format("0x%0*" PRIx64, OffsetDumpWidth, UValue);
+    AddrOS << formatv(
+        "0x{0:x-}", fmt_align(UValue, AlignStyle::Right, OffsetDumpWidth, '0'));
----------------
kwk wrote:

@DavidSpickett are you happy with the explanation? 

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


More information about the llvm-commits mailing list