summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-12-06 01:01:14 +0000
committerChris Lattner <sabre@nondot.org>2006-12-06 01:01:14 +0000
commitb1a268f08f55ba341e63a1d741b5d1a21bd9d0f7 (patch)
tree51ada6f3ccc537249bfa5aadaa48e941d52086c0
parentbbbb1c5e78fafee0cd07fcd385c7ce89efc0ace9 (diff)
downloadbcm5719-llvm-b1a268f08f55ba341e63a1d741b5d1a21bd9d0f7.tar.gz
bcm5719-llvm-b1a268f08f55ba341e63a1d741b5d1a21bd9d0f7.zip
add a helper to call llvm_shutdown()
llvm-svn: 32249
-rw-r--r--llvm/include/llvm/Support/ManagedStatic.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/ManagedStatic.h b/llvm/include/llvm/Support/ManagedStatic.h
index 7753105f7e6..e1585bafa80 100644
--- a/llvm/include/llvm/Support/ManagedStatic.h
+++ b/llvm/include/llvm/Support/ManagedStatic.h
@@ -74,6 +74,14 @@ public:
/// 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
OpenPOWER on IntegriCloud