mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01: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 ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(),
|
||||||
void (*Deleter)(void*)) const {
|
void (*Deleter)(void*)) const {
|
||||||
|
assert(Creator);
|
||||||
if (llvm_is_multithreaded()) {
|
if (llvm_is_multithreaded()) {
|
||||||
llvm_acquire_global_lock();
|
llvm_acquire_global_lock();
|
||||||
|
|
||||||
if (!Ptr) {
|
if (!Ptr) {
|
||||||
void* tmp = Creator ? Creator() : nullptr;
|
void* tmp = Creator();
|
||||||
|
|
||||||
TsanHappensBefore(this);
|
TsanHappensBefore(this);
|
||||||
sys::MemoryFence();
|
sys::MemoryFence();
|
||||||
@ -47,7 +48,7 @@ void ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(),
|
|||||||
} else {
|
} else {
|
||||||
assert(!Ptr && !DeleterFn && !Next &&
|
assert(!Ptr && !DeleterFn && !Next &&
|
||||||
"Partially initialized ManagedStatic!?");
|
"Partially initialized ManagedStatic!?");
|
||||||
Ptr = Creator ? Creator() : nullptr;
|
Ptr = Creator();
|
||||||
DeleterFn = Deleter;
|
DeleterFn = Deleter;
|
||||||
|
|
||||||
// Add to list of managed statics.
|
// Add to list of managed statics.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user