]> granicus.if.org Git - clang/commitdiff
Coding by inspection has its problems.
authorJohn McCall <rjmccall@apple.com>
Sat, 16 Oct 2010 16:34:08 +0000 (16:34 +0000)
committerJohn McCall <rjmccall@apple.com>
Sat, 16 Oct 2010 16:34:08 +0000 (16:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116672 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCMac.cpp
test/CodeGenObjC/exceptions-nonfragile.m

index acb3ecebd6e9a0ab4ba735c458783633b5122f3a..72953ce92498a614ce396ed52bca19b8da3df9ba 100644 (file)
@@ -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)
index 41cda2c0a9ce6a921f622b305f811dd8047018b1..57ed1d9da9dd2e53c0de6759cdd8cfde58e49454 100644 (file)
@@ -11,3 +11,7 @@ void protos() {
     @throw;
   }
 }
+
+void throwing() {
+  @throw(@"error!");
+}