Skip to content

[llvm][DebugInfo] Use formatv in LVDWARFReader#192011

Merged
kwk merged 3 commits intollvm:mainfrom
kwk:format-28
Apr 16, 2026
Merged

[llvm][DebugInfo] Use formatv in LVDWARFReader#192011
kwk merged 3 commits intollvm:mainfrom
kwk:format-28

Conversation

@kwk
Copy link
Copy Markdown
Contributor

@kwk kwk commented Apr 14, 2026

This relates to #35980.

Here are all independent PRs that deal with replacing format with formatv in llvm/lib/DebugInfo:

@llvmbot
Copy link
Copy Markdown
Member

llvmbot commented Apr 14, 2026

@llvm/pr-subscribers-debuginfo

Author: Konrad Kleine (kwk)

Changes

This relates to #35980.


Full diff: https://github.com/llvm/llvm-project/pull/192011.diff

1 Files Affected:

  • (modified) llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp (+3-3)
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;

This was referenced Apr 14, 2026
Comment on lines +265 to +267
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());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use fmt_consume(RangesOrError.takeError())

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 3e27479

Copy link
Copy Markdown
Collaborator

@DavidSpickett DavidSpickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming you clean up the TheError part.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 14, 2026

🐧 Linux x64 Test Results

  • 193736 tests passed
  • 5060 tests skipped

✅ The build succeeded and all tests passed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 14, 2026

🪟 Windows x64 Test Results

  • 133644 tests passed
  • 3113 tests skipped

✅ The build succeeded and all tests passed.

@kwk kwk changed the title [llvm][DebugInfo] formatv in LVDWARFReader [llvm][DebugInfo] Use formatv in LVDWARFReader Apr 15, 2026
@kwk kwk merged commit 3d0d615 into llvm:main Apr 16, 2026
10 checks passed
@kwk kwk deleted the format-28 branch April 16, 2026 12:03
alexfh pushed a commit to alexfh/llvm-project that referenced this pull request Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants