diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-10-08 15:28:58 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-10-08 15:28:58 +0000 |
| commit | 802912743ef73ea794cb3c66a8cb2211735a12c3 (patch) | |
| tree | 783b34f5407b2fb86acbd48216621d09c45d41dc /llvm/lib/DebugInfo/DWARFContext.cpp | |
| parent | 14fc1c0240930563b8692e8c29c76c9a7fbde32d (diff) | |
| download | bcm5719-llvm-802912743ef73ea794cb3c66a8cb2211735a12c3.tar.gz bcm5719-llvm-802912743ef73ea794cb3c66a8cb2211735a12c3.zip | |
Remove bogus std::error_code returns form SectionRef.
There are two methods in SectionRef that can fail:
* getName: The index into the string table can be invalid.
* getContents: The section might point to invalid contents.
Every other method will always succeed and returning and std::error_code just
complicates the code. For example, a section can have an invalid alignment,
but if we are able to get to the section structure at all and create a
SectionRef, we will always be able to read that invalid alignment.
llvm-svn: 219314
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFContext.cpp')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARFContext.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARFContext.cpp index a1216391bd9..830db66098c 100644 --- a/llvm/lib/DebugInfo/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARFContext.cpp @@ -516,12 +516,10 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile &Obj) StringRef name; Section.getName(name); // Skip BSS and Virtual sections, they aren't interesting. - bool IsBSS; - Section.isBSS(IsBSS); + bool IsBSS = Section.isBSS(); if (IsBSS) continue; - bool IsVirtual; - Section.isVirtual(IsVirtual); + bool IsVirtual = Section.isVirtual(); if (IsVirtual) continue; StringRef data; @@ -612,8 +610,7 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile &Obj) } if (Section.relocation_begin() != Section.relocation_end()) { - uint64_t SectionSize; - RelocatedSection->getSize(SectionSize); + uint64_t SectionSize = RelocatedSection->getSize(); for (const RelocationRef &Reloc : Section.relocations()) { uint64_t Address; Reloc.getOffset(Address); |

