summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCGNU.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-08-10 21:26:17 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-08-10 21:26:17 +0000
commitdc009da2a8d34ab836927394f7d822bb1d5d8a14 (patch)
tree8df41fb497c771ab6e463f1d1ea4dcdbc43597d9 /clang/lib/CodeGen/CGObjCGNU.cpp
parentf64b4722eb9aae5d2a82edf3a09eea54ad29c624 (diff)
downloadbcm5719-llvm-dc009da2a8d34ab836927394f7d822bb1d5d8a14.tar.gz
bcm5719-llvm-dc009da2a8d34ab836927394f7d822bb1d5d8a14.zip
Don't emit an invoke whose normal destination is a landingpad. Fixes test
regression on test/CodeGenObjC/2008-10-3-EhValue.m on non-Darwin targets. llvm-svn: 161700
Diffstat (limited to 'clang/lib/CodeGen/CGObjCGNU.cpp')
-rw-r--r--clang/lib/CodeGen/CGObjCGNU.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index 166bb9a2c02..6d129d02a56 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -2513,25 +2513,8 @@ void CGObjCGNU::EmitThrowStmt(CodeGenFunction &CGF,
ExceptionAsObject = CGF.ObjCEHValueStack.back();
}
ExceptionAsObject = CGF.Builder.CreateBitCast(ExceptionAsObject, IdTy);
-
- // Note: This may have to be an invoke, if we want to support constructs like:
- // @try {
- // @throw(obj);
- // }
- // @catch(id) ...
- //
- // This is effectively turning @throw into an incredibly-expensive goto, but
- // it may happen as a result of inlining followed by missed optimizations, or
- // as a result of stupidity.
- llvm::BasicBlock *UnwindBB = CGF.getInvokeDest();
- if (!UnwindBB) {
- CGF.Builder.CreateCall(ExceptionThrowFn, ExceptionAsObject);
- CGF.Builder.CreateUnreachable();
- } else {
- CGF.Builder.CreateInvoke(ExceptionThrowFn, UnwindBB, UnwindBB,
- ExceptionAsObject);
- }
- // Clear the insertion point to indicate we are in unreachable code.
+ CGF.EmitCallOrInvoke(ExceptionThrowFn, ExceptionAsObject);
+ CGF.Builder.CreateUnreachable();
CGF.Builder.ClearInsertionPoint();
}
OpenPOWER on IntegriCloud