formatted_raw_ostream both is-a raw_ostream and has-a raw_ostream. This
authorDan Gohman <gohman@apple.com>
Thu, 16 Jul 2009 01:32:46 +0000 (01:32 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 16 Jul 2009 01:32:46 +0000 (01:32 +0000)
commit0e0979ecdaabcc78752f8a18f0a092a84f07a057
tree908cc0292cf0354e1aad9206ffb3b8a4a6f423e1
parentfe2fe7094e7dff91acb52b030dec097910000a54
formatted_raw_ostream both is-a raw_ostream and has-a raw_ostream. This
means that two separate raw_ostreams are doing buffering before data is
sent to the underlying stream. Besides the inefficiency of redundant
buffering, the second level of buffering doesn't recieve flush()
requests.

Fix this by having formatted_raw_ostream set the underlying raw_ostream
to be unbuffered. This eliminates inefficiency due to redundant buffering,
and it makes the flush() disconnect harmless.

This fixes PR4559.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75883 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/FormattedStream.h