[llvm] r206492 - ManagedStatic is never built with a null constructor, remove support for it.
David Blaikie
dblaikie at gmail.com
Thu Apr 17 13:30:36 PDT 2014
Author: dblaikie
Date: Thu Apr 17 15:30:35 2014
New Revision: 206492
URL: http://llvm.org/viewvc/llvm-project?rev=206492&view=rev
Log:
ManagedStatic is never built with a null constructor, remove support for it.
Modified:
llvm/trunk/lib/Support/ManagedStatic.cpp
Modified: llvm/trunk/lib/Support/ManagedStatic.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ManagedStatic.cpp?rev=206492&r1=206491&r2=206492&view=diff
==============================================================================
--- llvm/trunk/lib/Support/ManagedStatic.cpp (original)
+++ llvm/trunk/lib/Support/ManagedStatic.cpp Thu Apr 17 15:30:35 2014
@@ -21,11 +21,12 @@ static const ManagedStaticBase *StaticLi
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::RegisterManagedS
} else {
assert(!Ptr && !DeleterFn && !Next &&
"Partially initialized ManagedStatic!?");
- Ptr = Creator ? Creator() : nullptr;
+ Ptr = Creator();
DeleterFn = Deleter;
// Add to list of managed statics.
More information about the llvm-commits
mailing list