Skip to content

Commit

Permalink
Revert "[llvm-readobj] Fix printing format"
Browse files Browse the repository at this point in the history
There is a problem with the formatting on windows build.
I need to investigate on this.

llvm-svn: 336061
  • Loading branch information
paulsemel committed Jul 1, 2018
1 parent 84f77ec commit 8dabda7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
8 changes: 0 additions & 8 deletions llvm/test/tools/llvm-readobj/print-section.test

This file was deleted.

15 changes: 4 additions & 11 deletions llvm/tools/llvm-readobj/ELFDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3275,11 +3275,6 @@ void GNUStyle<ELFT>::printProgramHeaders(const ELFO *Obj) {
}
}

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) {
Expand All @@ -3303,9 +3298,8 @@ void GNUStyle<ELFT>::printSectionAsString(const ELFO *Obj,
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();
Expand Down Expand Up @@ -4367,9 +4361,8 @@ void LLVMStyle<ELFT>::printSectionAsString(const ELFO *Obj,
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;
}
}
Expand Down

0 comments on commit 8dabda7

Please sign in to comment.