mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-03 00:47:07 +00:00
ManagedStatic is never built with a null constructor, remove support for it.
llvm-svn: 206492
This commit is contained in:
parent
77edcc9a3a
commit
d2e576d088
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user