diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-04-28 04:05:08 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-04-28 04:05:08 +0000 |
commit | c34a25d59d382aa00a94b3f0603ce8724c66606d (patch) | |
tree | 183fcfd0dfc47544b17e5a6c3b3281fb5bfca3c4 /lib/Bitcode | |
parent | 1c5e4e50211ad2a8024c28fa0237a8026ba51f8f (diff) | |
download | llvm-c34a25d59d382aa00a94b3f0603ce8724c66606d.tar.gz llvm-c34a25d59d382aa00a94b3f0603ce8724c66606d.tar.bz2 llvm-c34a25d59d382aa00a94b3f0603ce8724c66606d.tar.xz |
[C++] Use 'nullptr'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h index 15be31f039..593d8f93cc 100644 --- a/lib/Bitcode/Reader/BitcodeReader.h +++ b/lib/Bitcode/Reader/BitcodeReader.h @@ -224,13 +224,13 @@ public: } explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext &C) - : Context(C), TheModule(0), Buffer(buffer), BufferOwned(false), - LazyStreamer(0), NextUnreadBit(0), SeenValueSymbolTable(false), + : Context(C), TheModule(nullptr), Buffer(buffer), BufferOwned(false), + LazyStreamer(nullptr), NextUnreadBit(0), SeenValueSymbolTable(false), ValueList(C), MDValueList(C), SeenFirstFunctionBody(false), UseRelativeIDs(false) { } explicit BitcodeReader(DataStreamer *streamer, LLVMContext &C) - : Context(C), TheModule(0), Buffer(0), BufferOwned(false), + : Context(C), TheModule(nullptr), Buffer(nullptr), BufferOwned(false), LazyStreamer(streamer), NextUnreadBit(0), SeenValueSymbolTable(false), ValueList(C), MDValueList(C), SeenFirstFunctionBody(false), UseRelativeIDs(false) { @@ -271,7 +271,7 @@ private: return ValueList.getValueFwdRef(ID, Ty); } BasicBlock *getBasicBlock(unsigned ID) const { - if (ID >= FunctionBBs.size()) return 0; // Invalid ID + if (ID >= FunctionBBs.size()) return nullptr; // Invalid ID return FunctionBBs[ID]; } AttributeSet getAttributes(unsigned i) const { @@ -293,15 +293,15 @@ private: if (ValNo < InstNum) { // If this is not a forward reference, just return the value we already // have. - ResVal = getFnValueByID(ValNo, 0); - return ResVal == 0; + ResVal = getFnValueByID(ValNo, nullptr); + return ResVal == nullptr; } else if (Slot == Record.size()) { return true; } unsigned TypeNo = (unsigned)Record[Slot++]; ResVal = getFnValueByID(ValNo, getTypeByID(TypeNo)); - return ResVal == 0; + return ResVal == nullptr; } /// popValue - Read a value out of the specified record from slot 'Slot'. @@ -320,14 +320,14 @@ private: bool getValue(SmallVectorImpl<uint64_t> &Record, unsigned Slot, unsigned InstNum, Type *Ty, Value *&ResVal) { ResVal = getValue(Record, Slot, InstNum, Ty); - return ResVal == 0; + return ResVal == nullptr; } /// getValue -- Version of getValue that returns ResVal directly, /// or 0 if there is an error. Value *getValue(SmallVectorImpl<uint64_t> &Record, unsigned Slot, unsigned InstNum, Type *Ty) { - if (Slot == Record.size()) return 0; + if (Slot == Record.size()) return nullptr; unsigned ValNo = (unsigned)Record[Slot]; // Adjust the ValNo, if it was encoded relative to the InstNum. if (UseRelativeIDs) @@ -338,7 +338,7 @@ private: /// getValueSigned -- Like getValue, but decodes signed VBRs. Value *getValueSigned(SmallVectorImpl<uint64_t> &Record, unsigned Slot, unsigned InstNum, Type *Ty) { - if (Slot == Record.size()) return 0; + if (Slot == Record.size()) return nullptr; unsigned ValNo = (unsigned)decodeSignRotatedValue(Record[Slot]); // Adjust the ValNo, if it was encoded relative to the InstNum. if (UseRelativeIDs) |