[llvm-commits] CVS: llvm/include/llvm/Support/ManagedStatic.h

Chris Lattner sabre at nondot.org
Mon Feb 19 22:08:54 PST 2007



Changes in directory llvm/include/llvm/Support:

ManagedStatic.h updated: 1.3 -> 1.4
---
Log message:

add a way to register an arbitrary cleanup function.


---
Diffs of the changes:  (+6 -0)

 ManagedStatic.h |    6 ++++++
 1 files changed, 6 insertions(+)


Index: llvm/include/llvm/Support/ManagedStatic.h
diff -u llvm/include/llvm/Support/ManagedStatic.h:1.3 llvm/include/llvm/Support/ManagedStatic.h:1.4
--- llvm/include/llvm/Support/ManagedStatic.h:1.3	Sat Feb 10 13:54:24 2007
+++ llvm/include/llvm/Support/ManagedStatic.h	Tue Feb 20 00:08:37 2007
@@ -73,6 +73,12 @@
   }
 };
 
+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();






More information about the llvm-commits mailing list