aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-07-21 05:47:49 +0000
committerJohn McCall <rjmccall@apple.com>2010-07-21 05:47:49 +0000
commit77199713ab56f87ffad9a535ff2a0877704eed87 (patch)
treedb449c91096ce8cf08792c82048150a206a04888 /lib/CodeGen/CodeGenFunction.h
parent50da2cadcc6da86abff6772de65280ace2cabc94 (diff)
Switch finally cleanups over to being lazy cleanups. We get basically nothing
from the laziness features here except better block ordering, but it removes yet another CleanupBlock use. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r--lib/CodeGen/CodeGenFunction.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 26f6b63eeb..60fd3a34bd 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -255,6 +255,14 @@ public:
(void) Obj;
}
+ /// Push a lazily-created cleanup on the stack.
+ template <class T, class A0, class A1, class A2, class A3, class A4>
+ void pushLazyCleanup(CleanupKind Kind, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) {
+ void *Buffer = pushLazyCleanup(Kind, sizeof(T));
+ LazyCleanup *Obj = new(Buffer) T(a0, a1, a2, a3, a4);
+ (void) Obj;
+ }
+
/// Push a cleanup on the stack.
void pushCleanup(llvm::BasicBlock *NormalEntry,
llvm::BasicBlock *NormalExit,