diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
commit | 29cafa66ad3878dbb9f82615f19fa0bded2e443c (patch) | |
tree | c5e9e10bc189de0058aa763c47b9920a8351b7df /lib/CodeGen/CGObjCRuntime.cpp | |
parent | 01af97d3b23bded2b2b21af19bbc6e4cce49e5b3 (diff) |
Diffstat (limited to 'lib/CodeGen/CGObjCRuntime.cpp')
-rw-r--r-- | lib/CodeGen/CGObjCRuntime.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/CodeGen/CGObjCRuntime.cpp b/lib/CodeGen/CGObjCRuntime.cpp index 3d854d41acbe8..21150f1f848c8 100644 --- a/lib/CodeGen/CGObjCRuntime.cpp +++ b/lib/CodeGen/CGObjCRuntime.cpp @@ -165,9 +165,9 @@ namespace { void CGObjCRuntime::EmitTryCatchStmt(CodeGenFunction &CGF, const ObjCAtTryStmt &S, - llvm::Function *beginCatchFn, - llvm::Function *endCatchFn, - llvm::Function *exceptionRethrowFn) { + llvm::Constant *beginCatchFn, + llvm::Constant *endCatchFn, + llvm::Constant *exceptionRethrowFn) { // Jump destination for falling out of catch bodies. CodeGenFunction::JumpDest Cont; if (S.getNumCatchStmts()) @@ -233,6 +233,8 @@ void CGObjCRuntime::EmitTryCatchStmt(CodeGenFunction &CGF, cast<llvm::CallInst>(Exn)->setDoesNotThrow(); } + CodeGenFunction::RunCleanupsScope cleanups(CGF); + if (endCatchFn) { // Add a cleanup to leave the catch. bool EndCatchMightThrow = (Handler.Variable == 0); @@ -255,9 +257,8 @@ void CGObjCRuntime::EmitTryCatchStmt(CodeGenFunction &CGF, CGF.EmitStmt(Handler.Body); CGF.ObjCEHValueStack.pop_back(); - // Leave the earlier cleanup. - if (endCatchFn) - CGF.PopCleanupBlock(); + // Leave any cleanups associated with the catch. + cleanups.ForceCleanup(); CGF.EmitBranchThroughCleanup(Cont); } |