aboutsummaryrefslogtreecommitdiffstats
path: root/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
commite77e434bc96f2935dcf337909c4009324fe24eaf (patch)
treed96bf6900b376b6efdb9138127a1a32422cf856c /lib/Support
parent7af924839140d185e4da9fa5f86a01163b0691c0 (diff)
downloadexternal_llvm-e77e434bc96f2935dcf337909c4009324fe24eaf.zip
external_llvm-e77e434bc96f2935dcf337909c4009324fe24eaf.tar.gz
external_llvm-e77e434bc96f2935dcf337909c4009324fe24eaf.tar.bz2
PR3478: raw_ostream should not buffer stderr
- Add unbuffered flag to raw_ostream, forwarded by raw_fd_ostream and used by raw_stderr_ostream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66545 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/raw_ostream.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index 29665dc..5a99a0c 100644
--- a/lib/Support/raw_ostream.cpp
+++ b/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() {}