summaryrefslogtreecommitdiffstats
path: root/clang/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
commit906da4bb520c97e2ae3221c338cdea712113193b (patch)
tree3aaefdce2dc23d5d1fda44db8a4a3a8a86c715b2 /clang/lib/CodeGen/CodeGenFunction.h
parentf99a631e4e9bce1398e997d935c0e6024185bbca (diff)
downloadbcm5719-llvm-906da4bb520c97e2ae3221c338cdea712113193b.tar.gz
bcm5719-llvm-906da4bb520c97e2ae3221c338cdea712113193b.zip
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. llvm-svn: 108990
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 26f6b63eeb6..60fd3a34bde 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/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,
OpenPOWER on IntegriCloud