From b4d7e35dde3ccbe0dc10bf13332ade9812586dd0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 20 Feb 2007 06:08:37 +0000 Subject: [PATCH] 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 --- include/llvm/Support/ManagedStatic.h | 6 ++++++ 1 file changed, 6 insertions(+) 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();