[llvm] [DebugInfo] DWARFFormValue use formatv instead of format (PR #180498)
Konrad Kleine via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 10 08:05:54 PST 2026
================
@@ -353,7 +355,8 @@ bool DWARFFormValue::extractValue(const DWARFDataExtractor &Data,
void DWARFFormValue::dumpAddress(raw_ostream &OS, uint8_t AddressSize,
uint64_t Address) {
uint8_t HexDigits = AddressSize * 2;
- OS << format("0x%*.*" PRIx64, HexDigits, HexDigits, Address);
+ OS << formatv("0x{0:x-}",
----------------
kwk wrote:
No, as I explained earlier, when we have dynamic width or precision I need to use `fmt_align` and that prepends to the formatted string. For example, instead of `0x00000fff` we would get `000000xfff` when we use `{0:x+}`. Therefore I chose consistently to use `{0:x+}` for the most part and only `0x{0:x-}` when I have dynamic width. Make sense?
https://github.com/llvm/llvm-project/pull/180498
More information about the llvm-commits
mailing list