Add an assertion check to raw_ostream's destructor to verify

that the subclass hasn't left any pending data in the buffer.

llvm-svn: 77245
This commit is contained in:
Dan Gohman 2009-07-27 20:49:44 +00:00
parent e39f03351d
commit 1b763293a6
1 changed files with 5 additions and 0 deletions

View File

@ -45,6 +45,11 @@
using namespace llvm;
raw_ostream::~raw_ostream() {
// raw_ostream's subclasses should take care to flush the buffer
// in their destructors.
assert(OutBufCur == OutBufStart &&
"raw_ostream destructor called with non-empty buffer!");
delete [] OutBufStart;
// If there are any pending errors, report them now. Clients wishing