[llvm] [llvm][DebugInfo] formatv in DWARFGdbIndex (PR #191994)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 01:59:13 PDT 2026


================
@@ -79,26 +78,26 @@ void DWARFGdbIndex::dumpSymbolTable(raw_ostream &OS) const {
     if (!E.NameOffset && !E.VecOffset)
       continue;
 
-    OS << format("    %d: Name offset = 0x%x, CU vector offset = 0x%x\n", I,
-                 E.NameOffset, E.VecOffset);
+    OS << formatv("    {0}: Name offset = {1:x}, CU vector offset = {2:x}\n", I,
+                  E.NameOffset, E.VecOffset);
 
     StringRef Name = ConstantPoolStrings.substr(
         ConstantPoolOffset - StringPoolOffset + E.NameOffset);
 
     const uint32_t CuVectorId = FindCuVectorId(E.VecOffset);
-    OS << format("      String name: %s, CU vector index: %d\n", Name.data(),
-                 CuVectorId);
+    OS << formatv("      String name: {0}, CU vector index: {1}\n", Name.data(),
+                  CuVectorId);
   }
 }
 
 void DWARFGdbIndex::dumpConstantPool(raw_ostream &OS) const {
-  OS << format("\n  Constant pool offset = 0x%x, has %" PRId64 " CU vectors:",
-               ConstantPoolOffset, (uint64_t)ConstantPoolVectors.size());
+  OS << formatv("\n  Constant pool offset = {0:x}, has {1} CU vectors:",
+                ConstantPoolOffset, (uint64_t)ConstantPoolVectors.size());
----------------
s-barannikov wrote:

```suggestion
                ConstantPoolOffset, ConstantPoolVectors.size());
```

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


More information about the llvm-commits mailing list