diff options
author | John McCall <rjmccall@apple.com> | 2010-07-13 22:12:14 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-07-13 22:12:14 +0000 |
commit | 8e3f86193995c47ee0d229e4336c3382410f09f5 (patch) | |
tree | 0668cf7ba484f2e863aa0d937fd156672b004af5 /lib/CodeGen/CodeGenFunction.h | |
parent | ae415dc21ee6402cee1675ec8bb965a24f9e5b6b (diff) |
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
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 16 |
1 files changed, 16 insertions, 0 deletions
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 @@ -207,6 +207,22 @@ public: // Variadic templates would make this not terrible. /// Push a lazily-created cleanup on the stack. + template <class T> + 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 <class T, class A0> + 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 <class T, class A0, class A1> void pushLazyCleanup(CleanupKind Kind, A0 a0, A1 a1) { void *Buffer = pushLazyCleanup(Kind, sizeof(T)); |