summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit76e68ea916d13dfaf5e8f4feaab1d69fa0b5cc2b (patch)
treec4f8184121b3150313a3675073a9b6968b3ab9b5 /llvm/lib/Support/raw_ostream.cpp
parente99e5dcbd30cdc3b38da46a4ec57dff8557a3fe4 (diff)
downloadbcm5719-llvm-76e68ea916d13dfaf5e8f4feaab1d69fa0b5cc2b.tar.gz
bcm5719-llvm-76e68ea916d13dfaf5e8f4feaab1d69fa0b5cc2b.zip
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
Diffstat (limited to 'llvm/lib/Support/raw_ostream.cpp')
-rw-r--r--llvm/lib/Support/raw_ostream.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index b175d203a18..a2ca101c558 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud