summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-10 16:21:55 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-10 16:21:55 +0000
commit3da6a7071a3064b8378065bd2e28c995208b99d1 (patch)
tree970abd49e11d691cd3b61bbbd4d18cea8d8ca6d3 /llvm/lib/Support
parent5013d3a89343d265cc399c6cf6e3cdd316411302 (diff)
downloadbcm5719-llvm-3da6a7071a3064b8378065bd2e28c995208b99d1.tar.gz
bcm5719-llvm-3da6a7071a3064b8378065bd2e28c995208b99d1.zip
PR3478: raw_ostream should not buffer stderr
- Add unbuffered flag to raw_ostream, forwarded by raw_fd_ostream and used by raw_stderr_ostream. llvm-svn: 66545
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/raw_ostream.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 29665dc350c..5a99a0cf403 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -141,6 +141,9 @@ raw_ostream &raw_ostream::write(const char *Ptr, unsigned Size) {
break;
}
OutBufCur += Size;
+
+ if (Unbuffered)
+ flush_impl();
return *this;
}
@@ -266,7 +269,8 @@ uint64_t raw_fd_ostream::seek(uint64_t off) {
//===----------------------------------------------------------------------===//
raw_stdout_ostream::raw_stdout_ostream():raw_fd_ostream(STDOUT_FILENO, false) {}
-raw_stderr_ostream::raw_stderr_ostream():raw_fd_ostream(STDERR_FILENO, false) {}
+raw_stderr_ostream::raw_stderr_ostream():raw_fd_ostream(STDERR_FILENO, false,
+ true) {}
// An out of line virtual method to provide a home for the class vtable.
void raw_stdout_ostream::handle() {}
OpenPOWER on IntegriCloud