mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
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:
parent
90dd89ed81
commit
34ac90c024
@ -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