diff options
author | John McCall <rjmccall@apple.com> | 2011-02-16 08:39:19 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-16 08:39:19 +0000 |
commit | b5011ab8f922948b496af4a5ebb4c7c5f89fe221 (patch) | |
tree | 4ccb1f3c6c53391bbcddde0f5c065a266d66b2d2 /clang/lib/CodeGen/CGException.cpp | |
parent | 1bf5846abf2ce98c4c9c420d1757b01a1663d8cc (diff) | |
download | bcm5719-llvm-b5011ab8f922948b496af4a5ebb4c7c5f89fe221.tar.gz bcm5719-llvm-b5011ab8f922948b496af4a5ebb4c7c5f89fe221.zip |
Remove this FIXME; clear up an unused variable; style.
llvm-svn: 125662
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index cde27288c3f..7f3bbb78986 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/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; } |