[PATCH] D61781: [Object] Change ObjectFile::getSectionContents to use Expected
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 10 05:07:45 PDT 2019
MaskRay created this revision.
MaskRay added reviewers: jhenderson, ruiu, rupprecht.
Herald added subscribers: llvm-commits, jakehehrlich, aheejin, hiraditya, sbc100.
Herald added a reviewer: alexshap.
Herald added a project: LLVM.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D61781
Files:
lld/COFF/Chunks.cpp
lld/COFF/Driver.cpp
llvm/include/llvm/Object/COFF.h
llvm/include/llvm/Object/ELFObjectFile.h
llvm/include/llvm/Object/MachO.h
llvm/include/llvm/Object/ObjectFile.h
llvm/include/llvm/Object/Wasm.h
llvm/include/llvm/Object/XCOFFObjectFile.h
llvm/lib/Object/COFFObjectFile.cpp
llvm/lib/Object/MachOObjectFile.cpp
llvm/lib/Object/WasmObjectFile.cpp
llvm/lib/Object/XCOFFObjectFile.cpp
llvm/tools/llvm-objcopy/COFF/Reader.cpp
llvm/tools/llvm-objcopy/MachO/MachOReader.cpp
llvm/tools/llvm-objdump/COFFDump.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61781.199004.patch
Type: text/x-patch
Size: 14071 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190510/7f1ff428/attachment.bin>
More information about the llvm-commits
mailing list