summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/Error.cpp
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2014-09-19 22:09:18 +0000
committerChris Bieneman <beanz@apple.com>2014-09-19 22:09:18 +0000
commit684981e4548733c9c28633c93a4cb418ea66e06a (patch)
tree7127f60766ab8512451c8d1dab036d7de92483f9 /llvm/lib/Object/Error.cpp
parentc4fb8ca7aa4dfbd7a78cbff92d7065dff7e583e3 (diff)
downloadbcm5719-llvm-684981e4548733c9c28633c93a4cb418ea66e06a.tar.gz
bcm5719-llvm-684981e4548733c9c28633c93a4cb418ea66e06a.zip
Converting object's error_category to a ManagedStatic to avoid static constructors and destructors.
llvm-svn: 218160
Diffstat (limited to 'llvm/lib/Object/Error.cpp')
-rw-r--r--llvm/lib/Object/Error.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Object/Error.cpp b/llvm/lib/Object/Error.cpp
index 44667c247b1..d2daab72d58 100644
--- a/llvm/lib/Object/Error.cpp
+++ b/llvm/lib/Object/Error.cpp
@@ -13,6 +13,7 @@
#include "llvm/Object/Error.h"
#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/ManagedStatic.h"
using namespace llvm;
using namespace object;
@@ -48,7 +49,8 @@ std::string _object_error_category::message(int EV) const {
"defined.");
}
+static ManagedStatic<_object_error_category> error_category;
+
const std::error_category &object::object_category() {
- static _object_error_category o;
- return o;
+ return *error_category;
}
OpenPOWER on IntegriCloud