summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-05-14 04:22:51 +0000
committerFangrui Song <maskray@google.com>2019-05-14 04:22:51 +0000
commite1cb2c0f404d9fe68f5f465a281be295ca24ec33 (patch)
tree7b6e58ac12ce6b1e8deb5e2542f4a95cba445585 /llvm/tools/llvm-objdump
parentfe1aec0dbb1638b5ce84c9ad71d1c8bee4f1f8ac (diff)
downloadbcm5719-llvm-e1cb2c0f404d9fe68f5f465a281be295ca24ec33.tar.gz
bcm5719-llvm-e1cb2c0f404d9fe68f5f465a281be295ca24ec33.zip
[Object] Change ObjectFile::getSectionContents to return Expected<ArrayRef<uint8_t>>
Change std::error_code getSectionContents(DataRefImpl, StringRef &) const; to Expected<ArrayRef<uint8_t>> getSectionContents(DataRefImpl) const; Many object formats use ArrayRef<uint8_t> 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
Diffstat (limited to 'llvm/tools/llvm-objdump')
-rw-r--r--llvm/tools/llvm-objdump/COFFDump.cpp4
1 files changed, 1 insertions, 3 deletions
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
OpenPOWER on IntegriCloud