[C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205831 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper
2014-04-09 06:08:46 +00:00
parent 8a0d1c8f06
commit ec0f0bc6af
80 changed files with 763 additions and 735 deletions

View File

@@ -49,7 +49,7 @@ namespace llvm {
/// @{
/// Construct an empty ArrayRef.
/*implicit*/ ArrayRef() : Data(0), Length(0) {}
/*implicit*/ ArrayRef() : Data(nullptr), Length(0) {}
/// Construct an empty ArrayRef from None.
/*implicit*/ ArrayRef(NoneType) : Data(nullptr), Length(0) {}

View File

@@ -985,7 +985,7 @@ public:
private:
pointer Ptr, End;
public:
DenseMapIterator() : Ptr(0), End(0) {}
DenseMapIterator() : Ptr(nullptr), End(nullptr) {}
DenseMapIterator(pointer Pos, pointer E, bool NoAdvance = false)
: Ptr(Pos), End(E) {

View File

@@ -494,9 +494,9 @@ private:
// Note: we have to be careful about the case when we move the first node
// in the list. This node is the list sentinel node and we can't move it.
NodeTy *ThisSentinel = getTail();
setTail(0);
setTail(nullptr);
NodeTy *L2Sentinel = L2.getTail();
L2.setTail(0);
L2.setTail(nullptr);
// Remove [first, last) from its old position.
NodeTy *First = &*first, *Prev = this->getPrev(First);
@@ -537,7 +537,7 @@ public:
//
size_type LLVM_ATTRIBUTE_UNUSED_RESULT size() const {
if (Head == 0) return 0; // Don't require construction of sentinel if empty.
if (!Head) return 0; // Don't require construction of sentinel if empty.
return std::distance(begin(), end());
}