[llvm] r336061 - Revert "[llvm-readobj] Fix printing format"
Paul Semel via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 1 04:54:09 PDT 2018
Author: paulsemel
Date: Sun Jul 1 04:54:09 2018
New Revision: 336061
URL: http://llvm.org/viewvc/llvm-project?rev=336061&view=rev
Log:
Revert "[llvm-readobj] Fix printing format"
There is a problem with the formatting on windows build.
I need to investigate on this.
Removed:
llvm/trunk/test/tools/llvm-readobj/print-section.test
Modified:
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Removed: llvm/trunk/test/tools/llvm-readobj/print-section.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/print-section.test?rev=336060&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/print-section.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/print-section.test (removed)
@@ -1,8 +0,0 @@
-RUN: llvm-readobj -p .text %p/Inputs/elf-groups.x86_64 \
-RUN: | FileCheck %s
-
-CHECK: [000000] UH..H....E.
-CHECK: [00000f] .E.x.E..
-CHECK: [00001a] ..}..
-CHECK: [000023] .}..
-CHECK: [00002b] 1.H...].
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=336061&r1=336060&r2=336061&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Sun Jul 1 04:54:09 2018
@@ -3275,11 +3275,6 @@ void GNUStyle<ELFT>::printProgramHeaders
}
}
-void printAsPrintable(raw_ostream &W, StringRef S) {
- for (char C : S)
- W << (isprint(C) ? C : '.');
-}
-
template <class ELFT>
void GNUStyle<ELFT>::printSectionAsString(const ELFO *Obj,
StringRef SectionName) {
@@ -3303,9 +3298,8 @@ void GNUStyle<ELFT>::printSectionAsStrin
CurrentWord++;
continue;
}
- OS << format("[%6tx] ", CurrentWord - SecContent);
- printAsPrintable(OS, StringRef(CurrentWord, WordSize));
- OS << '\n';
+ OS << format("[%6tx]", CurrentWord - SecContent);
+ OS << format(" %.*s\n", WordSize, CurrentWord);
CurrentWord += WordSize + 1;
}
OS.flush();
@@ -4367,9 +4361,8 @@ void LLVMStyle<ELFT>::printSectionAsStri
W.startLine() << "["
<< to_string(
format_hex_no_prefix((CurrentWord - SecContent), 6))
- << "] ";
- printAsPrintable(W.startLine(), StringRef(CurrentWord, WordSize));
- W.startLine() << '\n';
+ << "]";
+ W.startLine() << format(" %.*s\n", WordSize, CurrentWord);
CurrentWord += WordSize + 1;
}
}
More information about the llvm-commits
mailing list