diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-04-15 06:32:26 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-04-15 06:32:26 +0000 |
commit | 0b6cb7104b15504cd41f48cc2babcbcee70775f3 (patch) | |
tree | 48f97597536aa35e8e2b80b8e25e049821ca7e13 /include/llvm/Bitcode | |
parent | eb19b8f58b12532e736051fee46dcf2115a4888d (diff) | |
download | llvm-0b6cb7104b15504cd41f48cc2babcbcee70775f3.tar.gz llvm-0b6cb7104b15504cd41f48cc2babcbcee70775f3.tar.bz2 llvm-0b6cb7104b15504cd41f48cc2babcbcee70775f3.tar.xz |
[C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Bitcode')
-rw-r--r-- | include/llvm/Bitcode/BitstreamReader.h | 12 | ||||
-rw-r--r-- | include/llvm/Bitcode/BitstreamWriter.h | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h index fcbf426044..6f478b7212 100644 --- a/include/llvm/Bitcode/BitstreamReader.h +++ b/include/llvm/Bitcode/BitstreamReader.h @@ -111,7 +111,7 @@ public: i != e; ++i) if (BlockInfoRecords[i].BlockID == BlockID) return &BlockInfoRecords[i]; - return 0; + return nullptr; } BlockInfo &getOrCreateBlockInfo(unsigned BlockID) { @@ -200,9 +200,9 @@ class BitstreamCursor { public: - BitstreamCursor() : BitStream(0), NextChar(0) { - } - BitstreamCursor(const BitstreamCursor &RHS) : BitStream(0), NextChar(0) { + BitstreamCursor() : BitStream(nullptr), NextChar(0) {} + BitstreamCursor(const BitstreamCursor &RHS) + : BitStream(nullptr), NextChar(0) { operator=(RHS); } @@ -490,7 +490,7 @@ public: /// EnterSubBlock - Having read the ENTER_SUBBLOCK abbrevid, enter /// the block, and return true if the block has an error. - bool EnterSubBlock(unsigned BlockID, unsigned *NumWordsP = 0); + bool EnterSubBlock(unsigned BlockID, unsigned *NumWordsP = nullptr); bool ReadBlockEnd() { if (BlockScope.empty()) return true; @@ -541,7 +541,7 @@ public: void skipRecord(unsigned AbbrevID); unsigned readRecord(unsigned AbbrevID, SmallVectorImpl<uint64_t> &Vals, - StringRef *Blob = 0); + StringRef *Blob = nullptr); //===--------------------------------------------------------------------===// // Abbrev Processing diff --git a/include/llvm/Bitcode/BitstreamWriter.h b/include/llvm/Bitcode/BitstreamWriter.h index ef88a88a6c..dcfebd9cc1 100644 --- a/include/llvm/Bitcode/BitstreamWriter.h +++ b/include/llvm/Bitcode/BitstreamWriter.h @@ -204,7 +204,7 @@ public: i != e; ++i) if (BlockInfoRecords[i].BlockID == BlockID) return &BlockInfoRecords[i]; - return 0; + return nullptr; } void EnterSubblock(unsigned BlockID, unsigned CodeLen) { @@ -347,7 +347,7 @@ private: EmitAbbreviatedField(EltEnc, (unsigned char)BlobData[i]); // Know that blob data is consumed for assertion below. - BlobData = 0; + BlobData = nullptr; } else { // Emit a vbr6 to indicate the number of elements present. EmitVBR(static_cast<uint32_t>(Vals.size()-RecordIdx), 6); @@ -378,7 +378,7 @@ private: WriteByte((unsigned char)BlobData[i]); // Know that blob data is consumed for assertion below. - BlobData = 0; + BlobData = nullptr; } else { for (unsigned e = Vals.size(); RecordIdx != e; ++RecordIdx) { assert(isUInt<8>(Vals[RecordIdx]) && @@ -397,7 +397,7 @@ private: } } assert(RecordIdx == Vals.size() && "Not all record operands emitted!"); - assert(BlobData == 0 && + assert(BlobData == nullptr && "Blob data specified for record that doesn't use it!"); } |