forked from OSchip/llvm-project
Make sure to invoke (not call) to objc_exception_throw if necessary.
llvm-svn: 65808
This commit is contained in:
parent
a646834214
commit
7a38ce4f88
|
@ -4844,8 +4844,17 @@ void CGObjCNonFragileABIMac::EmitThrowStmt(CodeGen::CodeGenFunction &CGF,
|
|||
llvm::Value *Exception = CGF.EmitScalarExpr(ThrowExpr);
|
||||
ExceptionAsObject =
|
||||
CGF.Builder.CreateBitCast(Exception, ObjCTypes.ObjectPtrTy, "tmp");
|
||||
|
||||
CGF.Builder.CreateCall(ObjCTypes.ExceptionThrowFn, ExceptionAsObject);
|
||||
|
||||
llvm::BasicBlock *InvokeDest = CGF.getInvokeDest();
|
||||
if (InvokeDest) {
|
||||
llvm::BasicBlock *Cont = CGF.createBasicBlock("invoke.cont");
|
||||
CGF.Builder.CreateInvoke(ObjCTypes.ExceptionThrowFn,
|
||||
Cont, InvokeDest,
|
||||
&ExceptionAsObject, &ExceptionAsObject + 1);
|
||||
CGF.EmitBlock(Cont);
|
||||
} else
|
||||
CGF.Builder.CreateCall(ObjCTypes.ExceptionThrowFn, ExceptionAsObject);
|
||||
|
||||
CGF.Builder.CreateUnreachable();
|
||||
} else {
|
||||
CGF.ErrorUnsupported(&S, "rethrow statement");
|
||||
|
|
Loading…
Reference in New Issue