From 802912743ef73ea794cb3c66a8cb2211735a12c3 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 8 Oct 2014 15:28:58 +0000 Subject: 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 --- llvm/tools/llvm-readobj/MachODumper.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'llvm/tools/llvm-readobj/MachODumper.cpp') diff --git a/llvm/tools/llvm-readobj/MachODumper.cpp b/llvm/tools/llvm-readobj/MachODumper.cpp index 2d09282f11f..968d5deca15 100644 --- a/llvm/tools/llvm-readobj/MachODumper.cpp +++ b/llvm/tools/llvm-readobj/MachODumper.cpp @@ -257,8 +257,7 @@ void MachODumper::printSections(const MachOObjectFile *Obj) { if (opts::SectionSymbols) { ListScope D(W, "Symbols"); for (const SymbolRef &Symbol : Obj->symbols()) { - bool Contained = false; - if (Section.containsSymbol(Symbol, Contained) || !Contained) + if (!Section.containsSymbol(Symbol)) continue; printSymbol(Symbol); @@ -266,9 +265,7 @@ void MachODumper::printSections(const MachOObjectFile *Obj) { } if (opts::SectionData) { - bool IsBSS; - if (error(Section.isBSS(IsBSS))) - break; + bool IsBSS = Section.isBSS(); if (!IsBSS) { StringRef Data; if (error(Section.getContents(Data))) -- cgit v1.2.3