diff options
author | Fangrui Song <maskray@google.com> | 2020-01-11 12:36:13 -0800 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2020-01-11 13:34:52 -0800 |
commit | 6fdd6a7b3f696972edc244488f59532d05136a27 (patch) | |
tree | dc7e353f873ffc0db7bae27ad8631a93ba9ac321 /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 2cdb18afda841392002feafda21af31854c195b3 (diff) | |
download | llvm-6fdd6a7b3f696972edc244488f59532d05136a27.zip llvm-6fdd6a7b3f696972edc244488f59532d05136a27.tar.gz llvm-6fdd6a7b3f696972edc244488f59532d05136a27.tar.bz2 |
[Disassembler] Delete the VStream parameter of MCDisassembler::getInstruction()
The argument is llvm::null() everywhere except llvm::errs() in
llvm-objdump in -DLLVM_ENABLE_ASSERTIONS=On builds. It is used by no
target but X86 in -DLLVM_ENABLE_ASSERTIONS=On builds.
If we ever have the needs to add verbose log to disassemblers, we can
record log with a member function, instead of passing it around as an
argument.
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index d25ebf3..6bd37a1 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -1353,16 +1353,10 @@ static void disassembleObject(const Target *TheTarget, const ObjectFile *Obj, continue; } -#ifndef NDEBUG - raw_ostream &DebugOut = DebugFlag ? dbgs() : nulls(); -#else - raw_ostream &DebugOut = nulls(); -#endif - // Some targets (like WebAssembly) have a special prelude at the start // of each symbol. DisAsm->onSymbolStart(SymbolName, Size, Bytes.slice(Start, End - Start), - SectionAddr + Start, DebugOut, CommentStream); + SectionAddr + Start, CommentStream); Start += Size; Index = Start; @@ -1426,8 +1420,7 @@ static void disassembleObject(const Target *TheTarget, const ObjectFile *Obj, // provided MCInst Inst; bool Disassembled = DisAsm->getInstruction( - Inst, Size, Bytes.slice(Index), SectionAddr + Index, DebugOut, - CommentStream); + Inst, Size, Bytes.slice(Index), SectionAddr + Index, CommentStream); if (Size == 0) Size = 1; |