aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/raw_ostream.cpp
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2011-03-16 02:53:39 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2011-03-16 02:53:39 +0000
commit7a7215b563ad03d499742612d7d595b9299664b7 (patch)
tree6e1e2cbe933daac2d9ce5aa69445db4905e7dac6 /lib/Support/raw_ostream.cpp
parentbab2d49d4aecd83de25dfdefed0c4e4b03957de1 (diff)
downloadexternal_llvm-7a7215b563ad03d499742612d7d595b9299664b7.zip
external_llvm-7a7215b563ad03d499742612d7d595b9299664b7.tar.gz
external_llvm-7a7215b563ad03d499742612d7d595b9299664b7.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/raw_ostream.cpp')
-rw-r--r--lib/Support/raw_ostream.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
index b175d20..a2ca101 100644
--- a/lib/Support/raw_ostream.cpp
+++ b/lib/Support/raw_ostream.cpp
@@ -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