summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDisassembler/Disassembler.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2014-01-06 22:08:08 +0000
committerKevin Enderby <enderby@apple.com>2014-01-06 22:08:08 +0000
commitf16c8c5162bae2f8f58a53871a1ee87708fa1e31 (patch)
treec861f3bb3a8503b341ee4ca3dce91db41ddb32cd /llvm/lib/MC/MCDisassembler/Disassembler.cpp
parentabdd726ce52ddbb3e820579eb636612d39f09896 (diff)
downloadbcm5719-llvm-f16c8c5162bae2f8f58a53871a1ee87708fa1e31.tar.gz
bcm5719-llvm-f16c8c5162bae2f8f58a53871a1ee87708fa1e31.zip
For the 'C' disassembler API, add a new ReferenceType for the
SymbolLookUp() call back to return a demangled C++ name to be used as a comment. For example darwin's otool(1) program the uses the llvm disassembler now can produce disassembly like: callq __ZNK4llvm6Target20createMCDisassemblerERKNS_15MCSubtargetInfoE ## llvm::Target::createMCDisassembler(llvm::MCSubtargetInfo const&) const Also fix a bug in LLVMDisasmInstruction() that was not flushing the raw_svector_ostream for the disassembled instruction string before copying it to the output buffer that was causing truncation of the output. rdar://10173828 llvm-svn: 198637
Diffstat (limited to 'llvm/lib/MC/MCDisassembler/Disassembler.cpp')
-rw-r--r--llvm/lib/MC/MCDisassembler/Disassembler.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCDisassembler/Disassembler.cpp b/llvm/lib/MC/MCDisassembler/Disassembler.cpp
index a0066c8885c..b0b8138e711 100644
--- a/llvm/lib/MC/MCDisassembler/Disassembler.cpp
+++ b/llvm/lib/MC/MCDisassembler/Disassembler.cpp
@@ -298,6 +298,7 @@ size_t LLVMDisasmInstruction(LLVMDisasmContextRef DCR, uint8_t *Bytes,
emitLatency(DC, Inst);
emitComments(DC, FormattedOS);
+ OS.flush();
assert(OutStringSize != 0 && "Output buffer cannot be zero size");
size_t OutputSize = std::min(OutStringSize-1, InsnStr.size());
OpenPOWER on IntegriCloud