summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDisassembler
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-08-13 18:12:56 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-08-13 18:12:56 +0000
commit556b21aa10ee7ffe8724cb0c5f5d5df9bc718ddc (patch)
treec0a5083d290ea0d5138c674e1a5a8019816b76c9 /llvm/lib/MC/MCDisassembler
parent1dbb95151b0ed90ba376a1da90a1bd1eb9364e12 (diff)
downloadbcm5719-llvm-556b21aa10ee7ffe8724cb0c5f5d5df9bc718ddc.tar.gz
bcm5719-llvm-556b21aa10ee7ffe8724cb0c5f5d5df9bc718ddc.zip
Remove and forbid raw_svector_ostream::flush() calls.
After r244870 flush() will only compare two null pointers and return, doing nothing but wasting run time. The call is not required any more as the stream and its SmallString are always in sync. Thanks to David Blaikie for reviewing. llvm-svn: 244928
Diffstat (limited to 'llvm/lib/MC/MCDisassembler')
-rw-r--r--llvm/lib/MC/MCDisassembler/Disassembler.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCDisassembler/Disassembler.cpp b/llvm/lib/MC/MCDisassembler/Disassembler.cpp
index f8260af53c9..82063fb7469 100644
--- a/llvm/lib/MC/MCDisassembler/Disassembler.cpp
+++ b/llvm/lib/MC/MCDisassembler/Disassembler.cpp
@@ -125,7 +125,6 @@ void LLVMDisasmDispose(LLVMDisasmContextRef DCR){
static void emitComments(LLVMDisasmContext *DC,
formatted_raw_ostream &FormattedOS) {
// Flush the stream before taking its content.
- DC->CommentStream.flush();
StringRef Comments = DC->CommentsToEmit.str();
// Get the default information for printing a comment.
const MCAsmInfo *MAI = DC->getAsmInfo();
@@ -260,7 +259,6 @@ size_t LLVMDisasmInstruction(LLVMDisasmContextRef DCR, uint8_t *Bytes,
return 0;
case MCDisassembler::Success: {
- Annotations.flush();
StringRef AnnotationsStr = Annotations.str();
SmallVector<char, 64> InsnStr;
@@ -272,7 +270,6 @@ 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