aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
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
commitbdbf5fd1c9cfa30a348596b127394fa1f4caf033 (patch)
tree18814309e7c38165662d1f282db963d7f2920987 /include/llvm
parent6bfc69c83123fd6e0972d1d8de70a1a25895da50 (diff)
downloadexternal_llvm-bdbf5fd1c9cfa30a348596b127394fa1f4caf033.zip
external_llvm-bdbf5fd1c9cfa30a348596b127394fa1f4caf033.tar.gz
external_llvm-bdbf5fd1c9cfa30a348596b127394fa1f4caf033.tar.bz2
add a helper to call llvm_shutdown()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32249 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Support/ManagedStatic.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Support/ManagedStatic.h b/include/llvm/Support/ManagedStatic.h
index 7753105..e1585ba 100644
--- a/include/llvm/Support/ManagedStatic.h
+++ b/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