summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCGNU.cpp
diff options
context:
space:
mode:
authorDavid Chisnall <csdavec@swan.ac.uk>2012-11-07 16:50:40 +0000
committerDavid Chisnall <csdavec@swan.ac.uk>2012-11-07 16:50:40 +0000
commit9a837be2b947946e6918bd81016e5f6d78af5f1c (patch)
tree7709badf579f373564b9c8283bbea9fad9711841 /clang/lib/CodeGen/CGObjCGNU.cpp
parent67dc5702f879a8a19e3619c2237876fd9c2adfb0 (diff)
downloadbcm5719-llvm-9a837be2b947946e6918bd81016e5f6d78af5f1c.tar.gz
bcm5719-llvm-9a837be2b947946e6918bd81016e5f6d78af5f1c.zip
Fix the Objective-C exception rethrow from cleanups (GNU runtimes). Note that
a bug in the inliner still causes the wrong thing to happen at -O2 and above (PR14116). llvm-svn: 167534
Diffstat (limited to 'clang/lib/CodeGen/CGObjCGNU.cpp')
-rw-r--r--clang/lib/CodeGen/CGObjCGNU.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index 99abf0545ba..5acc199b524 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -2547,7 +2547,7 @@ void CGObjCGNU::EmitTryStmt(CodeGenFunction &CGF,
// Unlike the Apple non-fragile runtimes, which also uses
// unwind-based zero cost exceptions, the GNU Objective C runtime's
// EH support isn't a veneer over C++ EH. Instead, exception
- // objects are created by __objc_exception_throw and destroyed by
+ // objects are created by objc_exception_throw and destroyed by
// the personality function; this avoids the need for bracketing
// catch handlers with calls to __blah_begin_catch/__blah_end_catch
// (or even _Unwind_DeleteException), but probably doesn't
@@ -2572,7 +2572,9 @@ void CGObjCGNU::EmitThrowStmt(CodeGenFunction &CGF,
ExceptionAsObject = CGF.ObjCEHValueStack.back();
}
ExceptionAsObject = CGF.Builder.CreateBitCast(ExceptionAsObject, IdTy);
- CGF.EmitCallOrInvoke(ExceptionThrowFn, ExceptionAsObject);
+ llvm::CallSite Throw =
+ CGF.EmitCallOrInvoke(ExceptionThrowFn, ExceptionAsObject);
+ Throw.setDoesNotReturn();
CGF.Builder.CreateUnreachable();
CGF.Builder.ClearInsertionPoint();
}
OpenPOWER on IntegriCloud