[llvm-commits] patch: flush raw_ostream after AsmPrinting function

Preston Gurd pgurd at rapidmind.com
Wed Nov 5 10:59:50 PST 2008


While you are all considering the one true way to handle this issue
(which would be above my patch-grade, I think), might you consider
applying the (attached) patch for the time being?

When printing the generated assembly code for a function to a
raw_ostream using the -print-emitted-asm option, flush the raw_ostream
output to avoid the possibility of having the last partial buffer be
separated from the rest of the generated code output by other output to
the same device, but using a different output stream.


On Sun, 2008-02-11 at 03:07 -0500, Daniel Dunbar wrote:
> I agree with Dan, this is unfortunate.
> 
> Is an extra branch in the write routine really a performance issue
> here?
> 
>  - Daniel
> 
> On Fri, Oct 31, 2008 at 4:33 PM, Chris Lattner <clattner at apple.com>
> wrote:
>         
>         On Oct 31, 2008, at 1:52 PM, Dan Gohman wrote:
>         
>         > The real bug here, in my opinion, is that the new
>         raw_ostream
>         > version of stderr is buffered.
>         
>         
>         Patches, as they say, are welcome :).  If you can figure out a
>         way to
>         not affect the perf of the buffered case, I would really
>         really like
>         this.
>         
>         -Chris
>         
>         _______________________________________________
>         llvm-commits mailing list
>         llvm-commits at cs.uiuc.edu
>         http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>         
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flush.diff
Type: text/x-patch
Size: 1488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20081105/725b69ad/attachment.bin>


More information about the llvm-commits mailing list