summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-12-04 19:03:47 +0000
committerMike Stump <mrs@apple.com>2009-12-04 19:03:47 +0000
commit5c820758f59b516d0a424da5142bd1dbb85c574a (patch)
treeec624292302e146c25fe56456f168870328f1642 /clang/lib/CodeGen/CGException.cpp
parentbad80eb7927902cd0a3d0f96ad22c4b7093f472b (diff)
downloadbcm5719-llvm-5c820758f59b516d0a424da5142bd1dbb85c574a.tar.gz
bcm5719-llvm-5c820758f59b516d0a424da5142bd1dbb85c574a.zip
Fix warning and be sure to set up the rethrow pointer if we fall off
the end of all the catches. llvm-svn: 90574
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r--clang/lib/CodeGen/CGException.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 2374d91a2bf..3de300445c9 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -138,7 +138,7 @@ static void CopyObject(CodeGenFunction &CGF, const Expr *E, llvm::Value *N) {
// CodeGenFunction::CleanupScope TryScope(CGF);
{
// These actions are only on the exceptional edge.
-#if 0
+ if (0) {
// FIXME: Doesn't work well with eh31.C and PopCXXTemporary
CodeGenFunction::DelayedCleanupBlock Scope(CGF, true);
@@ -147,7 +147,7 @@ static void CopyObject(CodeGenFunction &CGF, const Expr *E, llvm::Value *N) {
= llvm::Type::getInt8PtrTy(CGF.getLLVMContext());
llvm::Value *ExceptionPtr = CGF.Builder.CreateBitCast(N, Int8PtrTy);
CGF.Builder.CreateCall(FreeExceptionFn, ExceptionPtr);
-#endif
+ }
}
llvm::Value *Src = CGF.EmitLValue(E).getAddress();
@@ -461,8 +461,10 @@ void CodeGenFunction::EmitCXXTryStmt(const CXXTryStmt &S) {
if (Next)
EmitBlock(Next);
}
- if (!HasCatchAll)
+ if (!HasCatchAll) {
+ Builder.CreateStore(Exc, RethrowPtr);
EmitBranchThroughCleanup(FinallyRethrow);
+ }
CodeGenFunction::CleanupBlockInfo Info = PopCleanupBlock();
OpenPOWER on IntegriCloud