diff options
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r-- | llvm/lib/Support/APFloat.cpp | 12 | ||||
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Support/Debug.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Support/FoldingSet.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Support/ManagedStatic.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Support/Mutex.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/Support/RWMutex.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/Support/Timer.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Support/raw_ostream.cpp | 6 |
9 files changed, 25 insertions, 25 deletions
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index e1fd3c602b7..f9fe09541db 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -1358,7 +1358,7 @@ APFloat::addOrSubtractSpecials(const APFloat &rhs, bool subtract) { switch (PackCategoriesIntoKey(category, rhs.category)) { default: - llvm_unreachable(0); + llvm_unreachable(nullptr); case PackCategoriesIntoKey(fcNaN, fcZero): case PackCategoriesIntoKey(fcNaN, fcNormal): @@ -1485,7 +1485,7 @@ APFloat::multiplySpecials(const APFloat &rhs) { switch (PackCategoriesIntoKey(category, rhs.category)) { default: - llvm_unreachable(0); + llvm_unreachable(nullptr); case PackCategoriesIntoKey(fcNaN, fcZero): case PackCategoriesIntoKey(fcNaN, fcNormal): @@ -1529,7 +1529,7 @@ APFloat::divideSpecials(const APFloat &rhs) { switch (PackCategoriesIntoKey(category, rhs.category)) { default: - llvm_unreachable(0); + llvm_unreachable(nullptr); case PackCategoriesIntoKey(fcZero, fcNaN): case PackCategoriesIntoKey(fcNormal, fcNaN): @@ -1570,7 +1570,7 @@ APFloat::modSpecials(const APFloat &rhs) { switch (PackCategoriesIntoKey(category, rhs.category)) { default: - llvm_unreachable(0); + llvm_unreachable(nullptr); case PackCategoriesIntoKey(fcNaN, fcZero): case PackCategoriesIntoKey(fcNaN, fcNormal): @@ -1882,7 +1882,7 @@ APFloat::compare(const APFloat &rhs) const switch (PackCategoriesIntoKey(category, rhs.category)) { default: - llvm_unreachable(0); + llvm_unreachable(nullptr); case PackCategoriesIntoKey(fcNaN, fcZero): case PackCategoriesIntoKey(fcNaN, fcNormal): @@ -3331,7 +3331,7 @@ APFloat::initFromAPInt(const fltSemantics* Sem, const APInt& api) if (Sem == &PPCDoubleDouble) return initFromPPCDoubleDoubleAPInt(api); - llvm_unreachable(0); + llvm_unreachable(nullptr); } APFloat diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index 4777616b952..2b4c43104bb 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -103,7 +103,7 @@ void cl::MarkOptionsChanged() { static Option *RegisteredOptionList = nullptr; void Option::addArgument() { - assert(NextRegistered == 0 && "argument multiply registered!"); + assert(!NextRegistered && "argument multiply registered!"); NextRegistered = RegisteredOptionList; RegisteredOptionList = this; @@ -111,7 +111,7 @@ void Option::addArgument() { } void Option::removeArgument() { - assert(NextRegistered != 0 && "argument never registered"); + assert(NextRegistered && "argument never registered"); assert(RegisteredOptionList == this && "argument is not the last registered"); RegisteredOptionList = NextRegistered; MarkOptionsChanged(); diff --git a/llvm/lib/Support/Debug.cpp b/llvm/lib/Support/Debug.cpp index d9cb8a9da81..ad4d4ef1d92 100644 --- a/llvm/lib/Support/Debug.cpp +++ b/llvm/lib/Support/Debug.cpp @@ -109,7 +109,7 @@ raw_ostream &llvm::dbgs() { if (EnableDebugBuffering && DebugFlag && DebugBufferSize != 0) // TODO: Add a handler for SIGUSER1-type signals so the user can // force a debug dump. - sys::AddSignalHandler(&debug_user_sig_handler, 0); + sys::AddSignalHandler(&debug_user_sig_handler, nullptr); // Otherwise we've already set the debug stream buffer size to // zero, disabling buffering so it will output directly to errs(). } diff --git a/llvm/lib/Support/FoldingSet.cpp b/llvm/lib/Support/FoldingSet.cpp index d857559898e..46351140875 100644 --- a/llvm/lib/Support/FoldingSet.cpp +++ b/llvm/lib/Support/FoldingSet.cpp @@ -305,7 +305,7 @@ FoldingSetImpl::Node /// is not already in the map. InsertPos must be obtained from /// FindNodeOrInsertPos. void FoldingSetImpl::InsertNode(Node *N, void *InsertPos) { - assert(N->getNextInBucket() == 0); + assert(!N->getNextInBucket()); // Do we need to grow the hashtable? if (NumNodes+1 > NumBuckets*2) { GrowHashTable(); diff --git a/llvm/lib/Support/ManagedStatic.cpp b/llvm/lib/Support/ManagedStatic.cpp index c05cd22ea05..acd5b1a7018 100644 --- a/llvm/lib/Support/ManagedStatic.cpp +++ b/llvm/lib/Support/ManagedStatic.cpp @@ -45,7 +45,7 @@ void ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(), llvm_release_global_lock(); } else { - assert(Ptr == 0 && DeleterFn == 0 && Next == 0 && + assert(!Ptr && !DeleterFn && !Next && "Partially initialized ManagedStatic!?"); Ptr = Creator ? Creator() : nullptr; DeleterFn = Deleter; diff --git a/llvm/lib/Support/Mutex.cpp b/llvm/lib/Support/Mutex.cpp index 292d32a2fb1..c8d3844d0c9 100644 --- a/llvm/lib/Support/Mutex.cpp +++ b/llvm/lib/Support/Mutex.cpp @@ -75,7 +75,7 @@ MutexImpl::MutexImpl( bool recursive) MutexImpl::~MutexImpl() { pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_); - assert(mutex != 0); + assert(mutex != nullptr); pthread_mutex_destroy(mutex); free(mutex); } @@ -84,7 +84,7 @@ bool MutexImpl::acquire() { pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_); - assert(mutex != 0); + assert(mutex != nullptr); int errorcode = pthread_mutex_lock(mutex); return errorcode == 0; @@ -94,7 +94,7 @@ bool MutexImpl::release() { pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_); - assert(mutex != 0); + assert(mutex != nullptr); int errorcode = pthread_mutex_unlock(mutex); return errorcode == 0; @@ -104,7 +104,7 @@ bool MutexImpl::tryacquire() { pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(data_); - assert(mutex != 0); + assert(mutex != nullptr); int errorcode = pthread_mutex_trylock(mutex); return errorcode == 0; diff --git a/llvm/lib/Support/RWMutex.cpp b/llvm/lib/Support/RWMutex.cpp index f42be5af50f..3b6309cef21 100644 --- a/llvm/lib/Support/RWMutex.cpp +++ b/llvm/lib/Support/RWMutex.cpp @@ -68,7 +68,7 @@ RWMutexImpl::RWMutexImpl() RWMutexImpl::~RWMutexImpl() { pthread_rwlock_t* rwlock = static_cast<pthread_rwlock_t*>(data_); - assert(rwlock != 0); + assert(rwlock != nullptr); pthread_rwlock_destroy(rwlock); free(rwlock); } @@ -77,7 +77,7 @@ bool RWMutexImpl::reader_acquire() { pthread_rwlock_t* rwlock = static_cast<pthread_rwlock_t*>(data_); - assert(rwlock != 0); + assert(rwlock != nullptr); int errorcode = pthread_rwlock_rdlock(rwlock); return errorcode == 0; @@ -87,7 +87,7 @@ bool RWMutexImpl::reader_release() { pthread_rwlock_t* rwlock = static_cast<pthread_rwlock_t*>(data_); - assert(rwlock != 0); + assert(rwlock != nullptr); int errorcode = pthread_rwlock_unlock(rwlock); return errorcode == 0; @@ -97,7 +97,7 @@ bool RWMutexImpl::writer_acquire() { pthread_rwlock_t* rwlock = static_cast<pthread_rwlock_t*>(data_); - assert(rwlock != 0); + assert(rwlock != nullptr); int errorcode = pthread_rwlock_wrlock(rwlock); return errorcode == 0; @@ -107,7 +107,7 @@ bool RWMutexImpl::writer_release() { pthread_rwlock_t* rwlock = static_cast<pthread_rwlock_t*>(data_); - assert(rwlock != 0); + assert(rwlock != nullptr); int errorcode = pthread_rwlock_unlock(rwlock); return errorcode == 0; diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp index ea75d45f68a..eb3ffc44c8e 100644 --- a/llvm/lib/Support/Timer.cpp +++ b/llvm/lib/Support/Timer.cpp @@ -100,7 +100,7 @@ static TimerGroup *getDefaultTimerGroup() { //===----------------------------------------------------------------------===// void Timer::init(StringRef N) { - assert(TG == 0 && "Timer already initialized"); + assert(!TG && "Timer already initialized"); Name.assign(N.begin(), N.end()); Started = false; TG = getDefaultTimerGroup(); @@ -108,7 +108,7 @@ void Timer::init(StringRef N) { } void Timer::init(StringRef N, TimerGroup &tg) { - assert(TG == 0 && "Timer already initialized"); + assert(!TG && "Timer already initialized"); Name.assign(N.begin(), N.end()); Started = false; TG = &tg; diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp index 3c45743666d..f55838e660f 100644 --- a/llvm/lib/Support/raw_ostream.cpp +++ b/llvm/lib/Support/raw_ostream.cpp @@ -87,8 +87,8 @@ void raw_ostream::SetBuffered() { void raw_ostream::SetBufferAndMode(char *BufferStart, size_t Size, BufferKind Mode) { - assert(((Mode == Unbuffered && BufferStart == 0 && Size == 0) || - (Mode != Unbuffered && BufferStart && Size)) && + assert(((Mode == Unbuffered && !BufferStart && Size == 0) || + (Mode != Unbuffered && BufferStart && Size != 0)) && "stream must be unbuffered or have at least one byte"); // Make sure the current buffer is free of content (we can't flush here; the // child buffer management logic will be in write_impl). @@ -433,7 +433,7 @@ void format_object_base::home() { raw_fd_ostream::raw_fd_ostream(const char *Filename, std::string &ErrorInfo, sys::fs::OpenFlags Flags) : Error(false), UseAtomicWrites(false), pos(0) { - assert(Filename != 0 && "Filename is null"); + assert(Filename && "Filename is null"); ErrorInfo.clear(); // Handle "-" as stdout. Note that when we do this, we consider ourself |