diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-20 06:08:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-20 06:08:37 +0000 |
commit | b4d7e35dde3ccbe0dc10bf13332ade9812586dd0 (patch) | |
tree | 31d91d725cf18cc1b349a48bbb81c94172243dbb /include | |
parent | eb41bddfdf6378ce407af2c03ee21fb1227eceec (diff) | |
download | external_llvm-b4d7e35dde3ccbe0dc10bf13332ade9812586dd0.zip external_llvm-b4d7e35dde3ccbe0dc10bf13332ade9812586dd0.tar.gz external_llvm-b4d7e35dde3ccbe0dc10bf13332ade9812586dd0.tar.bz2 |
add a way to register an arbitrary cleanup function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/ManagedStatic.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Support/ManagedStatic.h b/include/llvm/Support/ManagedStatic.h index a9e7e96..e65fb1b 100644 --- a/include/llvm/Support/ManagedStatic.h +++ b/include/llvm/Support/ManagedStatic.h @@ -73,6 +73,12 @@ public: } }; +template<void (*CleanupFn)(void*)> +class ManagedCleanup : public ManagedStaticBase { +public: + void Register() { RegisterManagedStatic(0, CleanupFn); } +}; + /// llvm_shutdown - Deallocate and destroy all ManagedStatic variables. void llvm_shutdown(); |