diff options
-rw-r--r-- | lib/CodeGen/CGObjCGNU.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 166bb9a2c0..6d129d02a5 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/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(); } |