From: Chris Lattner Date: Tue, 20 Feb 2007 06:08:37 +0000 (+0000) Subject: add a way to register an arbitrary cleanup function. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b4d7e35dde3ccbe0dc10bf13332ade9812586dd0;p=oota-llvm.git 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 --- diff --git a/include/llvm/Support/ManagedStatic.h b/include/llvm/Support/ManagedStatic.h index a9e7e96b5d7..e65fb1b6464 100644 --- a/include/llvm/Support/ManagedStatic.h +++ b/include/llvm/Support/ManagedStatic.h @@ -73,6 +73,12 @@ public: } }; +template +class ManagedCleanup : public ManagedStaticBase { +public: + void Register() { RegisterManagedStatic(0, CleanupFn); } +}; + /// llvm_shutdown - Deallocate and destroy all ManagedStatic variables. void llvm_shutdown();