From 8e3f86193995c47ee0d229e4336c3382410f09f5 Mon Sep 17 00:00:00 2001 From: John McCall Date: Tue, 13 Jul 2010 22:12:14 +0000 Subject: Allow for the possibility that __cxa_end_catch might throw for a catch-all block or a catch of a record type by value or reference. Also convert this to a lazy cleanup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108287 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/CodeGen/CodeGenFunction.h') diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index ce3453ae5e..90a5421c69 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -206,6 +206,22 @@ public: // Variadic templates would make this not terrible. + /// Push a lazily-created cleanup on the stack. + template + void pushLazyCleanup(CleanupKind Kind) { + void *Buffer = pushLazyCleanup(Kind, sizeof(T)); + LazyCleanup *Obj = new(Buffer) T(); + (void) Obj; + } + + /// Push a lazily-created cleanup on the stack. + template + void pushLazyCleanup(CleanupKind Kind, A0 a0) { + void *Buffer = pushLazyCleanup(Kind, sizeof(T)); + LazyCleanup *Obj = new(Buffer) T(a0); + (void) Obj; + } + /// Push a lazily-created cleanup on the stack. template void pushLazyCleanup(CleanupKind Kind, A0 a0, A1 a1) { -- cgit v1.2.3-18-g5258