summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-11 20:59:53 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-11 20:59:53 +0000
commitffe4630f3d9262c82169d0b1c9451191b1757289 (patch)
tree4ace92f0f5b918e7a1e57e5fed282da2de92fe30
parent961fc05418b7b63b45f630bc2b109075addfd9b6 (diff)
downloadbcm5719-llvm-ffe4630f3d9262c82169d0b1c9451191b1757289.tar.gz
bcm5719-llvm-ffe4630f3d9262c82169d0b1c9451191b1757289.zip
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>. llvm-svn: 110851
-rw-r--r--clang/lib/CodeGen/CGException.cpp2
-rw-r--r--clang/test/CodeGenObjC/unwind-fn.m2
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 746f68daee2..dd518cf5efd 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -270,7 +270,7 @@ llvm::Constant *CodeGenFunction::getUnwindResumeOrRethrowFn() {
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");
}
diff --git a/clang/test/CodeGenObjC/unwind-fn.m b/clang/test/CodeGenObjC/unwind-fn.m
index 48217f07f97..5bfc7dce31a 100644
--- a/clang/test/CodeGenObjC/unwind-fn.m
+++ b/clang/test/CodeGenObjC/unwind-fn.m
@@ -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() {
OpenPOWER on IntegriCloud