diff --git a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp --- a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp +++ b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp @@ -573,5 +573,5 @@ } SegmentFuncInfosSize += alignTo(GC->copyFunctionInfo(*this, FuncIdx), 4); } - return GC; + return std::move(GC); } diff --git a/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp b/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp --- a/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp +++ b/llvm/unittests/DebugInfo/GSYM/GSYMTest.cpp @@ -2486,17 +2486,17 @@ // Finalize a GsymCreator, encode it and decode it and return the error or // GsymReader that was successfully decoded. -static Expected FinalizeEncodeAndDecode(GsymCreator &GC) { - Error FinalizeErr = GC.finalize(llvm::nulls()); +static llvm::Expected FinalizeEncodeAndDecode(GsymCreator &GC) { + llvm::Error FinalizeErr = GC.finalize(llvm::nulls()); if (FinalizeErr) - return FinalizeErr; + return std::move(FinalizeErr); SmallString<1024> Str; raw_svector_ostream OutStrm(Str); const auto ByteOrder = support::endian::system_endianness(); FileWriter FW(OutStrm, ByteOrder); llvm::Error Err = GC.encode(FW); if (Err) - return Err; + return std::move(Err); return GsymReader::copyBuffer(OutStrm.str()); }