[llvm-commits] [llvm] r168393 - /llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Eli Bendersky
eliben at google.com
Tue Nov 20 14:57:02 PST 2012
Author: eliben
Date: Tue Nov 20 16:57:02 2012
New Revision: 168393
URL: http://llvm.org/viewvc/llvm-project?rev=168393&view=rev
Log:
Add the -no-show-raw-insn option to llvm-objdump, thus making it a bit more
conformant to binutils objdump.
Modified:
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=168393&r1=168392&r2=168393&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Tue Nov 20 16:57:02 2012
@@ -100,6 +100,10 @@
cl::desc("Target specific attributes"),
cl::value_desc("a1,+a2,-a3,..."));
+static cl::opt<bool>
+NoShowRawInsn("no-show-raw-insn", cl::desc("When disassembling instructions, "
+ "do not print the instruction bytes."));
+
static StringRef ToolName;
static bool error(error_code ec) {
@@ -321,8 +325,11 @@
if (DisAsm->getInstruction(Inst, Size, memoryObject, Index,
DebugOut, nulls())) {
- outs() << format("%8" PRIx64 ":\t", SectionAddr + Index);
- DumpBytes(StringRef(Bytes.data() + Index, Size));
+ outs() << format("%8" PRIx64 ":", SectionAddr + Index);
+ if (!NoShowRawInsn) {
+ outs() << "\t";
+ DumpBytes(StringRef(Bytes.data() + Index, Size));
+ }
IP->printInst(&Inst, outs(), "");
outs() << "\n";
} else {
More information about the llvm-commits
mailing list