[llvm-commits] [llvm] r127726 - /llvm/trunk/lib/Support/raw_ostream.cpp

NAKAMURA Takumi geek4civic at gmail.com
Tue Mar 15 19:53:39 PDT 2011


Author: chapuni
Date: Tue Mar 15 21:53:39 2011
New Revision: 127726

URL: http://llvm.org/viewvc/llvm-project?rev=127726&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Support/raw_ostream.cpp

Modified: llvm/trunk/lib/Support/raw_ostream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=127726&r1=127725&r2=127726&view=diff
==============================================================================
--- llvm/trunk/lib/Support/raw_ostream.cpp (original)
+++ llvm/trunk/lib/Support/raw_ostream.cpp Tue Mar 15 21:53:39 2011
@@ -466,6 +466,14 @@
         }
   }
 
+#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





More information about the llvm-commits mailing list