ManagedStatic is never built with a null constructor, remove support for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206492 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2014-04-17 20:30:35 +00:00
parent 90dd89ed81
commit 34ac90c024

View File

@ -21,11 +21,12 @@ static const ManagedStaticBase *StaticList = nullptr;
void ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(),
void (*Deleter)(void*)) const {
assert(Creator);
if (llvm_is_multithreaded()) {
llvm_acquire_global_lock();
if (!Ptr) {
void* tmp = Creator ? Creator() : nullptr;
void* tmp = Creator();
TsanHappensBefore(this);
sys::MemoryFence();
@ -47,7 +48,7 @@ void ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(),
} else {
assert(!Ptr && !DeleterFn && !Next &&
"Partially initialized ManagedStatic!?");
Ptr = Creator ? Creator() : nullptr;
Ptr = Creator();
DeleterFn = Deleter;
// Add to list of managed statics.