lib/Support/raw_ostream.cpp: On mingw, report_fatal_error() should not be called at dtor context.

report_fatal_error() invokes exit(). We know report_fatal_error() might not write messages to stderr when any errors were detected on FD == 2.

llvm-svn: 127726
This commit is contained in:
NAKAMURA Takumi 2011-03-16 02:53:39 +00:00
parent e99e5dcbd3
commit 76e68ea916
1 changed files with 8 additions and 0 deletions

View File

@ -466,6 +466,14 @@ raw_fd_ostream::~raw_fd_ostream() {
}
}
#ifdef __MINGW32__
// On mingw, global dtors should not call exit().
// report_fatal_error() invokes exit(). We know report_fatal_error()
// might not write messages to stderr when any errors were detected
// on FD == 2.
if (FD == 2) return;
#endif
// If there are any pending errors, report them now. Clients wishing
// to avoid report_fatal_error calls should check for errors with
// has_error() and clear the error flag with clear_error() before