[llvm-commits] CVS: llvm/include/llvm/Support/ManagedStatic.h
Chris Lattner
sabre at nondot.org
Tue Dec 5 17:01:28 PST 2006
Changes in directory llvm/include/llvm/Support:
ManagedStatic.h updated: 1.1 -> 1.2
---
Log message:
add a helper to call llvm_shutdown()
---
Diffs of the changes: (+8 -0)
ManagedStatic.h | 8 ++++++++
1 files changed, 8 insertions(+)
Index: llvm/include/llvm/Support/ManagedStatic.h
diff -u llvm/include/llvm/Support/ManagedStatic.h:1.1 llvm/include/llvm/Support/ManagedStatic.h:1.2
--- llvm/include/llvm/Support/ManagedStatic.h:1.1 Wed Sep 27 19:31:55 2006
+++ llvm/include/llvm/Support/ManagedStatic.h Tue Dec 5 19:01:14 2006
@@ -74,6 +74,14 @@
/// llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
void llvm_shutdown();
+
+/// llvm_shutdown_obj - This is a simple helper class that calls
+/// llvm_shutdown() when it is destroyed.
+struct llvm_shutdown_obj {
+ llvm_shutdown_obj() {}
+ ~llvm_shutdown_obj() { llvm_shutdown(); }
+};
+
}
#endif
More information about the llvm-commits
mailing list