[llvm] [llvm][DebugInfo] Use formatv in DWARFExpressionPrinter (PR #191993)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 05:47:31 PDT 2026


================
@@ -176,7 +176,8 @@ void printDwarfExpression(const DWARFExpression *E, raw_ostream &OS,
     if (!printOp(&Op, OS, DumpOpts, E, U) && !DumpOpts.PrintRegisterOnly) {
       uint64_t FailOffset = Op.getEndOffset();
       while (FailOffset < E->getData().size())
-        OS << format(" %02x", static_cast<uint8_t>(E->getData()[FailOffset++]));
+        OS << formatv(" {0:x-2}",
+                      static_cast<uint8_t>(E->getData()[FailOffset++]));
----------------
DavidSpickett wrote:

No I think you're right, we don't need the cast.

I was thinking it would be char and then formatv would print a character, but the format has `x` in it, so it'll print hex anyway.

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


More information about the llvm-commits mailing list