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/lib/Object/XCOFFObjectFile.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Object/XCOFFObjectFile.cpp') diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp index 2a456538966..db57fbad002 100644 --- a/llvm/lib/Object/XCOFFObjectFile.cpp +++ b/llvm/lib/Object/XCOFFObjectFile.cpp @@ -137,10 +137,9 @@ uint64_t XCOFFObjectFile::getSectionSize(DataRefImpl Sec) const { return toSection(Sec)->SectionSize; } -std::error_code XCOFFObjectFile::getSectionContents(DataRefImpl Sec, - StringRef &Res) const { +Expected> +XCOFFObjectFile::getSectionContents(DataRefImpl Sec) const { llvm_unreachable("Not yet implemented!"); - return std::error_code(); } uint64_t XCOFFObjectFile::getSectionAlignment(DataRefImpl Sec) const { -- cgit v1.2.3