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

llvm-svn: 206492
This commit is contained in:
David Blaikie 2014-04-17 20:30:35 +00:00
parent 77edcc9a3a
commit d2e576d088

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.