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

Chris Lattner clattner at apple.com
Mon Nov 3 01:40:58 PST 2008


On Nov 2, 2008, at 1:07 AM, Daniel Dunbar wrote:

> I agree with Dan, this is unfortunate.
>
> Is an extra branch in the write routine really a performance issue  
> here?

The performance metric in this case is "time clang -E INPUTS/Cocoa.h - 
o /dev/null" with a release-asserts build.  If that doesn't regress,  
I'm happy. :)

However, performance of output to stderr is not very important (to me  
at least).  Maybe we could do a little hack where the size of the  
buffer is 0 or 1 bytes, causing every write to go into the overflow  
case.  Handling the flushing in the overflow case would be perfectly  
acceptable to me.  Clang uses a very large output buffer for -E, so it  
wouldn't affect it significantly.

-Chris



More information about the llvm-commits mailing list