<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 21, 2015 at 11:42 AM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 2015-Aug-13, at 11:12, Yaron Keren via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
> Author: yrnkrn<br>
> Date: Thu Aug 13 13:12:56 2015<br>
> New Revision: 244928<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=244928&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=244928&view=rev</a><br>
> Log:<br>
> Remove and forbid raw_svector_ostream::flush() calls.<br>
> After r244870 flush() will only compare two null pointers and return,<br>
> doing nothing but wasting run time. The call is not required any more<br>
> as the stream and its SmallString are always in sync.<br>
><br>
> Thanks to David Blaikie for reviewing.<br>
><br>
<br>
</span>I wonder about this API.  It seems like more cognitive load for people<br>
reading the code to have to know whether the stream is auto-flushed or<br>
not.  Especially if the type definition is a little higher in the<br>
function.  This also makes it harder to swap in other streams at a<br>
later time if the needs change.<br>
<br>
Alternative suggestion below (I'm not convinced either way, really).<br>
<div><div class="h5"><br>
><br>
> Modified:<br>
>    llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileUtils.h<br>
>    llvm/trunk/include/llvm/Support/raw_ostream.h<br>
>    llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp<br>
>    llvm/trunk/lib/MC/MCAsmStreamer.cpp<br>
>    llvm/trunk/lib/MC/MCAssembler.cpp<br>
>    llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp<br>
>    llvm/trunk/lib/MC/MCELFStreamer.cpp<br>
>    llvm/trunk/lib/MC/MCMachOStreamer.cpp<br>
>    llvm/trunk/lib/MC/MCObjectStreamer.cpp<br>
>    llvm/trunk/lib/MC/WinCOFFStreamer.cpp<br>
>    llvm/trunk/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp<br>
>    llvm/trunk/lib/Target/TargetMachineC.cpp<br>
>    llvm/trunk/lib/Target/X86/X86MCInstLower.cpp<br>
>    llvm/trunk/tools/llvm-objdump/MachODump.cpp<br>
>    llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp<br>
>    llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp<br>
><br>
> Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileUtils.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileUtils.h?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileUtils.h?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileUtils.h (original)<br>
> +++ llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileUtils.h Thu Aug 13 13:12:56 2015<br>
> @@ -40,7 +40,6 @@ public:<br>
>     if (TM.addPassesToEmitMC(PM, Ctx, ObjStream))<br>
>       llvm_unreachable("Target does not support MC emission.");<br>
>     PM.run(M);<br>
> -    ObjStream.flush();<br>
>     std::unique_ptr<MemoryBuffer> ObjBuffer(<br>
>         new ObjectMemoryBuffer(std::move(ObjBufferSV)));<br>
>     ErrorOr<std::unique_ptr<object::ObjectFile>> Obj =<br>
><br>
> Modified: llvm/trunk/include/llvm/Support/raw_ostream.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/raw_ostream.h?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/Support/raw_ostream.h (original)<br>
> +++ llvm/trunk/include/llvm/Support/raw_ostream.h Thu Aug 13 13:12:56 2015<br>
> @@ -509,6 +509,8 @@ public:<br>
>   }<br>
>   ~raw_svector_ostream() override {}<br>
><br>
> +  void flush() = delete;<br>
<br>
</div></div>What about just making this:<br>
<br>
    /// No-op, but included for consistency of streaming APIs.<br>
    void flush() const {}<br>
<br>
(and then reverting the rest of the commit...)<br></blockquote><div><br>Seems like code will bitrot pretty quickly to not contain flush calls because it works OK without them - I'm not sure we'd really get the ability to safely swap to other streams in the future by having this API...<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
> +<br>
>   /// Return a StringRef for the vector contents.<br>
>   StringRef str() { return StringRef(OS.data(), OS.size()); }<br>
> };<br>
><br>
> Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp (original)<br>
> +++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -159,7 +159,6 @@ std::unique_ptr<MemoryBuffer> MCJIT::emi<br>
>   // Initialize passes.<br>
>   PM.run(*M);<br>
>   // Flush the output buffer to get the generated code into memory<br>
> -  ObjStream.flush();<br>
><br>
>   std::unique_ptr<MemoryBuffer> CompiledObjBuffer(<br>
>                                 new ObjectMemoryBuffer(std::move(ObjBufferSV)));<br>
><br>
> Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)<br>
> +++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -253,9 +253,6 @@ public:<br>
> void MCAsmStreamer::AddComment(const Twine &T) {<br>
>   if (!IsVerboseAsm) return;<br>
><br>
> -  // Make sure that CommentStream is flushed.<br>
> -  CommentStream.flush();<br>
> -<br>
>   T.toVector(CommentToEmit);<br>
>   // Each comment goes on its own line.<br>
>   CommentToEmit.push_back('\n');<br>
> @@ -267,7 +264,6 @@ void MCAsmStreamer::EmitCommentsAndEOL()<br>
>     return;<br>
>   }<br>
><br>
> -  CommentStream.flush();<br>
>   StringRef Comments = CommentToEmit;<br>
><br>
>   assert(Comments.back() == '\n' &&<br>
> @@ -1223,7 +1219,6 @@ void MCAsmStreamer::AddEncodingComment(c<br>
>   SmallVector<MCFixup, 4> Fixups;<br>
>   raw_svector_ostream VecOS(Code);<br>
>   Emitter->encodeInstruction(Inst, VecOS, Fixups, STI);<br>
> -  VecOS.flush();<br>
><br>
>   // If we are showing fixups, create symbolic markers in the encoded<br>
>   // representation. We do this by making a per-bit map to the fixup item index,<br>
><br>
> Modified: llvm/trunk/lib/MC/MCAssembler.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/MC/MCAssembler.cpp (original)<br>
> +++ llvm/trunk/lib/MC/MCAssembler.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -986,7 +986,6 @@ bool MCAssembler::relaxInstruction(MCAsm<br>
>   SmallString<256> Code;<br>
>   raw_svector_ostream VecOS(Code);<br>
>   getEmitter().encodeInstruction(Relaxed, VecOS, Fixups, F.getSubtargetInfo());<br>
> -  VecOS.flush();<br>
><br>
>   // Update the fragment.<br>
>   F.setInst(Relaxed);<br>
> @@ -1009,7 +1008,6 @@ bool MCAssembler::relaxLEB(MCAsmLayout &<br>
>     encodeSLEB128(Value, OSE);<br>
>   else<br>
>     encodeULEB128(Value, OSE);<br>
> -  OSE.flush();<br>
>   return OldSize != LF.getContents().size();<br>
> }<br>
><br>
> @@ -1028,7 +1026,6 @@ bool MCAssembler::relaxDwarfLineAddr(MCA<br>
>   raw_svector_ostream OSE(Data);<br>
>   MCDwarfLineAddr::Encode(Context, getDWARFLinetableParams(), LineDelta,<br>
>                           AddrDelta, OSE);<br>
> -  OSE.flush();<br>
>   return OldSize != Data.size();<br>
> }<br>
><br>
> @@ -1044,7 +1041,6 @@ bool MCAssembler::relaxDwarfCallFrameFra<br>
>   Data.clear();<br>
>   raw_svector_ostream OSE(Data);<br>
>   MCDwarfFrameEmitter::EncodeAdvanceLoc(Context, AddrDelta, OSE);<br>
> -  OSE.flush();<br>
>   return OldSize != Data.size();<br>
> }<br>
><br>
><br>
> Modified: llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp (original)<br>
> +++ llvm/trunk/lib/MC/MCDisassembler/Disassembler.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -125,7 +125,6 @@ void LLVMDisasmDispose(LLVMDisasmContext<br>
> static void emitComments(LLVMDisasmContext *DC,<br>
>                          formatted_raw_ostream &FormattedOS) {<br>
>   // Flush the stream before taking its content.<br>
> -  DC->CommentStream.flush();<br>
>   StringRef Comments = DC->CommentsToEmit.str();<br>
>   // Get the default information for printing a comment.<br>
>   const MCAsmInfo *MAI = DC->getAsmInfo();<br>
> @@ -260,7 +259,6 @@ size_t LLVMDisasmInstruction(LLVMDisasmC<br>
>     return 0;<br>
><br>
>   case MCDisassembler::Success: {<br>
> -    Annotations.flush();<br>
>     StringRef AnnotationsStr = Annotations.str();<br>
><br>
>     SmallVector<char, 64> InsnStr;<br>
> @@ -272,7 +270,6 @@ size_t LLVMDisasmInstruction(LLVMDisasmC<br>
>       emitLatency(DC, Inst);<br>
><br>
>     emitComments(DC, FormattedOS);<br>
> -    OS.flush();<br>
><br>
>     assert(OutStringSize != 0 && "Output buffer cannot be zero size");<br>
>     size_t OutputSize = std::min(OutStringSize-1, InsnStr.size());<br>
><br>
> Modified: llvm/trunk/lib/MC/MCELFStreamer.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/MC/MCELFStreamer.cpp (original)<br>
> +++ llvm/trunk/lib/MC/MCELFStreamer.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -68,7 +68,6 @@ void MCELFStreamer::mergeFragment(MCData<br>
>       EF->setBundlePadding(static_cast<uint8_t>(RequiredBundlePadding));<br>
><br>
>       Assembler.writeFragmentPadding(*EF, FSize, OW);<br>
> -      VecOS.flush();<br>
>       delete OW;<br>
><br>
>       DF->getContents().append(Code.begin(), Code.end());<br>
> @@ -480,7 +479,6 @@ void MCELFStreamer::EmitInstToData(const<br>
>   SmallString<256> Code;<br>
>   raw_svector_ostream VecOS(Code);<br>
>   Assembler.getEmitter().encodeInstruction(Inst, VecOS, Fixups, STI);<br>
> -  VecOS.flush();<br>
><br>
>   for (unsigned i = 0, e = Fixups.size(); i != e; ++i)<br>
>     fixSymbolsInTLSFixups(Fixups[i].getValue());<br>
><br>
> Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)<br>
> +++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -443,7 +443,6 @@ void MCMachOStreamer::EmitInstToData(con<br>
>   SmallString<256> Code;<br>
>   raw_svector_ostream VecOS(Code);<br>
>   getAssembler().getEmitter().encodeInstruction(Inst, VecOS, Fixups, STI);<br>
> -  VecOS.flush();<br>
><br>
>   // Add the fixups and data.<br>
>   for (unsigned i = 0, e = Fixups.size(); i != e; ++i) {<br>
><br>
> Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectStreamer.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectStreamer.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/MC/MCObjectStreamer.cpp (original)<br>
> +++ llvm/trunk/lib/MC/MCObjectStreamer.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -276,7 +276,6 @@ void MCObjectStreamer::EmitInstToFragmen<br>
>   raw_svector_ostream VecOS(Code);<br>
>   getAssembler().getEmitter().encodeInstruction(Inst, VecOS, IF->getFixups(),<br>
>                                                 STI);<br>
> -  VecOS.flush();<br>
>   IF->getContents().append(Code.begin(), Code.end());<br>
> }<br>
><br>
><br>
> Modified: llvm/trunk/lib/MC/WinCOFFStreamer.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFStreamer.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFStreamer.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/MC/WinCOFFStreamer.cpp (original)<br>
> +++ llvm/trunk/lib/MC/WinCOFFStreamer.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -49,7 +49,6 @@ void MCWinCOFFStreamer::EmitInstToData(c<br>
>   SmallString<256> Code;<br>
>   raw_svector_ostream VecOS(Code);<br>
>   getAssembler().getEmitter().encodeInstruction(Inst, VecOS, Fixups, STI);<br>
> -  VecOS.flush();<br>
><br>
>   // Add the fixups and data.<br>
>   for (unsigned i = 0, e = Fixups.size(); i != e; ++i) {<br>
> @@ -228,7 +227,6 @@ void MCWinCOFFStreamer::EmitCommonSymbol<br>
><br>
>     OS << " -aligncomm:\"" << Symbol->getName() << "\","<br>
>        << Log2_32_Ceil(ByteAlignment);<br>
> -    OS.flush();<br>
><br>
>     PushSection();<br>
>     SwitchSection(MFI->getDrectveSection());<br>
><br>
> Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp (original)<br>
> +++ llvm/trunk/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -136,8 +136,6 @@ void AMDGPUAsmPrinter::EmitInstruction(c<br>
>       MCCodeEmitter &InstEmitter = ObjStreamer.getAssembler().getEmitter();<br>
>       InstEmitter.encodeInstruction(TmpInst, CodeStream, Fixups,<br>
>                                     MF->getSubtarget<MCSubtargetInfo>());<br>
> -      CodeStream.flush();<br>
> -<br>
>       HexLines.resize(HexLines.size() + 1);<br>
>       std::string &HexLine = HexLines.back();<br>
>       raw_string_ostream HexStream(HexLine);<br>
><br>
> Modified: llvm/trunk/lib/Target/TargetMachineC.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachineC.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachineC.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Target/TargetMachineC.cpp (original)<br>
> +++ llvm/trunk/lib/Target/TargetMachineC.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -243,7 +243,6 @@ LLVMBool LLVMTargetMachineEmitToMemoryBu<br>
>   SmallString<0> CodeString;<br>
>   raw_svector_ostream OStream(CodeString);<br>
>   bool Result = LLVMTargetMachineEmit(T, M, OStream, codegen, ErrorMessage);<br>
> -  OStream.flush();<br>
><br>
>   StringRef Data = OStream.str();<br>
>   *OutMemBuf =<br>
><br>
> Modified: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCInstLower.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCInstLower.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Target/X86/X86MCInstLower.cpp (original)<br>
> +++ llvm/trunk/lib/Target/X86/X86MCInstLower.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -92,7 +92,6 @@ namespace llvm {<br>
>       SmallVector<MCFixup, 4> Fixups;<br>
>       raw_svector_ostream VecOS(Code);<br>
>       CodeEmitter->encodeInstruction(Inst, VecOS, Fixups, STI);<br>
> -      VecOS.flush();<br>
>       CurrentShadowSize += Code.size();<br>
>       if (CurrentShadowSize >= RequiredShadowSize)<br>
>         InShadow = false; // The shadow is big enough. Stop counting.<br>
><br>
> Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)<br>
> +++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -5867,7 +5867,6 @@ static void emitComments(raw_svector_ost<br>
>                          formatted_raw_ostream &FormattedOS,<br>
>                          const MCAsmInfo &MAI) {<br>
>   // Flush the stream before taking its content.<br>
> -  CommentStream.flush();<br>
>   StringRef Comments = CommentsToEmit.str();<br>
>   // Get the default information for printing a comment.<br>
>   const char *CommentBegin = MAI.getCommentString();<br>
> @@ -6248,7 +6247,6 @@ static void DisassembleMachO(StringRef F<br>
>             dumpBytes(ArrayRef<uint8_t>(Bytes.data() + Index, Size), outs());<br>
>           }<br>
>           formatted_raw_ostream FormattedOS(outs());<br>
> -          Annotations.flush();<br>
>           StringRef AnnotationsStr = Annotations.str();<br>
>           if (isThumb)<br>
>             ThumbIP->printInst(&Inst, FormattedOS, AnnotationsStr, *ThumbSTI);<br>
><br>
> Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)<br>
> +++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -727,7 +727,6 @@ public:<br>
>         ++I;<br>
>       }<br>
>     }<br>
> -    OS.flush();<br>
><br>
>     // Emit the string.<br>
>     O.indent(6) << "AsmString = \"" << OutString << "\";\n";<br>
><br>
> Modified: llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp?rev=244928&r1=244927&r2=244928&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp?rev=244928&r1=244927&r2=244928&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp (original)<br>
> +++ llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp Thu Aug 13 13:12:56 2015<br>
> @@ -1120,7 +1120,6 @@ unsigned FilterChooser::getDecoderIndex(<br>
>   raw_svector_ostream S(Decoder);<br>
>   unsigned I = 4;<br>
>   emitDecoder(S, I, Opc, HasCompleteDecoder);<br>
> -  S.flush();<br>
><br>
>   // Using the full decoder string as the key value here is a bit<br>
>   // heavyweight, but is effective. If the string comparisons become a<br>
> @@ -1231,7 +1230,6 @@ void FilterChooser::emitPredicateTableEn<br>
>   SmallString<16> PBytes;<br>
>   raw_svector_ostream S(PBytes);<br>
>   encodeULEB128(PIdx, S);<br>
> -  S.flush();<br>
><br>
>   TableInfo.Table.push_back(MCD::OPC_CheckPredicate);<br>
>   // Predicate index<br>
> @@ -1297,7 +1295,6 @@ void FilterChooser::emitSoftFailTableEnt<br>
>   if (NeedNegativeMask) {<br>
>     MaskBytes.clear();<br>
>     encodeULEB128(NegativeMask.getZExtValue(), S);<br>
> -    S.flush();<br>
>     for (unsigned i = 0, e = MaskBytes.size(); i != e; ++i)<br>
>       TableInfo.Table.push_back(MaskBytes[i]);<br>
>   } else<br>
> @@ -1367,7 +1364,6 @@ void FilterChooser::emitSingletonTableEn<br>
>   SmallString<16> Bytes;<br>
>   raw_svector_ostream S(Bytes);<br>
>   encodeULEB128(DIdx, S);<br>
> -  S.flush();<br>
><br>
>   // Decoder index<br>
>   for (unsigned i = 0, e = Bytes.size(); i != e; ++i)<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br>
</div></div></blockquote></div><br></div></div>