diff options
author | Chris Bieneman <beanz@apple.com> | 2014-09-19 23:19:24 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2014-09-19 23:19:24 +0000 |
commit | 1efe80109abb44856fc563881b9de4e8fae2d779 (patch) | |
tree | 16f0f7907e40ee39ab56d1bf19ec10c85d83adc6 /llvm/lib/ProfileData | |
parent | 75b64a551d209d16303033ede6df107f7cf46e0a (diff) | |
download | bcm5719-llvm-1efe80109abb44856fc563881b9de4e8fae2d779.tar.gz bcm5719-llvm-1efe80109abb44856fc563881b9de4e8fae2d779.zip |
Converting InstrProf's error_category to a ManagedStatic to avoid static constructors and destructors.
llvm-svn: 218168
Diffstat (limited to 'llvm/lib/ProfileData')
-rw-r--r-- | llvm/lib/ProfileData/InstrProf.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index 01212227206..900dff96739 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -14,6 +14,7 @@ #include "llvm/ProfileData/InstrProf.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/ManagedStatic.h" using namespace llvm; @@ -55,7 +56,8 @@ class InstrProfErrorCategoryType : public std::error_category { }; } +static ManagedStatic<InstrProfErrorCategoryType> ErrorCategory; + const std::error_category &llvm::instrprof_category() { - static InstrProfErrorCategoryType C; - return C; + return *ErrorCategory; } |