Converting InstrProf's error_category to a ManagedStatic to avoid static constructors and destructors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218168 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Bieneman 2014-09-19 23:19:24 +00:00
parent 3f71e22d8f
commit 784954db31

View File

@ -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;
}