[llvm] 1e68dcc - [llvm][DebugInfo] formatv in DWARFDebugRnglists (#191991)

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 02:44:27 PDT 2026


Author: Konrad Kleine
Date: 2026-04-14T11:44:22+02:00
New Revision: 1e68dcc740c902ba418bd06e4e9677742b39acb8

URL: https://github.com/llvm/llvm-project/commit/1e68dcc740c902ba418bd06e4e9677742b39acb8
DIFF: https://github.com/llvm/llvm-project/commit/1e68dcc740c902ba418bd06e4e9677742b39acb8.diff

LOG: [llvm][DebugInfo] formatv in DWARFDebugRnglists (#191991)

This relates to #35980.

Added: 
    

Modified: 
    llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp
index b428c2adfe0b3..432bcd4cfc9ef 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp
@@ -13,6 +13,8 @@
 #include "llvm/Support/Errc.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Format.h"
+#include "llvm/Support/FormatAdapters.h"
+#include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/raw_ostream.h"
 
 using namespace llvm;
@@ -189,12 +191,13 @@ void RangeListEntry::dump(
 
   if (DumpOpts.Verbose) {
     // Print the section offset in verbose mode.
-    OS << format("0x%8.8" PRIx64 ":", Offset);
+    OS << formatv("{0:x8}:", Offset);
     auto EncodingString = dwarf::RangeListEncodingString(EntryKind);
     // Unsupported encodings should have been reported during parsing.
     assert(!EncodingString.empty() && "Unknown range entry encoding");
-    OS << format(" [%s%*c", EncodingString.data(),
-                 MaxEncodingStringLength - EncodingString.size() + 1, ']');
+    OS << formatv(" [{0}]",
+                  fmt_pad(EncodingString.data(), 0,
+                          MaxEncodingStringLength - EncodingString.size()));
     if (EntryKind != dwarf::DW_RLE_end_of_list)
       OS << ": ";
   }


        


More information about the llvm-commits mailing list