From 4da9ff9fcfe8987472dc894489597bd338aac85e Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Thu, 16 May 2019 12:08:34 +0000 Subject: Revert r360876 "[Object] Change object::SectionRef::getContents() to return Expected" It broke the Clang build, see llvm-commits thread. > Expected> may be better but use Expected for now. > > Follow-up of D61781. llvm-svn: 360878 --- llvm/lib/XRay/InstrumentationMap.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/XRay/InstrumentationMap.cpp') diff --git a/llvm/lib/XRay/InstrumentationMap.cpp b/llvm/lib/XRay/InstrumentationMap.cpp index 2eeb4559021..862949f578c 100644 --- a/llvm/lib/XRay/InstrumentationMap.cpp +++ b/llvm/lib/XRay/InstrumentationMap.cpp @@ -78,10 +78,9 @@ loadObj(StringRef Filename, object::OwningBinary &ObjFile, "Failed to find XRay instrumentation map.", std::make_error_code(std::errc::executable_format_error)); - if (Expected E = I->getContents()) - Contents = *E; - else - return E.takeError(); + if (I->getContents(Contents)) + return errorCodeToError( + std::make_error_code(std::errc::executable_format_error)); RelocMap Relocs; if (ObjFile.getBinary()->isELF()) { -- cgit v1.2.3