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/DWARFContext.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/DWARFContext.cpp')
-rw-r--r-- | lib/DebugInfo/DWARFContext.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp index a287cf9edb..5b65d0ae1a 100644 --- a/lib/DebugInfo/DWARFContext.cpp +++ b/lib/DebugInfo/DWARFContext.cpp @@ -290,7 +290,7 @@ DWARFContext::getLineTableForCompileUnit(DWARFCompileUnit *cu) { cu->getCompileUnitDIE()->getAttributeValueAsSectionOffset( cu, DW_AT_stmt_list, -1U); if (stmtOffset == -1U) - return 0; // No line table for this compile unit. + return nullptr; // No line table for this compile unit. // See if the line table is cached. if (const DWARFLineTable *lt = Line->getLineTable(stmtOffset)) @@ -408,7 +408,7 @@ DWARFCompileUnit *DWARFContext::getCompileUnitForOffset(uint32_t Offset) { if (CU != CUs.end()) { return CU->get(); } - return 0; + return nullptr; } DWARFCompileUnit *DWARFContext::getCompileUnitForAddress(uint64_t Address) { @@ -423,8 +423,7 @@ static bool getFileNameForCompileUnit(DWARFCompileUnit *CU, uint64_t FileIndex, bool NeedsAbsoluteFilePath, std::string &FileName) { - if (CU == 0 || - LineTable == 0 || + if (!CU || !LineTable || !LineTable->getFileNameByIndex(FileIndex, NeedsAbsoluteFilePath, FileName)) return false; @@ -446,7 +445,7 @@ static bool getFileLineInfoForCompileUnit(DWARFCompileUnit *CU, bool NeedsAbsoluteFilePath, std::string &FileName, uint32_t &Line, uint32_t &Column) { - if (CU == 0 || LineTable == 0) + if (!CU || !LineTable) return false; // Get the index of row we're looking for in the line table. uint32_t RowIndex = LineTable->lookupAddress(Address); @@ -560,7 +559,7 @@ DIInliningInfo DWARFContext::getInliningInfoForAddress(uint64_t Address, DIInliningInfo InliningInfo; uint32_t CallFile = 0, CallLine = 0, CallColumn = 0; - const DWARFLineTable *LineTable = 0; + const DWARFLineTable *LineTable = nullptr; for (uint32_t i = 0, n = InlinedChain.DIEs.size(); i != n; i++) { const DWARFDebugInfoEntryMinimal &FunctionDIE = InlinedChain.DIEs[i]; std::string FileName = "<invalid>"; @@ -670,7 +669,7 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) .Case("debug_str_offsets.dwo", &StringOffsetDWOSection) .Case("debug_addr", &AddrSection) // Any more debug info sections go here. - .Default(0); + .Default(nullptr); if (SectionData) { *SectionData = data; if (name == "debug_ranges") { @@ -701,7 +700,7 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) .Case("debug_loc", &LocSection.Relocs) .Case("debug_info.dwo", &InfoDWOSection.Relocs) .Case("debug_line", &LineSection.Relocs) - .Default(0); + .Default(nullptr); if (!Map) { // Find debug_types relocs by section rather than name as there are // multiple, comdat grouped, debug_types sections. |