forked from OSchip/llvm-project
Converting object's error_category to a ManagedStatic to avoid static constructors and destructors.
llvm-svn: 218160
This commit is contained in:
parent
c4fb8ca7aa
commit
684981e454
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include "llvm/Object/Error.h"
|
#include "llvm/Object/Error.h"
|
||||||
#include "llvm/Support/ErrorHandling.h"
|
#include "llvm/Support/ErrorHandling.h"
|
||||||
|
#include "llvm/Support/ManagedStatic.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace object;
|
using namespace object;
|
||||||
|
@ -48,7 +49,8 @@ std::string _object_error_category::message(int EV) const {
|
||||||
"defined.");
|
"defined.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ManagedStatic<_object_error_category> error_category;
|
||||||
|
|
||||||
const std::error_category &object::object_category() {
|
const std::error_category &object::object_category() {
|
||||||
static _object_error_category o;
|
return *error_category;
|
||||||
return o;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue