summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2014-09-19 20:29:02 +0000
committerChris Bieneman <beanz@apple.com>2014-09-19 20:29:02 +0000
commit770163e4f3abee11856d0311966e632b97e85c3f (patch)
tree9319898b9dbe967057cd7a62adabef2a2cc57346 /llvm/lib/Bitcode/Reader
parent4171da5cfead8fa06ddb5395d897e42eb1b14804 (diff)
downloadbcm5719-llvm-770163e4f3abee11856d0311966e632b97e85c3f.tar.gz
bcm5719-llvm-770163e4f3abee11856d0311966e632b97e85c3f.zip
Eliminating static destructor for the BitCodeErrorCategory by converting to a ManagedStatic.
Summary: This is part of the overall goal of removing static initializers from LLVM. Reviewers: chandlerc Reviewed By: chandlerc Subscribers: chandlerc, llvm-commits Differential Revision: http://reviews.llvm.org/D5416 llvm-svn: 218149
Diffstat (limited to 'llvm/lib/Bitcode/Reader')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 84ee0b4b3a6..80afb56e746 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -25,6 +25,8 @@
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/ManagedStatic.h"
+
using namespace llvm;
enum {
@@ -3502,9 +3504,10 @@ class BitcodeErrorCategoryType : public std::error_category {
};
}
+static ManagedStatic<BitcodeErrorCategoryType> ErrorCategory;
+
const std::error_category &llvm::BitcodeErrorCategory() {
- static BitcodeErrorCategoryType O;
- return O;
+ return *ErrorCategory;
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud