diff options
author | John McCall <rjmccall@apple.com> | 2010-10-16 16:34:08 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-10-16 16:34:08 +0000 |
commit | d509182336a9b2a3d62248302107959022742c4d (patch) | |
tree | 3f89b7dd42f5c446a9605569a5a32428150957d2 /clang | |
parent | 2fcb554f5b44804ca2bc37c8918c75b1582e0549 (diff) | |
download | bcm5719-llvm-d509182336a9b2a3d62248302107959022742c4d.tar.gz bcm5719-llvm-d509182336a9b2a3d62248302107959022742c4d.zip |
Coding by inspection has its problems.
llvm-svn: 116672
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 2 | ||||
-rw-r--r-- | clang/test/CodeGenObjC/exceptions-nonfragile.m | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index acb3ecebd6e..72953ce9249 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -6167,6 +6167,8 @@ void CGObjCNonFragileABIMac::EmitThrowStmt(CodeGen::CodeGenFunction &CGF, const ObjCAtThrowStmt &S) { if (const Expr *ThrowExpr = S.getThrowExpr()) { llvm::Value *Exception = CGF.EmitScalarExpr(ThrowExpr); + Exception = CGF.Builder.CreateBitCast(Exception, ObjCTypes.ObjectPtrTy, + "tmp"); llvm::Value *Args[] = { Exception }; CGF.EmitCallOrInvoke(ObjCTypes.getExceptionThrowFn(), Args, Args+1) diff --git a/clang/test/CodeGenObjC/exceptions-nonfragile.m b/clang/test/CodeGenObjC/exceptions-nonfragile.m index 41cda2c0a9c..57ed1d9da9d 100644 --- a/clang/test/CodeGenObjC/exceptions-nonfragile.m +++ b/clang/test/CodeGenObjC/exceptions-nonfragile.m @@ -11,3 +11,7 @@ void protos() { @throw; } } + +void throwing() { + @throw(@"error!"); +} |