[llvm][DebugInfo] Use formatv in GsymReaderV1 and GsymReaderV2#192000
Merged
[llvm][DebugInfo] Use formatv in GsymReaderV1 and GsymReaderV2#192000
Conversation
Member
|
@llvm/pr-subscribers-debuginfo Author: Konrad Kleine (kwk) ChangesThis relates to #35980. Full diff: https://github.com/llvm/llvm-project/pull/192000.diff 1 Files Affected:
diff --git a/llvm/lib/DebugInfo/GSYM/GsymReader.cpp b/llvm/lib/DebugInfo/GSYM/GsymReader.cpp
index 0a5bb7caaee8c..1a20bd6310e7f 100644
--- a/llvm/lib/DebugInfo/GSYM/GsymReader.cpp
+++ b/llvm/lib/DebugInfo/GSYM/GsymReader.cpp
@@ -17,6 +17,7 @@
#include "llvm/DebugInfo/GSYM/LineTable.h"
#include "llvm/Support/BinaryStreamReader.h"
#include "llvm/Support/DataExtractor.h"
+#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MemoryBuffer.h"
using namespace llvm;
@@ -398,7 +399,7 @@ void GsymReader::dump(raw_ostream &OS) {
OS << " (ADDRESS)\n";
OS << "====== =============================== \n";
for (uint32_t I = 0; I < Header.NumAddresses; ++I) {
- OS << format("[%4u] ", I);
+ OS << formatv("[{0,4}] ", I);
switch (Hdr->AddrOffSize) {
case 1: OS << HEX8(getAddrOffsets<uint8_t>()[I]); break;
case 2: OS << HEX16(getAddrOffsets<uint16_t>()[I]); break;
@@ -413,13 +414,13 @@ void GsymReader::dump(raw_ostream &OS) {
OS << "INDEX Offset\n";
OS << "====== ==========\n";
for (uint32_t I = 0; I < Header.NumAddresses; ++I)
- OS << format("[%4u] ", I) << HEX32(AddrInfoOffsets[I]) << "\n";
+ OS << formatv("[{0,4}] ", I) << HEX32(AddrInfoOffsets[I]) << "\n";
// Dump the file table.
OS << "\nFiles:\n";
OS << "INDEX DIRECTORY BASENAME PATH\n";
OS << "====== ========== ========== ==============================\n";
for (uint32_t I = 0; I < Files.size(); ++I) {
- OS << format("[%4u] ", I) << HEX32(Files[I].Dir) << ' '
+ OS << formatv("[{0,4}] ", I) << HEX32(Files[I].Dir) << ' '
<< HEX32(Files[I].Base) << ' ';
dump(OS, getFile(I));
OS << "\n";
|
This was referenced Apr 14, 2026
DavidSpickett
approved these changes
Apr 14, 2026
Contributor
Author
|
@s-barannikov do you approve this PR? If it is enough that David approved, I'm fine to merge it. After resolving the conflict of course. |
s-barannikov
approved these changes
Apr 16, 2026
Contributor
s-barannikov
left a comment
There was a problem hiding this comment.
LGTM, assuming conflict resolution doesn't change it significantly.
This relates to llvm#35980.
Contributor
Author
It is not significantly different but the code was reorganized and split into V1 and V2 in c365068. I'm running local tests to see if the newly pushed code works. UPDATE: |
alexfh
pushed a commit
to alexfh/llvm-project
that referenced
this pull request
Apr 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This relates to #35980.
Here are all independent PRs that deal with replacing
formatwithformatvinllvm/lib/DebugInfo: