From 34bc6b6e787f27b5c9e05c82de4c1b4ac9b117bc Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 7 Apr 2014 04:17:22 +0000 Subject: [C++11] Make use of 'nullptr' in the Support library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205697 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/ManagedStatic.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/Support/ManagedStatic.cpp') diff --git a/lib/Support/ManagedStatic.cpp b/lib/Support/ManagedStatic.cpp index 098cccb68d..e358fe8c5c 100644 --- a/lib/Support/ManagedStatic.cpp +++ b/lib/Support/ManagedStatic.cpp @@ -17,15 +17,15 @@ #include using namespace llvm; -static const ManagedStaticBase *StaticList = 0; +static const ManagedStaticBase *StaticList = nullptr; void ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(), void (*Deleter)(void*)) const { if (llvm_is_multithreaded()) { llvm_acquire_global_lock(); - if (Ptr == 0) { - void* tmp = Creator ? Creator() : 0; + if (Ptr == nullptr) { + void* tmp = Creator ? Creator() : nullptr; TsanHappensBefore(this); sys::MemoryFence(); @@ -47,7 +47,7 @@ void ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(), } else { assert(Ptr == 0 && DeleterFn == 0 && Next == 0 && "Partially initialized ManagedStatic!?"); - Ptr = Creator ? Creator() : 0; + Ptr = Creator ? Creator() : nullptr; DeleterFn = Deleter; // Add to list of managed statics. @@ -62,14 +62,14 @@ void ManagedStaticBase::destroy() const { "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. -- cgit v1.2.3