]> granicus.if.org Git - clang/commitdiff
Remove this FIXME; clear up an unused variable; style.
authorJohn McCall <rjmccall@apple.com>
Wed, 16 Feb 2011 08:39:19 +0000 (08:39 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 16 Feb 2011 08:39:19 +0000 (08:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125662 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGException.cpp

index cde27288c3f410df28a121e4005479ca0bb7e7b1..7f3bbb78986e3fff5721f4abd1c40218175d7c85 100644 (file)
@@ -1026,19 +1026,17 @@ static void InitCatchParam(CodeGenFunction &CGF,
     return;
   }
 
-  // FIXME: this *really* needs to be done via a proper, Sema-emitted
-  // initializer expression.
-
-  CXXRecordDecl *RD = CatchType.getTypePtr()->getAsCXXRecordDecl();
-  assert(RD && "aggregate catch type was not a record!");
+  assert(isa<RecordType>(CatchType) && "unexpected catch type!");
 
   const llvm::Type *PtrTy = LLVMCatchTy->getPointerTo(0); // addrspace 0 ok
 
+  // Check for a copy expression.  If we don't have a copy expression,
+  // that means a trivial copy is okay.
   const Expr *copyExpr = CatchParam.getInit();
   if (!copyExpr) {
-    llvm::Value *AdjustedExn = CallBeginCatch(CGF, Exn, true);
-    llvm::Value *Cast = CGF.Builder.CreateBitCast(AdjustedExn, PtrTy);
-    CGF.EmitAggregateCopy(ParamAddr, Cast, CatchType);
+    llvm::Value *rawAdjustedExn = CallBeginCatch(CGF, Exn, true);
+    llvm::Value *adjustedExn = CGF.Builder.CreateBitCast(rawAdjustedExn, PtrTy);
+    CGF.EmitAggregateCopy(ParamAddr, adjustedExn, CatchType);
     return;
   }