[llvm] [llvm][DebugInfo] formatv in LVDWARFReader (PR #192011)
Konrad Kleine via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 14 08:40:13 PDT 2026
https://github.com/kwk updated https://github.com/llvm/llvm-project/pull/192011
>From 31b4db1b416283fec1fe30f5a7cf7d437873e99c Mon Sep 17 00:00:00 2001
From: Konrad Kleine <kkleine at redhat.com>
Date: Mon, 13 Apr 2026 20:22:14 +0000
Subject: [PATCH 1/2] [llvm][DebugInfo] formatv in LVDWARFReader
This relates to #35980.
---
llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp b/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
index 772d821dcda81..ca642ef421f60 100644
--- a/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
@@ -210,7 +210,7 @@ void LVDWARFReader::processOneAttribute(const DWARFDie &Die,
FoundLowPC = false;
// We are dealing with an index into the .debug_addr section.
LLVM_DEBUG({
- dbgs() << format("indexed (%8.8x) address = ", (uint32_t)UValue);
+ dbgs() << formatv("indexed ({0:x-8}) address = ", (uint32_t)UValue);
});
}
}
@@ -263,8 +263,8 @@ void LVDWARFReader::processOneAttribute(const DWARFDie &Die,
if (!RangesOrError) {
LLVM_DEBUG({
std::string TheError(toString(RangesOrError.takeError()));
- dbgs() << format("error decoding address ranges = ",
- TheError.c_str());
+ dbgs() << formatv("error decoding address ranges = {0}",
+ TheError.c_str());
});
consumeError(RangesOrError.takeError());
break;
>From 3e27479c66f1ca0167e069feec8cacb9a572b446 Mon Sep 17 00:00:00 2001
From: Konrad Kleine <kkleine at redhat.com>
Date: Tue, 14 Apr 2026 15:31:30 +0000
Subject: [PATCH 2/2] Directly consume error
---
llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp b/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
index ca642ef421f60..6dfcd91549883 100644
--- a/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
@@ -262,9 +262,8 @@ void LVDWARFReader::processOneAttribute(const DWARFDie &Die,
GetRanges(FormValue, U);
if (!RangesOrError) {
LLVM_DEBUG({
- std::string TheError(toString(RangesOrError.takeError()));
dbgs() << formatv("error decoding address ranges = {0}",
- TheError.c_str());
+ fmt_consume(RangesOrError.takeError()));
});
consumeError(RangesOrError.takeError());
break;
More information about the llvm-commits
mailing list