summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-10-16 16:34:08 +0000
committerJohn McCall <rjmccall@apple.com>2010-10-16 16:34:08 +0000
commitd509182336a9b2a3d62248302107959022742c4d (patch)
tree3f89b7dd42f5c446a9605569a5a32428150957d2 /clang
parent2fcb554f5b44804ca2bc37c8918c75b1582e0549 (diff)
downloadbcm5719-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.cpp2
-rw-r--r--clang/test/CodeGenObjC/exceptions-nonfragile.m4
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!");
+}
OpenPOWER on IntegriCloud