aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-02-16 08:39:19 +0000
committerJohn McCall <rjmccall@apple.com>2011-02-16 08:39:19 +0000
commitacff696118d98c3acd09a16b96c95807057b5c99 (patch)
tree391b534604f56263ee1df69289dcfaecbabd6ad9 /lib/CodeGen/CGException.cpp
parente996ffd240f20a1048179d7727a6ee3227261921 (diff)
Remove this FIXME; clear up an unused variable; style.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125662 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGException.cpp')
-rw-r--r--lib/CodeGen/CGException.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp
index cde27288c3..7f3bbb7898 100644
--- a/lib/CodeGen/CGException.cpp
+++ b/lib/CodeGen/CGException.cpp
@@ -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;
}