aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCMac.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-07-13 20:32:21 +0000
committerJohn McCall <rjmccall@apple.com>2010-07-13 20:32:21 +0000
commitda65ea86482bc116906edfb9ba1d7124f76cc867 (patch)
treefc92862d7909d8eeaa367fa4fe686a875a934bf8 /lib/CodeGen/CGObjCMac.cpp
parent77a3c9ede5cdb26b5eb3001e82bb0a36ca997e1f (diff)
Teach IR generation how to lazily emit cleanups. This has a lot of advantages,
mostly in avoiding unnecessary work at compile time but also in producing more sensible block orderings. Move the destructor cleanups for local variables over to use lazy cleanups. Eventually all cleanups will do this; for now we have some awkward code duplication. Tell IR generation just to never produce landing pads in -fno-exceptions. This is a much more comprehensive solution to a problem which previously was half-solved by checks in most cleanup-generation spots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r--lib/CodeGen/CGObjCMac.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 0a766d5c82..7293537302 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -2697,8 +2697,7 @@ void CGObjCMac::EmitTryOrSynchronizedStmt(CodeGen::CodeGenFunction &CGF,
// Push a normal cleanup to leave the try scope.
{
- CodeGenFunction::CleanupBlock
- FinallyScope(CGF, CodeGenFunction::NormalCleanup);
+ CodeGenFunction::CleanupBlock FinallyScope(CGF, NormalCleanup);
// Check whether we need to call objc_exception_try_exit.
// In optimized code, this branch will always be folded.
@@ -5693,8 +5692,7 @@ CGObjCNonFragileABIMac::EmitSynchronizedStmt(CodeGen::CodeGenFunction &CGF,
// Register an all-paths cleanup to release the lock.
{
- CodeGenFunction::CleanupBlock
- ReleaseScope(CGF, CodeGenFunction::NormalAndEHCleanup);
+ CodeGenFunction::CleanupBlock ReleaseScope(CGF, NormalAndEHCleanup);
CGF.Builder.CreateCall(ObjCTypes.getSyncExitFn(), SyncArg)
->setDoesNotThrow();
@@ -5804,8 +5802,7 @@ void CGObjCNonFragileABIMac::EmitTryStmt(CodeGen::CodeGenFunction &CGF,
// Add a cleanup to leave the catch.
{
- CodeGenFunction::CleanupBlock
- EndCatchBlock(CGF, CodeGenFunction::NormalAndEHCleanup);
+ CodeGenFunction::CleanupBlock EndCatchBlock(CGF, NormalAndEHCleanup);
// __objc_end_catch never throws.
CGF.Builder.CreateCall(ObjCTypes.getObjCEndCatchFn())