diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-27 21:46:02 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-27 21:46:02 +0000 |
commit | 7f4a9dd8d3ea5c391465f06d0bdb46ce15103bb3 (patch) | |
tree | a042a05af6b30c13c490808b4b9ff08dbc8f3191 /lib/Support/raw_ostream.cpp | |
parent | 1eb0ad05844cdda1da0acfc72cb583c8aa9c8dbf (diff) | |
download | external_llvm-7f4a9dd8d3ea5c391465f06d0bdb46ce15103bb3.zip external_llvm-7f4a9dd8d3ea5c391465f06d0bdb46ce15103bb3.tar.gz external_llvm-7f4a9dd8d3ea5c391465f06d0bdb46ce15103bb3.tar.bz2 |
Make raw_null_ostream flush its buffer in its destructor, so that
it conforms to the assertion added in r77245. This fixes a failure
in qa_override.c in clang's testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/raw_ostream.cpp')
-rw-r--r-- | lib/Support/raw_ostream.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp index 7e34e06..992c11a 100644 --- a/lib/Support/raw_ostream.cpp +++ b/lib/Support/raw_ostream.cpp @@ -438,6 +438,15 @@ uint64_t raw_svector_ostream::tell() { // raw_null_ostream //===----------------------------------------------------------------------===// +raw_null_ostream::~raw_null_ostream() { +#ifndef NDEBUG + // ~raw_ostream asserts that the buffer is empty. This isn't necessary + // with raw_null_ostream, but it's better to have raw_null_ostream follow + // the rules than to change the rules just for raw_null_ostream. + flush(); +#endif +} + void raw_null_ostream::write_impl(const char *Ptr, size_t Size) { } |