diff --git a/tools/llvm-readobj/COFFDumper.cpp b/tools/llvm-readobj/COFFDumper.cpp index 188e9f89133..aec41c7d2ab 100644 --- a/tools/llvm-readobj/COFFDumper.cpp +++ b/tools/llvm-readobj/COFFDumper.cpp @@ -80,11 +80,8 @@ private: void cacheRelocations(); - error_code getSection( - const std::vector &Rels, - uint64_t Offset, - const coff_section **Section, - uint64_t *AddrPtr); + error_code getSection(const std::vector &Rels, uint64_t Offset, + const coff_section *&Section, uint64_t &AddrPtr); typedef DenseMap > RelocMapTy; @@ -460,24 +457,17 @@ static std::string formatSymbol(const std::vector &Rels, return Str.str(); } -error_code COFFDumper::getSection( - const std::vector &Rels, uint64_t Offset, - const coff_section **SectionPtr, uint64_t *AddrPtr) { - +error_code COFFDumper::getSection(const std::vector &Rels, + uint64_t Offset, + const coff_section *&SectionPtr, + uint64_t &AddrPtr) { SymbolRef Sym; if (error_code EC = resolveSymbol(Rels, Offset, Sym)) return EC; - const coff_section *Section; - uint64_t Addr; - if (error_code EC = resolveSectionAndAddress(Obj, Sym, Section, Addr)) + if (error_code EC = resolveSectionAndAddress(Obj, Sym, SectionPtr, AddrPtr)) return EC; - if (SectionPtr) - *SectionPtr = Section; - if (AddrPtr) - *AddrPtr = Addr; - return object_error::success; } @@ -1063,7 +1053,7 @@ void COFFDumper::printRuntimeFunction( const coff_section* XData = nullptr; uint64_t UnwindInfoOffset = 0; - if (error(getSection(Rels, OffsetInSection + 8, &XData, &UnwindInfoOffset))) + if (error(getSection(Rels, OffsetInSection + 8, XData, UnwindInfoOffset))) return; ArrayRef XContents;