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 /lib/DebugInfo/DWARFFormValue.cpp | |
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 'lib/DebugInfo/DWARFFormValue.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFFormValue.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/DebugInfo/DWARFFormValue.cpp b/lib/DebugInfo/DWARFFormValue.cpp index da71fb3d11..8d0f96620a 100644 --- a/lib/DebugInfo/DWARFFormValue.cpp +++ b/lib/DebugInfo/DWARFFormValue.cpp @@ -131,7 +131,7 @@ bool DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr, const DWARFUnit *cu) { bool indirect = false; bool is_block = false; - Value.data = NULL; + Value.data = nullptr; // Read the value for the form into value and follow and DW_FORM_indirect // instances we run into do { @@ -241,7 +241,7 @@ bool DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr, if (is_block) { StringRef str = data.getData().substr(*offset_ptr, Value.uval); - Value.data = NULL; + Value.data = nullptr; if (!str.empty()) { Value.data = reinterpret_cast<const uint8_t *>(str.data()); *offset_ptr += Value.uval; @@ -488,7 +488,7 @@ Optional<const char *> DWARFFormValue::getAsCString(const DWARFUnit *U) const { return None; if (Form == DW_FORM_string) return Value.cstr; - if (U == 0) + if (!U) return None; uint32_t Offset = Value.uval; if (Form == DW_FORM_GNU_str_index) { @@ -509,7 +509,7 @@ Optional<uint64_t> DWARFFormValue::getAsAddress(const DWARFUnit *U) const { if (Form == DW_FORM_GNU_addr_index) { uint32_t Index = Value.uval; uint64_t Result; - if (U == 0 || !U->getAddrOffsetSectionItem(Index, Result)) + if (!U || !U->getAddrOffsetSectionItem(Index, Result)) return None; return Result; } @@ -525,7 +525,7 @@ Optional<uint64_t> DWARFFormValue::getAsReference(const DWARFUnit *U) const { case DW_FORM_ref4: case DW_FORM_ref8: case DW_FORM_ref_udata: - if (U == 0) + if (!U) return None; return Value.uval + U->getOffset(); case DW_FORM_ref_addr: |