diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-03-18 03:04:18 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-03-18 03:04:18 +0000 |
commit | fca6fd4aedb32e173565af204866dee62dcfd054 (patch) | |
tree | b44cc70418cf0a068c7578a93df4ccdedf10e0c9 /llvm/include | |
parent | 7ef5cb3038fcbd4caa102d1ce9d70ae598985a7c (diff) | |
download | bcm5719-llvm-fca6fd4aedb32e173565af204866dee62dcfd054.tar.gz bcm5719-llvm-fca6fd4aedb32e173565af204866dee62dcfd054.zip |
Add new CrashRecoveryContextCleanup subclass: CrashRecoveryContextDeleteCleanup. This deletes the object, not just calls its destructor.
llvm-svn: 127855
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/Support/CrashRecoveryContext.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/CrashRecoveryContext.h b/llvm/include/llvm/Support/CrashRecoveryContext.h index 51752706d0e..f76ae3e3d49 100644 --- a/llvm/include/llvm/Support/CrashRecoveryContext.h +++ b/llvm/include/llvm/Support/CrashRecoveryContext.h @@ -116,7 +116,19 @@ public: resource->~T(); } }; - + +template <typename T> +class CrashRecoveryContextDeleteCleanup + : public CrashRecoveryContextCleanup +{ + T *resource; +public: + CrashRecoveryContextDeleteCleanup(T *resource) : resource(resource) {} + virtual void recoverResources() { + delete resource; + } +}; + template <typename T> struct CrashRecoveryContextTrait { static inline CrashRecoveryContextCleanup *createCleanup(T *resource) { |