diff options
author | Dan Gohman <gohman@apple.com> | 2010-08-23 18:43:24 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-08-23 18:43:24 +0000 |
commit | baf2883e0a294fabc059699037ad92822c46bd61 (patch) | |
tree | f1087f7dbd3ca5b3af81ba23f627c3899a1e53cd /include/llvm | |
parent | 0c4720c6bdf517d02aaf71d90c0572a5aa4813bc (diff) | |
download | external_llvm-baf2883e0a294fabc059699037ad92822c46bd61.zip external_llvm-baf2883e0a294fabc059699037ad92822c46bd61.tar.gz external_llvm-baf2883e0a294fabc059699037ad92822c46bd61.tar.bz2 |
formatted_tool_output_file::close needs to flush its buffer before
closing the underlying stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Support/FormattedStream.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/llvm/Support/FormattedStream.h b/include/llvm/Support/FormattedStream.h index 03cde41..db02580 100644 --- a/include/llvm/Support/FormattedStream.h +++ b/include/llvm/Support/FormattedStream.h @@ -164,7 +164,12 @@ namespace llvm void keep() { return get_tool_output_file().keep(); } bool has_error() const { return get_tool_output_file().has_error(); } void clear_error() { return get_tool_output_file().clear_error(); } - void close() { return get_tool_output_file().close(); } + void close() { + // The inner stream is unbuffered; flush the outer stream's buffer. + flush(); + // The inner stream can close its file descriptor now. + return get_tool_output_file().close(); + } }; /// fouts() - This returns a reference to a formatted_raw_ostream for |