summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCGNU.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-01-10 19:02:56 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-01-10 19:02:56 +0000
commit1eab052a7fb49194eb9a8d3c545975cccd3a1e1a (patch)
treeabe14fd41ef4c34ae20a6e6834f3008e7450d2df /clang/lib/CodeGen/CGObjCGNU.cpp
parentf036f1a630943627e5bcd344ace9d7a7b617154d (diff)
downloadbcm5719-llvm-1eab052a7fb49194eb9a8d3c545975cccd3a1e1a.tar.gz
bcm5719-llvm-1eab052a7fb49194eb9a8d3c545975cccd3a1e1a.zip
objectiveC++: When throwing c++ exception of
an objectiveC object, use objc_exception_throw to raise the exception. // rdar://12605907 llvm-svn: 172091
Diffstat (limited to 'clang/lib/CodeGen/CGObjCGNU.cpp')
-rw-r--r--clang/lib/CodeGen/CGObjCGNU.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index b639056da47..d1ca3bf263b 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -502,7 +502,8 @@ public:
virtual void EmitSynchronizedStmt(CodeGenFunction &CGF,
const ObjCAtSynchronizedStmt &S);
virtual void EmitThrowStmt(CodeGenFunction &CGF,
- const ObjCAtThrowStmt &S);
+ const ObjCAtThrowStmt &S,
+ bool ClearInsertionPoint=true);
virtual llvm::Value * EmitObjCWeakRead(CodeGenFunction &CGF,
llvm::Value *AddrWeakObj);
virtual void EmitObjCWeakAssign(CodeGenFunction &CGF,
@@ -2637,7 +2638,8 @@ void CGObjCGNU::EmitTryStmt(CodeGenFunction &CGF,
}
void CGObjCGNU::EmitThrowStmt(CodeGenFunction &CGF,
- const ObjCAtThrowStmt &S) {
+ const ObjCAtThrowStmt &S,
+ bool ClearInsertionPoint) {
llvm::Value *ExceptionAsObject;
if (const Expr *ThrowExpr = S.getThrowExpr()) {
@@ -2653,7 +2655,8 @@ void CGObjCGNU::EmitThrowStmt(CodeGenFunction &CGF,
CGF.EmitCallOrInvoke(ExceptionThrowFn, ExceptionAsObject);
Throw.setDoesNotReturn();
CGF.Builder.CreateUnreachable();
- CGF.Builder.ClearInsertionPoint();
+ if (ClearInsertionPoint)
+ CGF.Builder.ClearInsertionPoint();
}
llvm::Value * CGObjCGNU::EmitObjCWeakRead(CodeGenFunction &CGF,
OpenPOWER on IntegriCloud