From e1cb2c0f404d9fe68f5f465a281be295ca24ec33 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 14 May 2019 04:22:51 +0000 Subject: [Object] Change ObjectFile::getSectionContents to return Expected> Change std::error_code getSectionContents(DataRefImpl, StringRef &) const; to Expected> getSectionContents(DataRefImpl) const; Many object formats use ArrayRef as the underlying type, which is generally better than StringRef to represent binary data, so change the type to decrease the number of type conversions. Reviewed By: ruiu, sbc100 Differential Revision: https://reviews.llvm.org/D61781 llvm-svn: 360648 --- llvm/tools/llvm-objdump/COFFDump.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/tools/llvm-objdump') diff --git a/llvm/tools/llvm-objdump/COFFDump.cpp b/llvm/tools/llvm-objdump/COFFDump.cpp index a81068c2ca4..1ba0a68902c 100644 --- a/llvm/tools/llvm-objdump/COFFDump.cpp +++ b/llvm/tools/llvm-objdump/COFFDump.cpp @@ -198,9 +198,7 @@ getSectionContents(const COFFObjectFile *Obj, const coff_section *Section; if (Error E = resolveSectionAndAddress(Obj, Sym, Section, Addr)) return E; - if (std::error_code EC = Obj->getSectionContents(Section, Contents)) - return errorCodeToError(EC); - return Error::success(); + return Obj->getSectionContents(Section, Contents); } // Given a vector of relocations for a section and an offset into this section -- cgit v1.2.3