From 2617dccea2721fd74677f0a7bcf5a768238421d0 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 15 Apr 2014 06:32:26 +0000 Subject: [C++11] More 'nullptr' conversion. In some cases just using a boolean check instead of comparing to nullptr. llvm-svn: 206252 --- llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp') diff --git a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp index bde25ec82d1..3acdc8f8c52 100644 --- a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp +++ b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp @@ -99,11 +99,11 @@ bool DWARFDebugInfoEntryMinimal::extractFast(const DWARFUnit *U, uint64_t AbbrCode = DebugInfoData.getULEB128(OffsetPtr); if (0 == AbbrCode) { // NULL debug tag entry. - AbbrevDecl = NULL; + AbbrevDecl = nullptr; return true; } AbbrevDecl = U->getAbbreviations()->getAbbreviationDeclaration(AbbrCode); - if (0 == AbbrevDecl) { + if (nullptr == AbbrevDecl) { // Restore the original offset. *OffsetPtr = Offset; return false; @@ -266,14 +266,15 @@ bool DWARFDebugInfoEntryMinimal::addressRangeContainsAddress( const char * DWARFDebugInfoEntryMinimal::getSubroutineName(const DWARFUnit *U) const { if (!isSubroutineDIE()) - return 0; + return nullptr; // Try to get mangled name if possible. if (const char *name = - getAttributeValueAsString(U, DW_AT_MIPS_linkage_name, 0)) + getAttributeValueAsString(U, DW_AT_MIPS_linkage_name, nullptr)) return name; - if (const char *name = getAttributeValueAsString(U, DW_AT_linkage_name, 0)) + if (const char *name = getAttributeValueAsString(U, DW_AT_linkage_name, + nullptr)) return name; - if (const char *name = getAttributeValueAsString(U, DW_AT_name, 0)) + if (const char *name = getAttributeValueAsString(U, DW_AT_name, nullptr)) return name; // Try to get name from specification DIE. uint32_t spec_ref = @@ -295,7 +296,7 @@ DWARFDebugInfoEntryMinimal::getSubroutineName(const DWARFUnit *U) const { return name; } } - return 0; + return nullptr; } void DWARFDebugInfoEntryMinimal::getCallerFrame(const DWARFUnit *U, -- cgit v1.2.3