Update LLVM for 3.5 rebase (r209712).
Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
diff --git a/lib/Support/ManagedStatic.cpp b/lib/Support/ManagedStatic.cpp
index 098cccb..6a1c2a5 100644
--- a/lib/Support/ManagedStatic.cpp
+++ b/lib/Support/ManagedStatic.cpp
@@ -17,15 +17,16 @@
#include <cassert>
using namespace llvm;
-static const ManagedStaticBase *StaticList = 0;
+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 == 0) {
- void* tmp = Creator ? Creator() : 0;
+ if (!Ptr) {
+ void* tmp = Creator();
TsanHappensBefore(this);
sys::MemoryFence();
@@ -45,9 +46,9 @@
llvm_release_global_lock();
} else {
- assert(Ptr == 0 && DeleterFn == 0 && Next == 0 &&
+ assert(!Ptr && !DeleterFn && !Next &&
"Partially initialized ManagedStatic!?");
- Ptr = Creator ? Creator() : 0;
+ Ptr = Creator();
DeleterFn = Deleter;
// Add to list of managed statics.
@@ -62,14 +63,14 @@
"Not destroyed in reverse order of construction?");
// Unlink from list.
StaticList = Next;
- Next = 0;
+ Next = nullptr;
// Destroy memory.
DeleterFn(Ptr);
// Cleanup.
- Ptr = 0;
- DeleterFn = 0;
+ Ptr = nullptr;
+ DeleterFn = nullptr;
}
/// llvm_shutdown - Deallocate and destroy all ManagedStatic variables.