[llvm-commits] [llvm] r117442 - in /llvm/trunk/lib/System: Makefile Win32/Signals.inc

Mikhail Glushenkov foldr at codedgers.com
Wed Oct 27 02:09:05 PDT 2010


Author: foldr
Date: Wed Oct 27 04:09:04 2010
New Revision: 117442

URL: http://llvm.org/viewvc/llvm-project?rev=117442&view=rev
Log:
Remove try/catch(...) from Win32/Signals.inc.

catch(...) is used in Win32/Signals.inc for catching Win32 structured
exceptions, but according to [1], this is wrong.

We can't simply change try/catch to __try/__finally, since this syntax is not
supported by MinGW. We can use __try/__finally on MSVC and __try1/__except1
macros on MinGW [2], but I think that that solution obfuscates the code too
much.

The use of try/catch(...) in Signals.inc makes it impossible to link
MinGW-compiled libSystem with llvm-gcc compiled executables. I propose that we
just remove try/catch(...) from Signals.inc, since the meaning of the code won't
change.

[1] http://members.cox.net/doug_web/eh.htm
[2] http://article.gmane.org/gmane.comp.compilers.llvm.cvs/81315

Modified:
    llvm/trunk/lib/System/Makefile
    llvm/trunk/lib/System/Win32/Signals.inc

Modified: llvm/trunk/lib/System/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Makefile?rev=117442&r1=117441&r2=117442&view=diff
==============================================================================
--- llvm/trunk/lib/System/Makefile (original)
+++ llvm/trunk/lib/System/Makefile Wed Oct 27 04:09:04 2010
@@ -11,11 +11,6 @@
 LIBRARYNAME = LLVMSystem
 BUILD_ARCHIVE = 1
 REQUIRES_RTTI = 1
-include $(LEVEL)/Makefile.config
-
-ifeq ($(HOST_OS),MingW)
-  REQUIRES_EH := 1
-endif
 
 EXTRA_DIST = Unix Win32 README.txt
 

Modified: llvm/trunk/lib/System/Win32/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Signals.inc?rev=117442&r1=117441&r2=117442&view=diff
==============================================================================
--- llvm/trunk/lib/System/Win32/Signals.inc (original)
+++ llvm/trunk/lib/System/Win32/Signals.inc Wed Oct 27 04:09:04 2010
@@ -208,8 +208,7 @@
 }
 
 static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) {
-  try {
-    Cleanup();
+  Cleanup();
 
 #ifdef _WIN64
   // TODO: provide a x64 friendly version of the following
@@ -291,10 +290,6 @@
 
 #endif
 
-  } catch (...) {
-      assert(0 && "Crashed in LLVMUnhandledExceptionFilter");
-  }
-
   if (ExitOnUnhandledExceptions)
     _exit(-3);
 





More information about the llvm-commits mailing list