summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Support/CrashRecoveryContext.h14
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) {
OpenPOWER on IntegriCloud