[cfe-commits] r110851 - in /cfe/trunk: lib/CodeGen/CGException.cpp test/CodeGenObjC/unwind-fn.m
John McCall
rjmccall at apple.com
Wed Aug 11 13:59:53 PDT 2010
Author: rjmccall
Date: Wed Aug 11 15:59:53 2010
New Revision: 110851
URL: http://llvm.org/viewvc/llvm-project?rev=110851&view=rev
Log:
When re-raising an exception after a cleanup, we need to call _Unwind_Resume_or_Rethrow
instead of _Unwind_Resume. With SJLJ exceptions, this is spelled
"_Unwind_SjLj_Resume_or_Rethrow", not "_Unwind_SjLj_Resume", which has
significantly different semantics.
We should actually never be generating a call to _Unwind_SjLj_Resume directly;
even if we were generating true cleanups (which we aren't because of the
horrible hack), we should be calling __cxa_end_cleanup() on ARM. I
haven't implemented this because there's little point as long as the HH is
present.
I believe this fixes <rdar://problem/8281377>.
Modified:
cfe/trunk/lib/CodeGen/CGException.cpp
cfe/trunk/test/CodeGenObjC/unwind-fn.m
Modified: cfe/trunk/lib/CodeGen/CGException.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=110851&r1=110850&r2=110851&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGException.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGException.cpp Wed Aug 11 15:59:53 2010
@@ -270,7 +270,7 @@
false);
if (CGM.getLangOptions().SjLjExceptions)
- return CGM.CreateRuntimeFunction(FTy, "_Unwind_SjLj_Resume");
+ return CGM.CreateRuntimeFunction(FTy, "_Unwind_SjLj_Resume_or_Rethrow");
return CGM.CreateRuntimeFunction(FTy, "_Unwind_Resume_or_Rethrow");
}
Modified: cfe/trunk/test/CodeGenObjC/unwind-fn.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/unwind-fn.m?rev=110851&r1=110850&r2=110851&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/unwind-fn.m (original)
+++ cfe/trunk/test/CodeGenObjC/unwind-fn.m Wed Aug 11 15:59:53 2010
@@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fsjlj-exceptions -fobjc-nonfragile-abi -fexceptions -emit-llvm -o - %s | FileCheck --check-prefix=SJLJ_EH %s
// DEFAULT_EH: declare void @_Unwind_Resume_or_Rethrow(i8*)
-// SJLJ_EH: declare void @_Unwind_SjLj_Resume(i8*)
+// SJLJ_EH: declare void @_Unwind_SjLj_Resume_or_Rethrow(i8*)
void f1(), f2();
void f0() {
More information about the cfe-commits
mailing list