LLVM
8.0.1
|
Helper class for managing resource cleanups. More...
#include "llvm/Support/CrashRecoveryContext.h"
Public Member Functions | |
CrashRecoveryContextCleanupRegistrar (T *x) | |
~CrashRecoveryContextCleanupRegistrar () | |
void | unregister () |
Helper class for managing resource cleanups.
T | Type of resource been reclaimed. |
Cleanup | Class that defines how the resource is reclaimed. |
Clients create objects of this type in the code executed in a crash recovery context to ensure that the resource will be reclaimed even in the case of crash. For example:
If the code of actual_work
in the example above does not crash, the destructor of CrashRecoveryContextCleanupRegistrar removes cleanup code from the current CrashRecoveryContext and the resource is reclaimed by the destructor of std::unique_ptr. If crash happens, destructors are not called and the resource is reclaimed by cleanup object registered in the recovery context by the constructor of CrashRecoveryContextCleanupRegistrar.
Definition at line 238 of file CrashRecoveryContext.h.
|
inline |
Definition at line 242 of file CrashRecoveryContext.h.
References llvm::CrashRecoveryContextCleanup::getContext(), and llvm::CrashRecoveryContext::registerCleanup().
|
inline |
Definition at line 248 of file CrashRecoveryContext.h.
|
inline |
Definition at line 250 of file CrashRecoveryContext.h.
References llvm::CrashRecoveryContextCleanup::cleanupFired, llvm::CrashRecoveryContextCleanup::getContext(), and llvm::CrashRecoveryContext::unregisterCleanup().