diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2010-10-27 09:09:04 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2010-10-27 09:09:04 +0000 |
commit | 11d03f690e7fe019c33c3a066a9171c61f6d61f9 (patch) | |
tree | 35890292407708c7f2a6918488ad1e66909a7344 /lib/System | |
parent | d33b77bbb04d8f90e58cd83f695745ba21178d41 (diff) | |
download | llvm-11d03f690e7fe019c33c3a066a9171c61f6d61f9.tar.gz llvm-11d03f690e7fe019c33c3a066a9171c61f6d61f9.tar.bz2 llvm-11d03f690e7fe019c33c3a066a9171c61f6d61f9.tar.xz |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System')
-rw-r--r-- | lib/System/Makefile | 5 | ||||
-rw-r--r-- | lib/System/Win32/Signals.inc | 7 |
2 files changed, 1 insertions, 11 deletions
diff --git a/lib/System/Makefile b/lib/System/Makefile index bb013b9f1f..5d4fda923f 100644 --- a/lib/System/Makefile +++ b/lib/System/Makefile @@ -11,11 +11,6 @@ LEVEL = ../.. 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 diff --git a/lib/System/Win32/Signals.inc b/lib/System/Win32/Signals.inc index 8f880f7fdf..3f33d89a03 100644 --- a/lib/System/Win32/Signals.inc +++ b/lib/System/Win32/Signals.inc @@ -208,8 +208,7 @@ void llvm::sys::RunInterruptHandlers() { } 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 @@ static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) { #endif - } catch (...) { - assert(0 && "Crashed in LLVMUnhandledExceptionFilter"); - } - if (ExitOnUnhandledExceptions) _exit(-3); |