[llvm] 1c2241a - Remove redundant "std::move"s in return statements
Kristina Brooks via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 10 07:11:31 PST 2020
Running into the same issues, for example:
llvm/lib/Support/APFloat.cpp:2521:12: error: call to deleted
constructor of 'llvm::Error'
return Err;
llvm/include/llvm/Support/Error.h:186:3: note: 'Error' has been
explicitly marked deleted here
Error(const Error &Other) = delete;
llvm/include/llvm/Support/Error.h:455:18: note: passing argument to
parameter 'Err' here
Expected(Error Err)
1 error generated.
On Mon, Feb 10, 2020 at 2:54 PM James Henderson via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
> This has broken the build bots. Please could you revert or fix quickly.
>
> On Mon, 10 Feb 2020 at 14:40, Bill Wendling via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>>
>>
>> Author: Bill Wendling
>> Date: 2020-02-10T06:39:44-08:00
>> New Revision: 1c2241a7936bf85aa68aef94bd40c3ba77d8ddf2
>>
>> URL: https://github.com/llvm/llvm-project/commit/1c2241a7936bf85aa68aef94bd40c3ba77d8ddf2
>> DIFF: https://github.com/llvm/llvm-project/commit/1c2241a7936bf85aa68aef94bd40c3ba77d8ddf2.diff
>>
>> LOG: Remove redundant "std::move"s in return statements
>>
>> Added:
>>
>>
>> Modified:
>> llvm/include/llvm/Bitstream/BitstreamReader.h
>> llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
>> llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
>> llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
>> llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
>> llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
>> llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
>> llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
>> llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
>> llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
>> llvm/include/llvm/ExecutionEngine/Orc/Legacy.h
>> llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
>> llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h
>> llvm/include/llvm/ExecutionEngine/Orc/RPC/RPCUtils.h
>> llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
>> llvm/include/llvm/Object/ELF.h
>> llvm/include/llvm/Object/ELFObjectFile.h
>> llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
>> llvm/include/llvm/Support/Error.h
>> llvm/include/llvm/Support/TaskQueue.h
>> llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp
>> llvm/lib/Bitcode/Reader/BitcodeReader.cpp
>> llvm/lib/Bitcode/Reader/MetadataLoader.cpp
>> llvm/lib/Bitstream/Reader/BitstreamReader.cpp
>> llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp
>> llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
>> llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
>> llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
>> llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
>> llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
>> llvm/lib/DebugInfo/GSYM/GsymReader.cpp
>> llvm/lib/DebugInfo/GSYM/Header.cpp
>> llvm/lib/DebugInfo/GSYM/LineTable.cpp
>> llvm/lib/DebugInfo/MSF/MSFBuilder.cpp
>> llvm/lib/DebugInfo/PDB/Native/DbiModuleList.cpp
>> llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp
>> llvm/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp
>> llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
>> llvm/lib/DebugInfo/PDB/Native/TpiHashing.cpp
>> llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
>> llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
>> llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
>> llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
>> llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp
>> llvm/lib/ExecutionEngine/Orc/Core.cpp
>> llvm/lib/ExecutionEngine/Orc/DebugUtils.cpp
>> llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
>> llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
>> llvm/lib/ExecutionEngine/RuntimeDyld/JITSymbol.cpp
>> llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
>> llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
>> llvm/lib/IR/LLVMRemarkStreamer.cpp
>> llvm/lib/LTO/LTO.cpp
>> llvm/lib/LTO/LTOModule.cpp
>> llvm/lib/MCA/InstrBuilder.cpp
>> llvm/lib/MCA/Pipeline.cpp
>> llvm/lib/Object/Archive.cpp
>> llvm/lib/Object/ArchiveWriter.cpp
>> llvm/lib/Object/COFFModuleDefinition.cpp
>> llvm/lib/Object/COFFObjectFile.cpp
>> llvm/lib/Object/Decompressor.cpp
>> llvm/lib/Object/ELFObjectFile.cpp
>> llvm/lib/Object/IRObjectFile.cpp
>> llvm/lib/Object/IRSymtab.cpp
>> llvm/lib/Object/MachOObjectFile.cpp
>> llvm/lib/Object/MachOUniversal.cpp
>> llvm/lib/Object/ObjectFile.cpp
>> llvm/lib/Object/SymbolicFile.cpp
>> llvm/lib/Object/TapiUniversal.cpp
>> llvm/lib/Object/WasmObjectFile.cpp
>> llvm/lib/Object/WindowsResource.cpp
>> llvm/lib/Object/XCOFFObjectFile.cpp
>> llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp
>> llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
>> llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp
>> llvm/lib/ObjectYAML/DWARFEmitter.cpp
>> llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
>> llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
>> llvm/lib/ProfileData/GCOV.cpp
>> llvm/lib/ProfileData/InstrProf.cpp
>> llvm/lib/ProfileData/InstrProfReader.cpp
>> llvm/lib/ProfileData/SampleProfReader.cpp
>> llvm/lib/ProfileData/SampleProfWriter.cpp
>> llvm/lib/Remarks/BitstreamRemarkParser.cpp
>> llvm/lib/Remarks/YAMLRemarkParser.cpp
>> llvm/lib/Support/APFloat.cpp
>> llvm/lib/Support/FileCheck.cpp
>> llvm/lib/Support/JSON.cpp
>> llvm/lib/Support/MemoryBuffer.cpp
>> llvm/lib/Support/Path.cpp
>> llvm/lib/Support/YAMLTraits.cpp
>> llvm/lib/TableGen/JSONBackend.cpp
>> llvm/lib/TextAPI/ELF/TBEHandler.cpp
>> llvm/lib/TextAPI/MachO/TextStub.cpp
>> llvm/lib/Transforms/IPO/FunctionImport.cpp
>> llvm/lib/XRay/FDRRecordProducer.cpp
>> llvm/lib/XRay/FileHeaderReader.cpp
>> llvm/lib/XRay/InstrumentationMap.cpp
>> llvm/lib/XRay/Profile.cpp
>> llvm/lib/XRay/Trace.cpp
>> llvm/tools/bugpoint/ExecutionDriver.cpp
>> llvm/tools/bugpoint/ListReducer.h
>> llvm/tools/bugpoint/Miscompilation.cpp
>> llvm/tools/bugpoint/ToolRunner.cpp
>> llvm/tools/dsymutil/BinaryHolder.cpp
>> llvm/tools/dsymutil/DebugMap.cpp
>> llvm/tools/dsymutil/MachODebugMapParser.cpp
>> llvm/tools/dsymutil/dsymutil.cpp
>> llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
>> llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
>> llvm/tools/llvm-cov/SourceCoverageView.cpp
>> llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
>> llvm/tools/llvm-dwp/llvm-dwp.cpp
>> llvm/tools/llvm-elfabi/ELFObjHandler.cpp
>> llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
>> llvm/tools/llvm-exegesis/lib/Clustering.cpp
>> llvm/tools/llvm-exegesis/lib/LatencyBenchmarkRunner.cpp
>> llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp
>> llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp
>> llvm/tools/llvm-exegesis/lib/UopsBenchmarkRunner.cpp
>> llvm/tools/llvm-exegesis/lib/X86/Target.cpp
>> llvm/tools/llvm-ifs/llvm-ifs.cpp
>> llvm/tools/llvm-jitlink/llvm-jitlink.cpp
>> llvm/tools/llvm-mca/llvm-mca.cpp
>> llvm/tools/llvm-objcopy/COFF/Reader.cpp
>> llvm/tools/llvm-objcopy/CopyConfig.cpp
>> llvm/tools/llvm-objcopy/ELF/Object.cpp
>> llvm/tools/llvm-objcopy/wasm/Reader.cpp
>> llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
>> llvm/tools/llvm-pdbutil/InputFile.cpp
>> llvm/tools/llvm-rc/ResourceScriptParser.cpp
>> llvm/tools/llvm-rc/ResourceScriptToken.cpp
>> llvm/tools/llvm-readobj/ELFDumper.cpp
>> llvm/tools/obj2yaml/elf2yaml.cpp
>> llvm/tools/obj2yaml/macho2yaml.cpp
>> llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp
>> llvm/utils/TableGen/GlobalISelEmitter.cpp
>>
>> Removed:
>>
>>
>>
>> ################################################################################
>> diff --git a/llvm/include/llvm/Bitstream/BitstreamReader.h b/llvm/include/llvm/Bitstream/BitstreamReader.h
>> index c476f60420fa..fa0855fa1547 100644
>> --- a/llvm/include/llvm/Bitstream/BitstreamReader.h
>> +++ b/llvm/include/llvm/Bitstream/BitstreamReader.h
>> @@ -209,7 +209,7 @@ class SimpleBitstreamCursor {
>> unsigned BitsLeft = NumBits - BitsInCurWord;
>>
>> if (Error fillResult = fillCurWord())
>> - return std::move(fillResult);
>> + return fillResult;
>>
>> // If we run out of data, abort.
>> if (BitsLeft > BitsInCurWord)
>> @@ -425,7 +425,7 @@ class BitstreamCursor : SimpleBitstreamCursor {
>> // We read and accumulate abbrev's, the client can't do anything with
>> // them anyway.
>> if (Error Err = ReadAbbrevRecord())
>> - return std::move(Err);
>> + return Err;
>> continue;
>> }
>>
>> @@ -448,7 +448,7 @@ class BitstreamCursor : SimpleBitstreamCursor {
>>
>> // If we found a sub-block, just skip over it and check the next entry.
>> if (Error Err = SkipBlock())
>> - return std::move(Err);
>> + return Err;
>> }
>> }
>>
>>
>> diff --git a/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h b/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
>> index 784c47e3bf5d..5567214c5b7d 100644
>> --- a/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
>> +++ b/llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
>> @@ -100,14 +100,14 @@ inline Expected<CVRecord<Kind>> readCVRecordFromStream(BinaryStreamRef Stream,
>> Reader.setOffset(Offset);
>>
>> if (auto EC = Reader.readObject(Prefix))
>> - return std::move(EC);
>> + return EC;
>> if (Prefix->RecordLen < 2)
>> return make_error<CodeViewError>(cv_error_code::corrupt_record);
>>
>> Reader.setOffset(Offset);
>> ArrayRef<uint8_t> RawData;
>> if (auto EC = Reader.readBytes(RawData, Prefix->RecordLen + sizeof(uint16_t)))
>> - return std::move(EC);
>> + return EC;
>> return codeview::CVRecord<Kind>(RawData);
>> }
>>
>>
>> diff --git a/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h b/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
>> index 108abb291498..80a092e69ff6 100644
>> --- a/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
>> +++ b/llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
>> @@ -48,7 +48,7 @@ class SymbolDeserializer : public SymbolVisitorCallbacks {
>> template <typename T> static Expected<T> deserializeAs(CVSymbol Symbol) {
>> T Record(static_cast<SymbolRecordKind>(Symbol.kind()));
>> if (auto EC = deserializeAs<T>(Symbol, Record))
>> - return std::move(EC);
>> + return EC;
>> return Record;
>> }
>>
>>
>> diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h b/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
>> index 2b17f5ccb13b..6aca4911f466 100644
>> --- a/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
>> +++ b/llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
>> @@ -60,7 +60,7 @@ class TypeDeserializer : public TypeVisitorCallbacks {
>> T Record(K);
>> CVType CVT(Data);
>> if (auto EC = deserializeAs<T>(CVT, Record))
>> - return std::move(EC);
>> + return EC;
>> return Record;
>> }
>>
>>
>> diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
>> index 496fdb2477f9..8c568f455ea7 100644
>> --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
>> +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h
>> @@ -280,7 +280,7 @@ DWARFListTableBase<DWARFListType>::findList(DWARFDataExtractor Data,
>> if (Error E =
>> List.extract(Data, getHeaderOffset(), End, &Offset,
>> Header.getSectionName(), Header.getListTypeString()))
>> - return std::move(E);
>> + return E;
>> ListMap[StartingOffset] = List;
>> return List;
>> }
>>
>> diff --git a/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
>> index 65295f97e2c6..ca1f3dd81ea5 100644
>> --- a/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
>> +++ b/llvm/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h
>> @@ -233,7 +233,7 @@ class LegacyCompileOnDemandLayer {
>> if (auto Sym = BaseLayer.findSymbolIn(BLK, Name, ExportedSymbolsOnly))
>> return Sym;
>> else if (auto Err = Sym.takeError())
>> - return std::move(Err);
>> + return Err;
>> return nullptr;
>> }
>>
>> @@ -342,7 +342,7 @@ class LegacyCompileOnDemandLayer {
>> findSymbolIn(KV.first, std::string(Name), ExportedSymbolsOnly))
>> return Sym;
>> else if (auto Err = Sym.takeError())
>> - return std::move(Err);
>> + return Err;
>> }
>> return BaseLayer.findSymbol(std::string(Name), ExportedSymbolsOnly);
>> }
>> @@ -518,7 +518,7 @@ class LegacyCompileOnDemandLayer {
>> if (auto Sym = LD.findSymbol(BaseLayer, std::string(Name), false))
>> return Sym;
>> else if (auto Err = Sym.takeError())
>> - return std::move(Err);
>> + return Err;
>>
>> return nullptr;
>> };
>> @@ -611,7 +611,7 @@ class LegacyCompileOnDemandLayer {
>> } else
>> return FnBodyAddrOrErr.takeError();
>> } else if (auto Err = FnBodySym.takeError())
>> - return std::move(Err);
>> + return Err;
>> else
>> llvm_unreachable("Function not emitted for partition");
>> }
>> @@ -729,7 +729,7 @@ class LegacyCompileOnDemandLayer {
>> SetSymbolResolver(K, std::move(Resolver));
>>
>> if (auto Err = BaseLayer.addModule(std::move(K), std::move(M)))
>> - return std::move(Err);
>> + return Err;
>>
>> return K;
>> }
>>
>> diff --git a/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
>> index a9ab3a630a64..eecb31a5c241 100644
>> --- a/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
>> +++ b/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h
>> @@ -80,8 +80,8 @@ template <typename ORCABI> class LocalTrampolinePool : public TrampolinePool {
>> new LocalTrampolinePool(std::move(GetTrampolineLanding), Err));
>>
>> if (Err)
>> - return std::move(Err);
>> - return std::move(LTP);
>> + return Err;
>> + return LTP;
>> }
>>
>> /// Get a free trampoline. Returns an error if one can not be provided (e.g.
>> @@ -90,7 +90,7 @@ template <typename ORCABI> class LocalTrampolinePool : public TrampolinePool {
>> std::lock_guard<std::mutex> Lock(LTPMutex);
>> if (AvailableTrampolines.empty()) {
>> if (auto Err = grow())
>> - return std::move(Err);
>> + return Err;
>> }
>> assert(!AvailableTrampolines.empty() && "Failed to grow trampoline pool");
>> auto TrampolineAddr = AvailableTrampolines.back();
>> @@ -229,8 +229,8 @@ class LocalJITCompileCallbackManager : public JITCompileCallbackManager {
>> auto CCMgr = std::unique_ptr<LocalJITCompileCallbackManager>(
>> new LocalJITCompileCallbackManager(ES, ErrorHandlerAddress, Err));
>> if (Err)
>> - return std::move(Err);
>> - return std::move(CCMgr);
>> + return Err;
>> + return CCMgr;
>> }
>>
>> private:
>>
>> diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
>> index 3374a29f04df..93f122696a10 100644
>> --- a/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
>> +++ b/llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
>> @@ -262,13 +262,13 @@ class LLJITBuilderSetters {
>> /// Create an instance of the JIT.
>> Expected<std::unique_ptr<JITType>> create() {
>> if (auto Err = impl().prepareForConstruction())
>> - return std::move(Err);
>> + return Err;
>>
>> Error Err = Error::success();
>> std::unique_ptr<JITType> J(new JITType(impl(), Err));
>> if (Err)
>> - return std::move(Err);
>> - return std::move(J);
>> + return Err;
>> + return J;
>> }
>>
>> protected:
>>
>> diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
>> index 84f5e0350c2e..326c5982a12d 100644
>> --- a/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
>> +++ b/llvm/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
>> @@ -57,13 +57,13 @@ template <typename BaseLayerT> class LazyEmittingLayer {
>> else if (this->EmitState == NotEmitted) {
>> this->EmitState = Emitting;
>> if (auto Err = this->emitToBaseLayer(B))
>> - return std::move(Err);
>> + return Err;
>> this->EmitState = Emitted;
>> }
>> if (auto Sym = B.findSymbolIn(K, Name, ExportedSymbolsOnly))
>> return Sym.getAddress();
>> else if (auto Err = Sym.takeError())
>> - return std::move(Err);
>> + return Err;
>> else
>> llvm_unreachable("Successful symbol lookup should return "
>> "definition address here");
>>
>> diff --git a/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h b/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
>> index fd34556ff959..38eb06360e6d 100644
>> --- a/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
>> +++ b/llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
>> @@ -101,9 +101,9 @@ class LocalLazyCallThroughManager : public LazyCallThroughManager {
>> new LocalLazyCallThroughManager(ES, ErrorHandlerAddr));
>>
>> if (auto Err = LLCTM->init<ORCABI>())
>> - return std::move(Err);
>> + return Err;
>>
>> - return std::move(LLCTM);
>> + return LLCTM;
>> }
>> };
>>
>>
>> diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Legacy.h b/llvm/include/llvm/ExecutionEngine/Orc/Legacy.h
>> index 148e260c9569..29d257ff1bd6 100644
>> --- a/llvm/include/llvm/ExecutionEngine/Orc/Legacy.h
>> +++ b/llvm/include/llvm/ExecutionEngine/Orc/Legacy.h
>> @@ -123,7 +123,7 @@ getResponsibilitySetWithLegacyFn(const SymbolNameSet &Symbols,
>> if (!Sym.getFlags().isStrong())
>> Result.insert(S);
>> } else if (auto Err = Sym.takeError())
>> - return std::move(Err);
>> + return Err;
>> }
>>
>> return Result;
>>
>> diff --git a/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h b/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
>> index 86e8d5df3ad9..1c5394677e81 100644
>> --- a/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
>> +++ b/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h
>> @@ -457,7 +457,7 @@ class OrcRemoteTargetClient
>> std::lock_guard<std::mutex> Lock(RTPMutex);
>> if (AvailableTrampolines.empty()) {
>> if (auto Err = grow())
>> - return std::move(Err);
>> + return Err;
>> }
>> assert(!AvailableTrampolines.empty() && "Failed to grow trampoline pool");
>> auto TrampolineAddr = AvailableTrampolines.back();
>> @@ -506,8 +506,8 @@ class OrcRemoteTargetClient
>> auto Client = std::unique_ptr<OrcRemoteTargetClient>(
>> new OrcRemoteTargetClient(Channel, ES, Err));
>> if (Err)
>> - return std::move(Err);
>> - return std::move(Client);
>> + return Err;
>> + return Client;
>> }
>>
>> /// Call the int(void) function at the given address in the target and return
>> @@ -541,7 +541,7 @@ class OrcRemoteTargetClient
>> createRemoteMemoryManager() {
>> auto Id = AllocatorIds.getNext();
>> if (auto Err = callB<mem::CreateRemoteAllocator>(Id))
>> - return std::move(Err);
>> + return Err;
>> return std::unique_ptr<RemoteRTDyldMemoryManager>(
>> new RemoteRTDyldMemoryManager(*this, Id));
>> }
>> @@ -552,7 +552,7 @@ class OrcRemoteTargetClient
>> createIndirectStubsManager() {
>> auto Id = IndirectStubOwnerIds.getNext();
>> if (auto Err = callB<stubs::CreateIndirectStubsOwner>(Id))
>> - return std::move(Err);
>> + return Err;
>> return std::make_unique<RemoteIndirectStubsManager>(*this, Id);
>> }
>>
>> @@ -562,7 +562,7 @@ class OrcRemoteTargetClient
>>
>> // Emit the resolver block on the JIT server.
>> if (auto Err = callB<stubs::EmitResolverBlock>())
>> - return std::move(Err);
>> + return Err;
>>
>> // Create the callback manager.
>> CallbackManager.emplace(*this, ES, ErrorHandlerAddress);
>>
>> diff --git a/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h b/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h
>> index 4c8e2ea1a7be..7faf08054aec 100644
>> --- a/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h
>> +++ b/llvm/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h
>> @@ -265,7 +265,7 @@ class OrcRemoteTargetServer
>> typename TargetT::IndirectStubsInfo IS;
>> if (auto Err =
>> TargetT::emitIndirectStubsBlock(IS, NumStubsRequired, nullptr))
>> - return std::move(Err);
>> + return Err;
>>
>> JITTargetAddress StubsBase = static_cast<JITTargetAddress>(
>> reinterpret_cast<uintptr_t>(IS.getStub(0)));
>> @@ -382,7 +382,7 @@ class OrcRemoteTargetServer
>> auto &Allocator = I->second;
>> void *LocalAllocAddr = nullptr;
>> if (auto Err = Allocator.allocate(LocalAllocAddr, Size, Align))
>> - return std::move(Err);
>> + return Err;
>>
>> LLVM_DEBUG(dbgs() << " Allocator " << Id << " reserved " << LocalAllocAddr
>> << " (" << Size << " bytes, alignment " << Align
>>
>> diff --git a/llvm/include/llvm/ExecutionEngine/Orc/RPC/RPCUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/RPC/RPCUtils.h
>> index ed09363dcecc..6cf5612af8dc 100644
>> --- a/llvm/include/llvm/ExecutionEngine/Orc/RPC/RPCUtils.h
>> +++ b/llvm/include/llvm/ExecutionEngine/Orc/RPC/RPCUtils.h
>> @@ -1528,20 +1528,20 @@ class SingleThreadedRPCEndpoint
>> Args...)) {
>> detail::ResultTraits<typename Func::ReturnType>::consumeAbandoned(
>> std::move(Result));
>> - return std::move(Err);
>> + return Err;
>> }
>>
>> if (auto Err = this->C.send()) {
>> detail::ResultTraits<typename Func::ReturnType>::consumeAbandoned(
>> std::move(Result));
>> - return std::move(Err);
>> + return Err;
>> }
>>
>> while (!ReceivedResponse) {
>> if (auto Err = this->handleOne()) {
>> detail::ResultTraits<typename Func::ReturnType>::consumeAbandoned(
>> std::move(Result));
>> - return std::move(Err);
>> + return Err;
>> }
>> }
>>
>>
>> diff --git a/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h b/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
>> index 435c882d506d..74342931dd9d 100644
>> --- a/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
>> +++ b/llvm/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
>> @@ -276,7 +276,7 @@ class LegacyRTDyldObjectLinkingLayer : public LegacyRTDyldObjectLinkingLayerBase
>> // and its execution, so we need to double check.
>> if (!this->Finalized)
>> if (auto Err = this->finalize())
>> - return std::move(Err);
>> + return Err;
>> return this->getSymbol(Name, false).getAddress();
>> };
>> }
>> @@ -430,7 +430,7 @@ class LegacyRTDyldObjectLinkingLayer : public LegacyRTDyldObjectLinkingLayerBase
>> if (auto Sym = KV.second->getSymbol(Name, ExportedSymbolsOnly))
>> return Sym;
>> else if (auto Err = Sym.takeError())
>> - return std::move(Err);
>> + return Err;
>>
>> return nullptr;
>> }
>>
>> diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h
>> index 42c5b67ac3fa..28dd77ebd7fa 100644
>> --- a/llvm/include/llvm/Object/ELF.h
>> +++ b/llvm/include/llvm/Object/ELF.h
>> @@ -601,7 +601,7 @@ ELFFile<ELFT>::getStringTable(const Elf_Shdr *Section,
>> ": expected SHT_STRTAB, but got " +
>> object::getELFSectionTypeName(
>> getHeader()->e_machine, Section->sh_type)))
>> - return std::move(E);
>> + return E;
>>
>> auto V = getSectionContentsAsArray<char>(Section);
>> if (!V)
>>
>> diff --git a/llvm/include/llvm/Object/ELFObjectFile.h b/llvm/include/llvm/Object/ELFObjectFile.h
>> index 8a68e49477fd..ca99dcf6188a 100644
>> --- a/llvm/include/llvm/Object/ELFObjectFile.h
>> +++ b/llvm/include/llvm/Object/ELFObjectFile.h
>> @@ -948,7 +948,7 @@ Expected<ELFObjectFile<ELFT>>
>> ELFObjectFile<ELFT>::create(MemoryBufferRef Object) {
>> auto EFOrErr = ELFFile<ELFT>::create(Object.getBuffer());
>> if (Error E = EFOrErr.takeError())
>> - return std::move(E);
>> + return E;
>> auto EF = std::move(*EFOrErr);
>>
>> auto SectionsOrErr = EF.sections();
>>
>> diff --git a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
>> index 57a2aaefd660..b7584ea1570e 100644
>> --- a/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
>> +++ b/llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
>> @@ -77,7 +77,7 @@ class CoverageMappingIterator
>> if (ReadErr != coveragemap_error::success) {
>> auto E = make_error<CoverageMapError>(ReadErr);
>> ReadErr = coveragemap_error::success;
>> - return std::move(E);
>> + return E;
>> }
>> return Record;
>> }
>> @@ -85,7 +85,7 @@ class CoverageMappingIterator
>> if (ReadErr != coveragemap_error::success) {
>> auto E = make_error<CoverageMapError>(ReadErr);
>> ReadErr = coveragemap_error::success;
>> - return std::move(E);
>> + return E;
>> }
>> return &Record;
>> }
>>
>> diff --git a/llvm/include/llvm/Support/Error.h b/llvm/include/llvm/Support/Error.h
>> index 44676338808b..61bf9efa90f1 100644
>> --- a/llvm/include/llvm/Support/Error.h
>> +++ b/llvm/include/llvm/Support/Error.h
>> @@ -963,7 +963,7 @@ Expected<T> handleExpected(Expected<T> ValOrErr, RecoveryFtor &&RecoveryPath,
>>
>> if (auto Err = handleErrors(ValOrErr.takeError(),
>> std::forward<HandlerTs>(Handlers)...))
>> - return std::move(Err);
>> + return Err;
>>
>> return RecoveryPath();
>> }
>>
>> diff --git a/llvm/include/llvm/Support/TaskQueue.h b/llvm/include/llvm/Support/TaskQueue.h
>> index df2ffdee2cc2..740400aa44fa 100644
>> --- a/llvm/include/llvm/Support/TaskQueue.h
>> +++ b/llvm/include/llvm/Support/TaskQueue.h
>> @@ -98,7 +98,7 @@ class TaskQueue {
>> IsTaskInFlight = true;
>> }
>> }
>> - return std::move(F);
>> + return F;
>> }
>>
>> private:
>>
>> diff --git a/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp b/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp
>> index e70caa83c8c1..0bf62f2c64af 100644
>> --- a/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp
>> +++ b/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp
>> @@ -415,41 +415,41 @@ static Expected<CurStreamTypeType> ReadSignature(BitstreamCursor &Stream) {
>>
>> char Signature[6];
>> if (Error Err = tryRead(Signature[0], 8))
>> - return std::move(Err);
>> + return Err;
>> if (Error Err = tryRead(Signature[1], 8))
>> - return std::move(Err);
>> + return Err;
>>
>> // Autodetect the file contents, if it is one we know.
>> if (Signature[0] == 'C' && Signature[1] == 'P') {
>> if (Error Err = tryRead(Signature[2], 8))
>> - return std::move(Err);
>> + return Err;
>> if (Error Err = tryRead(Signature[3], 8))
>> - return std::move(Err);
>> + return Err;
>> if (Signature[2] == 'C' && Signature[3] == 'H')
>> return ClangSerializedASTBitstream;
>> } else if (Signature[0] == 'D' && Signature[1] == 'I') {
>> if (Error Err = tryRead(Signature[2], 8))
>> - return std::move(Err);
>> + return Err;
>> if (Error Err = tryRead(Signature[3], 8))
>> - return std::move(Err);
>> + return Err;
>> if (Signature[2] == 'A' && Signature[3] == 'G')
>> return ClangSerializedDiagnosticsBitstream;
>> } else if (Signature[0] == 'R' && Signature[1] == 'M') {
>> if (Error Err = tryRead(Signature[2], 8))
>> - return std::move(Err);
>> + return Err;
>> if (Error Err = tryRead(Signature[3], 8))
>> - return std::move(Err);
>> + return Err;
>> if (Signature[2] == 'R' && Signature[3] == 'K')
>> return LLVMBitstreamRemarks;
>> } else {
>> if (Error Err = tryRead(Signature[2], 4))
>> - return std::move(Err);
>> + return Err;
>> if (Error Err = tryRead(Signature[3], 4))
>> - return std::move(Err);
>> + return Err;
>> if (Error Err = tryRead(Signature[4], 4))
>> - return std::move(Err);
>> + return Err;
>> if (Error Err = tryRead(Signature[5], 4))
>> - return std::move(Err);
>> + return Err;
>> if (Signature[0] == 'B' && Signature[1] == 'C' && Signature[2] == 0x0 &&
>> Signature[3] == 0xC && Signature[4] == 0xE && Signature[5] == 0xD)
>> return LLVMIRBitstream;
>>
>> diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
>> index b5476065c36e..83e72f7a80c0 100644
>> --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
>> +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
>> @@ -141,9 +141,9 @@ static Expected<BitstreamCursor> initStream(MemoryBufferRef Buffer) {
>>
>> BitstreamCursor Stream(ArrayRef<uint8_t>(BufPtr, BufEnd));
>> if (Error Err = hasInvalidBitcodeHeader(Stream))
>> - return std::move(Err);
>> + return Err;
>>
>> - return std::move(Stream);
>> + return Stream;
>> }
>>
>> /// Convert a string from a record into an std::string, return true on failure.
>> @@ -172,7 +172,7 @@ static void stripTBAA(Module *M) {
>> /// "epoch" encoded in the bitcode, and return the producer name if any.
>> static Expected<std::string> readIdentificationBlock(BitstreamCursor &Stream) {
>> if (Error Err = Stream.EnterSubBlock(bitc::IDENTIFICATION_BLOCK_ID))
>> - return std::move(Err);
>> + return Err;
>>
>> // Read all the records.
>> SmallVector<uint64_t, 64> Record;
>> @@ -244,7 +244,7 @@ static Expected<std::string> readIdentificationCode(BitstreamCursor &Stream) {
>>
>> // Ignore other sub-blocks.
>> if (Error Err = Stream.SkipBlock())
>> - return std::move(Err);
>> + return Err;
>> continue;
>> case BitstreamEntry::Record:
>> if (Expected<unsigned> Skipped = Stream.skipRecord(Entry.ID))
>> @@ -257,7 +257,7 @@ static Expected<std::string> readIdentificationCode(BitstreamCursor &Stream) {
>>
>> static Expected<bool> hasObjCCategoryInModule(BitstreamCursor &Stream) {
>> if (Error Err = Stream.EnterSubBlock(bitc::MODULE_BLOCK_ID))
>> - return std::move(Err);
>> + return Err;
>>
>> SmallVector<uint64_t, 64> Record;
>> // Read all the records for this module.
>> @@ -324,7 +324,7 @@ static Expected<bool> hasObjCCategory(BitstreamCursor &Stream) {
>>
>> // Ignore other sub-blocks.
>> if (Error Err = Stream.SkipBlock())
>> - return std::move(Err);
>> + return Err;
>> continue;
>>
>> case BitstreamEntry::Record:
>> @@ -338,7 +338,7 @@ static Expected<bool> hasObjCCategory(BitstreamCursor &Stream) {
>>
>> static Expected<std::string> readModuleTriple(BitstreamCursor &Stream) {
>> if (Error Err = Stream.EnterSubBlock(bitc::MODULE_BLOCK_ID))
>> - return std::move(Err);
>> + return Err;
>>
>> SmallVector<uint64_t, 64> Record;
>>
>> @@ -402,7 +402,7 @@ static Expected<std::string> readTriple(BitstreamCursor &Stream) {
>>
>> // Ignore other sub-blocks.
>> if (Error Err = Stream.SkipBlock())
>> - return std::move(Err);
>> + return Err;
>> continue;
>>
>> case BitstreamEntry::Record:
>> @@ -2044,7 +2044,7 @@ static Expected<uint64_t> jumpToValueSymbolTable(uint64_t Offset,
>> // of the VST read.
>> uint64_t CurrentBit = Stream.GetCurrentBitNo();
>> if (Error JumpFailed = Stream.JumpToBit(Offset * 32))
>> - return std::move(JumpFailed);
>> + return JumpFailed;
>> Expected<BitstreamEntry> MaybeEntry = Stream.advance();
>> if (!MaybeEntry)
>> return MaybeEntry.takeError();
>> @@ -6293,7 +6293,7 @@ const std::error_category &llvm::BitcodeErrorCategory() {
>> static Expected<StringRef> readBlobInRecord(BitstreamCursor &Stream,
>> unsigned Block, unsigned RecordID) {
>> if (Error Err = Stream.EnterSubBlock(Block))
>> - return std::move(Err);
>> + return Err;
>>
>> StringRef Strtab;
>> while (true) {
>> @@ -6311,7 +6311,7 @@ static Expected<StringRef> readBlobInRecord(BitstreamCursor &Stream,
>>
>> case BitstreamEntry::SubBlock:
>> if (Error Err = Stream.SkipBlock())
>> - return std::move(Err);
>> + return Err;
>> break;
>>
>> case BitstreamEntry::Record:
>> @@ -6372,7 +6372,7 @@ llvm::getBitcodeFileContents(MemoryBufferRef Buffer) {
>> if (Entry.ID == bitc::IDENTIFICATION_BLOCK_ID) {
>> IdentificationBit = Stream.GetCurrentBitNo() - BCBegin * 8;
>> if (Error Err = Stream.SkipBlock())
>> - return std::move(Err);
>> + return Err;
>>
>> {
>> Expected<llvm::BitstreamEntry> MaybeEntry = Stream.advance();
>> @@ -6389,7 +6389,7 @@ llvm::getBitcodeFileContents(MemoryBufferRef Buffer) {
>> if (Entry.ID == bitc::MODULE_BLOCK_ID) {
>> uint64_t ModuleBit = Stream.GetCurrentBitNo() - BCBegin * 8;
>> if (Error Err = Stream.SkipBlock())
>> - return std::move(Err);
>> + return Err;
>>
>> F.Mods.push_back({Stream.getBitcodeBytes().slice(
>> BCBegin, Stream.getCurrentByteNo() - BCBegin),
>> @@ -6438,7 +6438,7 @@ llvm::getBitcodeFileContents(MemoryBufferRef Buffer) {
>> }
>>
>> if (Error Err = Stream.SkipBlock())
>> - return std::move(Err);
>> + return Err;
>> continue;
>> }
>> case BitstreamEntry::Record:
>> @@ -6466,7 +6466,7 @@ BitcodeModule::getModuleImpl(LLVMContext &Context, bool MaterializeAll,
>> std::string ProducerIdentification;
>> if (IdentificationBit != -1ull) {
>> if (Error JumpFailed = Stream.JumpToBit(IdentificationBit))
>> - return std::move(JumpFailed);
>> + return JumpFailed;
>> Expected<std::string> ProducerIdentificationOrErr =
>> readIdentificationBlock(Stream);
>> if (!ProducerIdentificationOrErr)
>> @@ -6476,7 +6476,7 @@ BitcodeModule::getModuleImpl(LLVMContext &Context, bool MaterializeAll,
>> }
>>
>> if (Error JumpFailed = Stream.JumpToBit(ModuleBit))
>> - return std::move(JumpFailed);
>> + return JumpFailed;
>> auto *R = new BitcodeReader(std::move(Stream), Strtab, ProducerIdentification,
>> Context);
>>
>> @@ -6487,18 +6487,18 @@ BitcodeModule::getModuleImpl(LLVMContext &Context, bool MaterializeAll,
>> // Delay parsing Metadata if ShouldLazyLoadMetadata is true.
>> if (Error Err =
>> R->parseBitcodeInto(M.get(), ShouldLazyLoadMetadata, IsImporting))
>> - return std::move(Err);
>> + return Err;
>>
>> if (MaterializeAll) {
>> // Read in the entire module, and destroy the BitcodeReader.
>> if (Error Err = M->materializeAll())
>> - return std::move(Err);
>> + return Err;
>> } else {
>> // Resolve forward references from blockaddresses.
>> if (Error Err = R->materializeForwardReferencedFunctions())
>> - return std::move(Err);
>> + return Err;
>> }
>> - return std::move(M);
>> + return M;
>> }
>>
>> Expected<std::unique_ptr<Module>>
>> @@ -6526,22 +6526,22 @@ Error BitcodeModule::readSummary(ModuleSummaryIndex &CombinedIndex,
>> Expected<std::unique_ptr<ModuleSummaryIndex>> BitcodeModule::getSummary() {
>> BitstreamCursor Stream(Buffer);
>> if (Error JumpFailed = Stream.JumpToBit(ModuleBit))
>> - return std::move(JumpFailed);
>> + return JumpFailed;
>>
>> auto Index = std::make_unique<ModuleSummaryIndex>(/*HaveGVs=*/false);
>> ModuleSummaryIndexBitcodeReader R(std::move(Stream), Strtab, *Index,
>> ModuleIdentifier, 0);
>>
>> if (Error Err = R.parseModule())
>> - return std::move(Err);
>> + return Err;
>>
>> - return std::move(Index);
>> + return Index;
>> }
>>
>> static Expected<bool> getEnableSplitLTOUnitFlag(BitstreamCursor &Stream,
>> unsigned ID) {
>> if (Error Err = Stream.EnterSubBlock(ID))
>> - return std::move(Err);
>> + return Err;
>> SmallVector<uint64_t, 64> Record;
>>
>> while (true) {
>> @@ -6587,10 +6587,10 @@ static Expected<bool> getEnableSplitLTOUnitFlag(BitstreamCursor &Stream,
>> Expected<BitcodeLTOInfo> BitcodeModule::getLTOInfo() {
>> BitstreamCursor Stream(Buffer);
>> if (Error JumpFailed = Stream.JumpToBit(ModuleBit))
>> - return std::move(JumpFailed);
>> + return JumpFailed;
>>
>> if (Error Err = Stream.EnterSubBlock(bitc::MODULE_BLOCK_ID))
>> - return std::move(Err);
>> + return Err;
>>
>> while (true) {
>> Expected<llvm::BitstreamEntry> MaybeEntry = Stream.advance();
>> @@ -6626,7 +6626,7 @@ Expected<BitcodeLTOInfo> BitcodeModule::getLTOInfo() {
>>
>> // Ignore other sub-blocks.
>> if (Error Err = Stream.SkipBlock())
>> - return std::move(Err);
>> + return Err;
>> continue;
>>
>> case BitstreamEntry::Record:
>>
>> diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
>> index 3cff468dca89..06b8415dc9dc 100644
>> --- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
>> +++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
>> @@ -711,7 +711,7 @@ MetadataLoader::MetadataLoaderImpl::lazyLoadModuleMetadataBlock() {
>> case bitc::METADATA_STRINGS: {
>> // Rewind and parse the strings.
>> if (Error Err = IndexCursor.JumpToBit(CurrentPos))
>> - return std::move(Err);
>> + return Err;
>> StringRef Blob;
>> Record.clear();
>> if (Expected<unsigned> MaybeRecord =
>> @@ -725,14 +725,14 @@ MetadataLoader::MetadataLoaderImpl::lazyLoadModuleMetadataBlock() {
>> MDStringRef.push_back(Str);
>> };
>> if (auto Err = parseMetadataStrings(Record, Blob, IndexNextMDString))
>> - return std::move(Err);
>> + return Err;
>> break;
>> }
>> case bitc::METADATA_INDEX_OFFSET: {
>> // This is the offset to the index, when we see this we skip all the
>> // records and load only an index to these.
>> if (Error Err = IndexCursor.JumpToBit(CurrentPos))
>> - return std::move(Err);
>> + return Err;
>> Record.clear();
>> if (Expected<unsigned> MaybeRecord =
>> IndexCursor.readRecord(Entry.ID, Record))
>> @@ -744,7 +744,7 @@ MetadataLoader::MetadataLoaderImpl::lazyLoadModuleMetadataBlock() {
>> auto Offset = Record[0] + (Record[1] << 32);
>> auto BeginPos = IndexCursor.GetCurrentBitNo();
>> if (Error Err = IndexCursor.JumpToBit(BeginPos + Offset))
>> - return std::move(Err);
>> + return Err;
>> Expected<BitstreamEntry> MaybeEntry =
>> IndexCursor.advanceSkippingSubblocks(
>> BitstreamCursor::AF_DontPopBlockAtEnd);
>> @@ -778,7 +778,7 @@ MetadataLoader::MetadataLoaderImpl::lazyLoadModuleMetadataBlock() {
>> case bitc::METADATA_NAME: {
>> // Named metadata need to be materialized now and aren't deferred.
>> if (Error Err = IndexCursor.JumpToBit(CurrentPos))
>> - return std::move(Err);
>> + return Err;
>> Record.clear();
>>
>> unsigned Code;
>> @@ -823,7 +823,7 @@ MetadataLoader::MetadataLoaderImpl::lazyLoadModuleMetadataBlock() {
>> // FIXME: we need to do this early because we don't materialize global
>> // value explicitly.
>> if (Error Err = IndexCursor.JumpToBit(CurrentPos))
>> - return std::move(Err);
>> + return Err;
>> Record.clear();
>> if (Expected<unsigned> MaybeRecord =
>> IndexCursor.readRecord(Entry.ID, Record))
>> @@ -838,7 +838,7 @@ MetadataLoader::MetadataLoaderImpl::lazyLoadModuleMetadataBlock() {
>> if (auto *GO = dyn_cast<GlobalObject>(ValueList[ValueID]))
>> if (Error Err = parseGlobalObjectAttachment(
>> *GO, ArrayRef<uint64_t>(Record).slice(1)))
>> - return std::move(Err);
>> + return Err;
>> break;
>> }
>> case bitc::METADATA_KIND:
>>
>> diff --git a/llvm/lib/Bitstream/Reader/BitstreamReader.cpp b/llvm/lib/Bitstream/Reader/BitstreamReader.cpp
>> index 92d7c91a1d35..c6aeaefdcd37 100644
>> --- a/llvm/lib/Bitstream/Reader/BitstreamReader.cpp
>> +++ b/llvm/lib/Bitstream/Reader/BitstreamReader.cpp
>> @@ -158,7 +158,7 @@ Expected<unsigned> BitstreamCursor::skipRecord(unsigned AbbrevID) {
>> assert((unsigned)EltEnc.getEncodingData() <= MaxChunkSize);
>> if (Error Err = JumpToBit(GetCurrentBitNo() +
>> NumElts * EltEnc.getEncodingData()))
>> - return std::move(Err);
>> + return Err;
>> break;
>> case BitCodeAbbrevOp::VBR:
>> assert((unsigned)EltEnc.getEncodingData() <= MaxChunkSize);
>> @@ -171,7 +171,7 @@ Expected<unsigned> BitstreamCursor::skipRecord(unsigned AbbrevID) {
>> break;
>> case BitCodeAbbrevOp::Char6:
>> if (Error Err = JumpToBit(GetCurrentBitNo() + NumElts * 6))
>> - return std::move(Err);
>> + return Err;
>> break;
>> }
>> continue;
>> @@ -197,7 +197,7 @@ Expected<unsigned> BitstreamCursor::skipRecord(unsigned AbbrevID) {
>>
>> // Skip over the blob.
>> if (Error Err = JumpToBit(NewEnd))
>> - return std::move(Err);
>> + return Err;
>> }
>> return Code;
>> }
>> @@ -326,7 +326,7 @@ Expected<unsigned> BitstreamCursor::readRecord(unsigned AbbrevID,
>> // over tail padding first, in case jumping to NewEnd invalidates the Blob
>> // pointer.
>> if (Error Err = JumpToBit(NewEnd))
>> - return std::move(Err);
>> + return Err;
>> const char *Ptr = (const char *)getPointerToBit(CurBitPos, NumElts);
>>
>> // If we can return a reference to the data, do so to avoid copying it.
>> @@ -401,7 +401,7 @@ Error BitstreamCursor::ReadAbbrevRecord() {
>> Expected<Optional<BitstreamBlockInfo>>
>> BitstreamCursor::ReadBlockInfoBlock(bool ReadBlockInfoNames) {
>> if (llvm::Error Err = EnterSubBlock(bitc::BLOCKINFO_BLOCK_ID))
>> - return std::move(Err);
>> + return Err;
>>
>> BitstreamBlockInfo NewBlockInfo;
>>
>> @@ -421,7 +421,7 @@ BitstreamCursor::ReadBlockInfoBlock(bool ReadBlockInfoNames) {
>> case llvm::BitstreamEntry::Error:
>> return None;
>> case llvm::BitstreamEntry::EndBlock:
>> - return std::move(NewBlockInfo);
>> + return NewBlockInfo;
>> case llvm::BitstreamEntry::Record:
>> // The interesting case.
>> break;
>> @@ -431,7 +431,7 @@ BitstreamCursor::ReadBlockInfoBlock(bool ReadBlockInfoNames) {
>> if (Entry.ID == bitc::DEFINE_ABBREV) {
>> if (!CurBlockInfo) return None;
>> if (Error Err = ReadAbbrevRecord())
>> - return std::move(Err);
>> + return Err;
>>
>> // ReadAbbrevRecord installs the abbrev in CurAbbrevs. Move it to the
>> // appropriate BlockInfo.
>>
>> diff --git a/llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp b/llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp
>> index 63342749918d..4ad0bb566bc3 100644
>> --- a/llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp
>> +++ b/llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp
>> @@ -37,7 +37,7 @@ DebugStringTableSubsectionRef::getString(uint32_t Offset) const {
>> Reader.setOffset(Offset);
>> StringRef Result;
>> if (auto EC = Reader.readCString(Result))
>> - return std::move(EC);
>> + return EC;
>> return Result;
>> }
>>
>>
>> diff --git a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
>> index bfcd0960faec..df19b364f321 100644
>> --- a/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
>> +++ b/llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp
>> @@ -481,7 +481,7 @@ DWARFDebugNames::NameIndex::extractAttributeEncodings(uint64_t *Offset) {
>> if (!AttrEncOr)
>> return AttrEncOr.takeError();
>> if (isSentinel(*AttrEncOr))
>> - return std::move(Result);
>> + return Result;
>>
>> Result.emplace_back(*AttrEncOr);
>> }
>> @@ -649,7 +649,7 @@ DWARFDebugNames::NameIndex::getEntry(uint64_t *Offset) const {
>> return createStringError(errc::io_error,
>> "Error extracting index attribute values.");
>> }
>> - return std::move(E);
>> + return E;
>> }
>>
>> DWARFDebugNames::NameTableEntry
>>
>> diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
>> index 2b047a437df2..b0f51f8aa912 100644
>> --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
>> +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
>> @@ -522,7 +522,7 @@ Expected<const DWARFDebugLine::LineTable *> DWARFDebugLine::getOrParseLineTable(
>> if (Pos.second) {
>> if (Error Err =
>> LT->parse(DebugLineData, &Offset, Ctx, U, RecoverableErrorCallback))
>> - return std::move(Err);
>> + return Err;
>> return LT;
>> }
>> return LT;
>>
>> diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
>> index 7bb019466161..bde45cbcf10f 100644
>> --- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
>> +++ b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
>> @@ -349,7 +349,7 @@ parseListTableHeader(DWARFDataExtractor &DA, uint64_t Offset,
>> }
>> ListTableType Table;
>> if (Error E = Table.extractHeaderAndOffsets(DA, &Offset))
>> - return std::move(E);
>> + return E;
>> return Table;
>> }
>>
>> @@ -621,7 +621,7 @@ DWARFUnit::findRnglistFromOffset(uint64_t Offset) {
>> if (getVersion() <= 4) {
>> DWARFDebugRangeList RangeList;
>> if (Error E = extractRangeList(Offset, RangeList))
>> - return std::move(E);
>> + return E;
>> return RangeList.getAbsoluteRanges(getBaseAddress());
>> }
>> if (RngListTable) {
>>
>> diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
>> index 68bacbfda467..eaebc3d62a4c 100644
>> --- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
>> +++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
>> @@ -34,11 +34,11 @@ DWARFVerifier::DieRangeInfo::insert(const DWARFAddressRange &R) {
>>
>> if (Pos != End) {
>> if (Pos->intersects(R))
>> - return std::move(Pos);
>> + return Pos;
>> if (Pos != Begin) {
>> auto Iter = Pos - 1;
>> if (Iter->intersects(R))
>> - return std::move(Iter);
>> + return Iter;
>> }
>> }
>>
>>
>> diff --git a/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp b/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
>> index 6731a8b27443..373161d3bd00 100644
>> --- a/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
>> +++ b/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
>> @@ -90,7 +90,7 @@ llvm::Expected<FunctionInfo> FunctionInfo::decode(DataExtractor &Data,
>> }
>> Offset += InfoLength;
>> }
>> - return std::move(FI);
>> + return FI;
>> }
>>
>> llvm::Expected<uint64_t> FunctionInfo::encode(FileWriter &O) const {
>> @@ -114,7 +114,7 @@ llvm::Expected<uint64_t> FunctionInfo::encode(FileWriter &O) const {
>> const auto StartOffset = O.tell();
>> llvm::Error err = OptLineTable->encode(O, Range.Start);
>> if (err)
>> - return std::move(err);
>> + return err;
>> const auto Length = O.tell() - StartOffset;
>> if (Length > UINT32_MAX)
>> return createStringError(std::errc::invalid_argument,
>> @@ -132,7 +132,7 @@ llvm::Expected<uint64_t> FunctionInfo::encode(FileWriter &O) const {
>> const auto StartOffset = O.tell();
>> llvm::Error err = Inline->encode(O, Range.Start);
>> if (err)
>> - return std::move(err);
>> + return err;
>> const auto Length = O.tell() - StartOffset;
>> if (Length > UINT32_MAX)
>> return createStringError(std::errc::invalid_argument,
>> @@ -244,6 +244,6 @@ llvm::Expected<LookupResult> FunctionInfo::lookup(DataExtractor &Data,
>> llvm::Error Err = InlineInfo::lookup(GR, *InlineInfoData, FuncAddr, Addr,
>> LR.Locations);
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>> return LR;
>> }
>>
>> diff --git a/llvm/lib/DebugInfo/GSYM/GsymReader.cpp b/llvm/lib/DebugInfo/GSYM/GsymReader.cpp
>> index b4f3f2052ae7..c05d6bce4f68 100644
>> --- a/llvm/lib/DebugInfo/GSYM/GsymReader.cpp
>> +++ b/llvm/lib/DebugInfo/GSYM/GsymReader.cpp
>> @@ -54,8 +54,8 @@ GsymReader::create(std::unique_ptr<MemoryBuffer> &MemBuffer) {
>> GsymReader GR(std::move(MemBuffer));
>> llvm::Error Err = GR.parse();
>> if (Err)
>> - return std::move(Err);
>> - return std::move(GR);
>> + return Err;
>> + return GR;
>> }
>>
>> llvm::Error
>>
>> diff --git a/llvm/lib/DebugInfo/GSYM/Header.cpp b/llvm/lib/DebugInfo/GSYM/Header.cpp
>> index 0b3fb9c49894..85d8fbe9cf68 100644
>> --- a/llvm/lib/DebugInfo/GSYM/Header.cpp
>> +++ b/llvm/lib/DebugInfo/GSYM/Header.cpp
>> @@ -78,7 +78,7 @@ llvm::Expected<Header> Header::decode(DataExtractor &Data) {
>> H.StrtabSize = Data.getU32(&Offset);
>> Data.getU8(&Offset, H.UUID, GSYM_MAX_UUID_SIZE);
>> if (llvm::Error Err = H.checkForError())
>> - return std::move(Err);
>> + return Err;
>> return H;
>> }
>>
>>
>> diff --git a/llvm/lib/DebugInfo/GSYM/LineTable.cpp b/llvm/lib/DebugInfo/GSYM/LineTable.cpp
>> index a49a3ba9bf2a..4e1d75b26b88 100644
>> --- a/llvm/lib/DebugInfo/GSYM/LineTable.cpp
>> +++ b/llvm/lib/DebugInfo/GSYM/LineTable.cpp
>> @@ -256,7 +256,7 @@ llvm::Expected<LineTable> LineTable::decode(DataExtractor &Data,
>> return true; // Keep parsing by returning true.
>> });
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>> return LT;
>> }
>> // Parse the line table on the fly and find the row we are looking for.
>> @@ -278,7 +278,7 @@ Expected<LineEntry> LineTable::lookup(DataExtractor &Data, uint64_t BaseAddr, ui
>> return true; // Keep parsing till we find the right row.
>> });
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>> if (Result.isValid())
>> return Result;
>> return createStringError(std::errc::invalid_argument,
>>
>> diff --git a/llvm/lib/DebugInfo/MSF/MSFBuilder.cpp b/llvm/lib/DebugInfo/MSF/MSFBuilder.cpp
>> index c6fe764ab7e0..d27cecc78c0d 100644
>> --- a/llvm/lib/DebugInfo/MSF/MSFBuilder.cpp
>> +++ b/llvm/lib/DebugInfo/MSF/MSFBuilder.cpp
>> @@ -183,7 +183,7 @@ Expected<uint32_t> MSFBuilder::addStream(uint32_t Size) {
>> std::vector<uint32_t> NewBlocks;
>> NewBlocks.resize(ReqBlocks);
>> if (auto EC = allocateBlocks(ReqBlocks, NewBlocks))
>> - return std::move(EC);
>> + return EC;
>> StreamData.push_back(std::make_pair(Size, NewBlocks));
>> return StreamData.size() - 1;
>> }
>> @@ -267,7 +267,7 @@ Expected<MSFLayout> MSFBuilder::generateLayout() {
>> uint32_t NumExtraBlocks = NumDirectoryBlocks - DirectoryBlocks.size();
>> ExtraBlocks.resize(NumExtraBlocks);
>> if (auto EC = allocateBlocks(NumExtraBlocks, ExtraBlocks))
>> - return std::move(EC);
>> + return EC;
>> DirectoryBlocks.insert(DirectoryBlocks.end(), ExtraBlocks.begin(),
>> ExtraBlocks.end());
>> } else if (NumDirectoryBlocks < DirectoryBlocks.size()) {
>> @@ -346,14 +346,14 @@ Expected<FileBufferByteStream> MSFBuilder::commit(StringRef Path,
>> uint64_t FileSize = Layout.SB->BlockSize * Layout.SB->NumBlocks;
>> auto OutFileOrError = FileOutputBuffer::create(Path, FileSize);
>> if (auto EC = OutFileOrError.takeError())
>> - return std::move(EC);
>> + return EC;
>>
>> FileBufferByteStream Buffer(std::move(*OutFileOrError),
>> llvm::support::little);
>> BinaryStreamWriter Writer(Buffer);
>>
>> if (auto EC = Writer.writeObject(*Layout.SB))
>> - return std::move(EC);
>> + return EC;
>>
>> commitFpm(Buffer, Layout, Allocator);
>>
>> @@ -361,21 +361,21 @@ Expected<FileBufferByteStream> MSFBuilder::commit(StringRef Path,
>> msf::blockToOffset(Layout.SB->BlockMapAddr, Layout.SB->BlockSize);
>> Writer.setOffset(BlockMapOffset);
>> if (auto EC = Writer.writeArray(Layout.DirectoryBlocks))
>> - return std::move(EC);
>> + return EC;
>>
>> auto DirStream = WritableMappedBlockStream::createDirectoryStream(
>> Layout, Buffer, Allocator);
>> BinaryStreamWriter DW(*DirStream);
>> if (auto EC = DW.writeInteger<uint32_t>(Layout.StreamSizes.size()))
>> - return std::move(EC);
>> + return EC;
>>
>> if (auto EC = DW.writeArray(Layout.StreamSizes))
>> - return std::move(EC);
>> + return EC;
>>
>> for (const auto &Blocks : Layout.StreamMap) {
>> if (auto EC = DW.writeArray(Blocks))
>> - return std::move(EC);
>> + return EC;
>> }
>>
>> - return std::move(Buffer);
>> + return Buffer;
>> }
>>
>> diff --git a/llvm/lib/DebugInfo/PDB/Native/DbiModuleList.cpp b/llvm/lib/DebugInfo/PDB/Native/DbiModuleList.cpp
>> index 5cf014e881cd..991616f03169 100644
>> --- a/llvm/lib/DebugInfo/PDB/Native/DbiModuleList.cpp
>> +++ b/llvm/lib/DebugInfo/PDB/Native/DbiModuleList.cpp
>> @@ -274,6 +274,6 @@ Expected<StringRef> DbiModuleList::getFileName(uint32_t Index) const {
>> Names.setOffset(FileOffset);
>> StringRef Name;
>> if (auto EC = Names.readCString(Name))
>> - return std::move(EC);
>> + return EC;
>> return Name;
>> }
>>
>> diff --git a/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp b/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp
>> index 1445f0bd9e1b..0c990c82607e 100644
>> --- a/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp
>> +++ b/llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp
>> @@ -137,7 +137,7 @@ ModuleDebugStreamRef::findChecksumsSubsection() const {
>> continue;
>>
>> if (auto EC = Result.initialize(SS.getRecordData()))
>> - return std::move(EC);
>> + return EC;
>> return Result;
>> }
>> return Result;
>>
>> diff --git a/llvm/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp b/llvm/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp
>> index 7a258acbd7c0..ffaa79d1a27a 100644
>> --- a/llvm/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp
>> +++ b/llvm/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp
>> @@ -24,7 +24,7 @@ Expected<std::string> readStreamData(BinaryStream &Stream, uint32_t Limit) {
>> while (Offset < DataLength) {
>> ArrayRef<uint8_t> Data;
>> if (auto E = Stream.readLongestContiguousChunk(Offset, Data))
>> - return std::move(E);
>> + return E;
>> Data = Data.take_front(DataLength - Offset);
>> Offset += Data.size();
>> Result += toStringRef(Data);
>>
>> diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
>> index cde645236851..e5c293c8b3e3 100644
>> --- a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
>> +++ b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
>> @@ -108,7 +108,7 @@ Expected<ArrayRef<uint8_t>> PDBFile::getBlockData(uint32_t BlockIndex,
>>
>> ArrayRef<uint8_t> Result;
>> if (auto EC = Buffer->readBytes(StreamBlockOffset, NumBytes, Result))
>> - return std::move(EC);
>> + return EC;
>> return Result;
>> }
>>
>> @@ -267,7 +267,7 @@ Expected<GlobalsStream &> PDBFile::getPDBGlobalsStream() {
>> return GlobalS.takeError();
>> auto TempGlobals = std::make_unique<GlobalsStream>(std::move(*GlobalS));
>> if (auto EC = TempGlobals->reload())
>> - return std::move(EC);
>> + return EC;
>> Globals = std::move(TempGlobals);
>> }
>> return *Globals;
>> @@ -280,7 +280,7 @@ Expected<InfoStream &> PDBFile::getPDBInfoStream() {
>> return InfoS.takeError();
>> auto TempInfo = std::make_unique<InfoStream>(std::move(*InfoS));
>> if (auto EC = TempInfo->reload())
>> - return std::move(EC);
>> + return EC;
>> Info = std::move(TempInfo);
>> }
>> return *Info;
>> @@ -293,7 +293,7 @@ Expected<DbiStream &> PDBFile::getPDBDbiStream() {
>> return DbiS.takeError();
>> auto TempDbi = std::make_unique<DbiStream>(std::move(*DbiS));
>> if (auto EC = TempDbi->reload(this))
>> - return std::move(EC);
>> + return EC;
>> Dbi = std::move(TempDbi);
>> }
>> return *Dbi;
>> @@ -306,7 +306,7 @@ Expected<TpiStream &> PDBFile::getPDBTpiStream() {
>> return TpiS.takeError();
>> auto TempTpi = std::make_unique<TpiStream>(*this, std::move(*TpiS));
>> if (auto EC = TempTpi->reload())
>> - return std::move(EC);
>> + return EC;
>> Tpi = std::move(TempTpi);
>> }
>> return *Tpi;
>> @@ -322,7 +322,7 @@ Expected<TpiStream &> PDBFile::getPDBIpiStream() {
>> return IpiS.takeError();
>> auto TempIpi = std::make_unique<TpiStream>(*this, std::move(*IpiS));
>> if (auto EC = TempIpi->reload())
>> - return std::move(EC);
>> + return EC;
>> Ipi = std::move(TempIpi);
>> }
>> return *Ipi;
>> @@ -340,7 +340,7 @@ Expected<PublicsStream &> PDBFile::getPDBPublicsStream() {
>> return PublicS.takeError();
>> auto TempPublics = std::make_unique<PublicsStream>(std::move(*PublicS));
>> if (auto EC = TempPublics->reload())
>> - return std::move(EC);
>> + return EC;
>> Publics = std::move(TempPublics);
>> }
>> return *Publics;
>> @@ -359,7 +359,7 @@ Expected<SymbolStream &> PDBFile::getPDBSymbolStream() {
>>
>> auto TempSymbols = std::make_unique<SymbolStream>(std::move(*SymbolS));
>> if (auto EC = TempSymbols->reload())
>> - return std::move(EC);
>> + return EC;
>> Symbols = std::move(TempSymbols);
>> }
>> return *Symbols;
>> @@ -374,7 +374,7 @@ Expected<PDBStringTable &> PDBFile::getStringTable() {
>> auto N = std::make_unique<PDBStringTable>();
>> BinaryStreamReader Reader(**NS);
>> if (auto EC = N->reload(Reader))
>> - return std::move(EC);
>> + return EC;
>> assert(Reader.bytesRemaining() == 0);
>> StringTableStream = std::move(*NS);
>> Strings = std::move(N);
>> @@ -394,7 +394,7 @@ Expected<InjectedSourceStream &> PDBFile::getInjectedSourceStream() {
>>
>> auto IJ = std::make_unique<InjectedSourceStream>(std::move(*IJS));
>> if (auto EC = IJ->reload(*Strings))
>> - return std::move(EC);
>> + return EC;
>> InjectedSources = std::move(IJ);
>> }
>> return *InjectedSources;
>>
>> diff --git a/llvm/lib/DebugInfo/PDB/Native/TpiHashing.cpp b/llvm/lib/DebugInfo/PDB/Native/TpiHashing.cpp
>> index b71b2b158144..40ea032aab69 100644
>> --- a/llvm/lib/DebugInfo/PDB/Native/TpiHashing.cpp
>> +++ b/llvm/lib/DebugInfo/PDB/Native/TpiHashing.cpp
>> @@ -44,7 +44,7 @@ static Expected<uint32_t> getHashForUdt(const CVType &Rec) {
>> T Deserialized;
>> if (auto E = TypeDeserializer::deserializeAs(const_cast<CVType &>(Rec),
>> Deserialized))
>> - return std::move(E);
>> + return E;
>> return getHashForUdt(Deserialized, Rec.data());
>> }
>>
>> @@ -53,7 +53,7 @@ static Expected<TagRecordHash> getTagRecordHashForUdt(const CVType &Rec) {
>> T Deserialized;
>> if (auto E = TypeDeserializer::deserializeAs(const_cast<CVType &>(Rec),
>> Deserialized))
>> - return std::move(E);
>> + return E;
>>
>> ClassOptions Opts = Deserialized.getOptions();
>>
>> @@ -79,7 +79,7 @@ static Expected<uint32_t> getSourceLineHash(const CVType &Rec) {
>> T Deserialized;
>> if (auto E = TypeDeserializer::deserializeAs(const_cast<CVType &>(Rec),
>> Deserialized))
>> - return std::move(E);
>> + return E;
>> char Buf[4];
>> support::endian::write32le(Buf, Deserialized.getUDT().getIndex());
>> return hashStringV1(StringRef(Buf, 4));
>>
>> diff --git a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
>> index b4d49d9ff958..c6fdeadc2f9a 100644
>> --- a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
>> +++ b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp
>> @@ -101,7 +101,7 @@ SymbolizableObjectFile::create(const object::ObjectFile *Obj,
>> Uniquify(Fs);
>> Uniquify(Os);
>>
>> - return std::move(res);
>> + return res;
>> }
>>
>> SymbolizableObjectFile::SymbolizableObjectFile(const ObjectFile *Obj,
>>
>> diff --git a/llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp b/llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
>> index f1114e92c360..3f435f63c160 100644
>> --- a/llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
>> +++ b/llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
>> @@ -547,7 +547,7 @@ EHFrameEdgeFixer::parseAugmentationString(BinaryStreamReader &RecordReader) {
>> uint8_t *NextField = &AugInfo.Fields[0];
>>
>> if (auto Err = RecordReader.readInteger(NextChar))
>> - return std::move(Err);
>> + return Err;
>>
>> while (NextChar != 0) {
>> switch (NextChar) {
>> @@ -556,7 +556,7 @@ EHFrameEdgeFixer::parseAugmentationString(BinaryStreamReader &RecordReader) {
>> break;
>> case 'e':
>> if (auto Err = RecordReader.readInteger(NextChar))
>> - return std::move(Err);
>> + return Err;
>> if (NextChar != 'h')
>> return make_error<JITLinkError>("Unrecognized substring e" +
>> Twine(NextChar) +
>> @@ -575,10 +575,10 @@ EHFrameEdgeFixer::parseAugmentationString(BinaryStreamReader &RecordReader) {
>> }
>>
>> if (auto Err = RecordReader.readInteger(NextChar))
>> - return std::move(Err);
>> + return Err;
>> }
>>
>> - return std::move(AugInfo);
>> + return AugInfo;
>> }
>>
>> Expected<JITTargetAddress>
>> @@ -589,11 +589,11 @@ EHFrameEdgeFixer::readAbsolutePointer(LinkGraph &G,
>> JITTargetAddress Addr;
>> if (G.getPointerSize() == 8) {
>> if (auto Err = RecordReader.readInteger(Addr))
>> - return std::move(Err);
>> + return Err;
>> } else if (G.getPointerSize() == 4) {
>> uint32_t Addr32;
>> if (auto Err = RecordReader.readInteger(Addr32))
>> - return std::move(Err);
>> + return Err;
>> Addr = Addr32;
>> } else
>> llvm_unreachable("Pointer size is not 32-bit or 64-bit");
>>
>> diff --git a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
>> index 89eef5783df9..eeb0a4e473b9 100644
>> --- a/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
>> +++ b/llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
>> @@ -28,19 +28,19 @@ Expected<std::unique_ptr<LinkGraph>> MachOLinkGraphBuilder::buildGraph() {
>> return make_error<JITLinkError>("Object is not a relocatable MachO");
>>
>> if (auto Err = createNormalizedSections())
>> - return std::move(Err);
>> + return Err;
>>
>> if (auto Err = createNormalizedSymbols())
>> - return std::move(Err);
>> + return Err;
>>
>> if (auto Err = graphifyRegularSymbols())
>> - return std::move(Err);
>> + return Err;
>>
>> if (auto Err = graphifySectionsWithCustomParsers())
>> - return std::move(Err);
>> + return Err;
>>
>> if (auto Err = addRelocations())
>> - return std::move(Err);
>> + return Err;
>>
>> return std::move(G);
>> }
>>
>> diff --git a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
>> index 29d18b6e4d7b..b465b11b0921 100644
>> --- a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
>> +++ b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
>> @@ -102,7 +102,7 @@ class PartitioningIRMaterializationUnit : public IRMaterializationUnit {
>>
>> Optional<CompileOnDemandLayer::GlobalValueSet>
>> CompileOnDemandLayer::compileRequested(GlobalValueSet Requested) {
>> - return std::move(Requested);
>> + return Requested;
>> }
>>
>> Optional<CompileOnDemandLayer::GlobalValueSet>
>> @@ -294,7 +294,7 @@ void CompileOnDemandLayer::emitPartition(
>> SymbolFlags[Mangle(GV->getName())] =
>> JITSymbolFlags::fromGlobalValue(*GV);
>> if (auto Err = R.defineMaterializing(SymbolFlags))
>> - return std::move(Err);
>> + return Err;
>> }
>>
>> expandPartition(*GVsToExtract);
>>
>> diff --git a/llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp b/llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp
>> index 160e5ba50311..ef3f2253bc32 100644
>> --- a/llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp
>> +++ b/llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp
>> @@ -37,7 +37,7 @@ irManglingOptionsFromTargetOptions(const TargetOptions &Opts) {
>> Expected<SimpleCompiler::CompileResult> SimpleCompiler::operator()(Module &M) {
>> CompileResult CachedObject = tryToLoadFromObjectCache(M);
>> if (CachedObject)
>> - return std::move(CachedObject);
>> + return CachedObject;
>>
>> SmallVector<char, 0> ObjBufferSV;
>>
>> @@ -61,7 +61,7 @@ Expected<SimpleCompiler::CompileResult> SimpleCompiler::operator()(Module &M) {
>> return Obj.takeError();
>>
>> notifyObjectCompiled(M, *ObjBuffer);
>> - return std::move(ObjBuffer);
>> + return ObjBuffer;
>> }
>>
>> SimpleCompiler::CompileResult
>>
>> diff --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
>> index f2b161cc9fc1..5341c0c3f2bf 100644
>> --- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
>> +++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
>> @@ -1455,7 +1455,7 @@ JITDylib::lookupFlags(LookupKind K, JITDylibLookupFlags JDLookupFlags,
>>
>> // Run this generator.
>> if (auto Err = DG->tryToGenerate(K, *this, JDLookupFlags, LookupSet))
>> - return std::move(Err);
>> + return Err;
>>
>> // Re-try the search.
>> lookupFlagsImpl(Result, K, JDLookupFlags, LookupSet);
>> @@ -1613,7 +1613,7 @@ JITDylib::legacyLookup(std::shared_ptr<AsynchronousSymbolQuery> Q,
>> });
>>
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>>
>> assert((MUs.empty() || !QueryComplete) &&
>> "If action flags are set, there should be no work to do (so no MUs)");
>> @@ -1970,12 +1970,12 @@ Expected<SymbolMap> ExecutionSession::legacyLookup(
>> auto ResultFuture = PromisedResult.get_future();
>> auto Result = ResultFuture.get();
>> if (ResolutionError)
>> - return std::move(ResolutionError);
>> - return std::move(Result);
>> + return ResolutionError;
>> + return Result;
>>
>> #else
>> if (ResolutionError)
>> - return std::move(ResolutionError);
>> + return ResolutionError;
>>
>> return Result;
>> #endif
>> @@ -2125,13 +2125,13 @@ ExecutionSession::lookup(const JITDylibSearchOrder &SearchOrder,
>> auto Result = ResultFuture.get();
>>
>> if (ResolutionError)
>> - return std::move(ResolutionError);
>> + return ResolutionError;
>>
>> - return std::move(Result);
>> + return Result;
>>
>> #else
>> if (ResolutionError)
>> - return std::move(ResolutionError);
>> + return ResolutionError;
>>
>> return Result;
>> #endif
>>
>> diff --git a/llvm/lib/ExecutionEngine/Orc/DebugUtils.cpp b/llvm/lib/ExecutionEngine/Orc/DebugUtils.cpp
>> index c9e87ff737fc..85b185481ae6 100644
>> --- a/llvm/lib/ExecutionEngine/Orc/DebugUtils.cpp
>> +++ b/llvm/lib/ExecutionEngine/Orc/DebugUtils.cpp
>> @@ -53,7 +53,7 @@ DumpObjects::operator()(std::unique_ptr<MemoryBuffer> Obj) {
>> return errorCodeToError(EC);
>> DumpStream.write(Obj->getBufferStart(), Obj->getBufferSize());
>>
>> - return std::move(Obj);
>> + return Obj;
>> }
>>
>> StringRef DumpObjects::getBufferIdentifier(MemoryBuffer &B) {
>>
>> diff --git a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
>> index 3d97fe9eeab1..de0c29ff62fb 100644
>> --- a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
>> +++ b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
>> @@ -267,9 +267,9 @@ StaticLibraryDefinitionGenerator::Create(
>> new StaticLibraryDefinitionGenerator(L, std::move(ArchiveBuffer), Err));
>>
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>>
>> - return std::move(ADG);
>> + return ADG;
>> }
>>
>> Error StaticLibraryDefinitionGenerator::tryToGenerate(
>>
>> diff --git a/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h b/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
>> index 87bb4398765d..73640d308226 100644
>> --- a/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
>> +++ b/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
>> @@ -305,7 +305,7 @@ class OrcCBindingsStack {
>> Resolvers[K] = std::make_shared<CBindingsResolver>(*this, ExternalResolver,
>> ExternalResolverCtx);
>> if (auto Err = Layer.addModule(K, std::move(M)))
>> - return std::move(Err);
>> + return Err;
>>
>> KeyLayers[K] = detail::createGenericLayer(Layer);
>>
>> @@ -314,7 +314,7 @@ class OrcCBindingsStack {
>> orc::LegacyCtorDtorRunner<OrcCBindingsStack> CtorRunner(
>> AcknowledgeORCv1Deprecation, std::move(CtorNames), K);
>> if (auto Err = CtorRunner.runViaLayer(*this))
>> - return std::move(Err);
>> + return Err;
>>
>> IRStaticDestructorRunners.emplace_back(AcknowledgeORCv1Deprecation,
>> std::move(DtorNames), K);
>> @@ -365,7 +365,7 @@ class OrcCBindingsStack {
>> *this, ExternalResolver, ExternalResolverCtx);
>>
>> if (auto Err = ObjectLayer.addObject(K, std::move(ObjBuffer)))
>> - return std::move(Err);
>> + return Err;
>>
>> KeyLayers[K] = detail::createGenericLayer(ObjectLayer);
>>
>> @@ -399,7 +399,7 @@ class OrcCBindingsStack {
>> return AddrOrErr.takeError();
>> } else if (auto Err = Sym.takeError()) {
>> // Lookup failure - report error.
>> - return std::move(Err);
>> + return Err;
>> }
>>
>> // No symbol not found. Return 0.
>> @@ -417,7 +417,7 @@ class OrcCBindingsStack {
>> return AddrOrErr.takeError();
>> } else if (auto Err = Sym.takeError()) {
>> // Lookup failure - report error.
>> - return std::move(Err);
>> + return Err;
>> }
>>
>> // Symbol not found. Return 0.
>>
>> diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/JITSymbol.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/JITSymbol.cpp
>> index 4e2d0f422f39..15b7f764204e 100644
>> --- a/llvm/lib/ExecutionEngine/RuntimeDyld/JITSymbol.cpp
>> +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/JITSymbol.cpp
>> @@ -119,7 +119,7 @@ LegacyJITSymbolResolver::getResponsibilitySet(const LookupSet &Symbols) {
>> if (!Sym.getFlags().isStrong())
>> Result.insert(Symbol);
>> } else if (auto Err = Sym.takeError())
>> - return std::move(Err);
>> + return Err;
>> else {
>> // If there is no existing definition then the caller is responsible for
>> // it.
>> @@ -127,5 +127,5 @@ LegacyJITSymbolResolver::getResponsibilitySet(const LookupSet &Symbols) {
>> }
>> }
>>
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
>> index 2df71a5e5e74..404c4380ae64 100644
>> --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
>> +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
>> @@ -194,7 +194,7 @@ RuntimeDyldImpl::loadObjectImpl(const object::ObjectFile &Obj) {
>> CodeSize, CodeAlign,
>> RODataSize, RODataAlign,
>> RWDataSize, RWDataAlign))
>> - return std::move(Err);
>> + return Err;
>> MemMgr.reserveAllocationSpace(CodeSize, CodeAlign, RODataSize, RODataAlign,
>> RWDataSize, RWDataAlign);
>> }
>> @@ -319,7 +319,7 @@ RuntimeDyldImpl::loadObjectImpl(const object::ObjectFile &Obj) {
>> // Get symbol offset.
>> uint64_t SectOffset;
>> if (auto Err = getOffset(*I, *SI, SectOffset))
>> - return std::move(Err);
>> + return Err;
>>
>> bool IsCode = SI->isText();
>> unsigned SectionID;
>> @@ -341,7 +341,7 @@ RuntimeDyldImpl::loadObjectImpl(const object::ObjectFile &Obj) {
>> // Allocate common symbols
>> if (auto Err = emitCommonSymbols(Obj, CommonSymbolsToAllocate, CommonSize,
>> CommonAlign))
>> - return std::move(Err);
>> + return Err;
>>
>> // Parse and process relocations
>> LLVM_DEBUG(dbgs() << "Parse relocations:\n");
>> @@ -432,7 +432,7 @@ RuntimeDyldImpl::loadObjectImpl(const object::ObjectFile &Obj) {
>>
>> // Give the subclasses a chance to tie-up any loose ends.
>> if (auto Err = finalizeLoad(Obj, LocalSections))
>> - return std::move(Err);
>> + return Err;
>>
>> // for (auto E : LocalSections)
>> // llvm::dbgs() << "Added: " << E.first.getRawDataRefImpl() << " -> " << E.second << "\n";
>>
>> diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
>> index 440ab4174a56..f5dbf3b5caa5 100644
>> --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
>> +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
>> @@ -102,10 +102,10 @@ Expected<std::unique_ptr<DyldELFObject<ELFT>>>
>> DyldELFObject<ELFT>::create(MemoryBufferRef Wrapper) {
>> auto Obj = ELFObjectFile<ELFT>::create(Wrapper);
>> if (auto E = Obj.takeError())
>> - return std::move(E);
>> + return E;
>> std::unique_ptr<DyldELFObject<ELFT>> Ret(
>> new DyldELFObject<ELFT>(std::move(*Obj)));
>> - return std::move(Ret);
>> + return Ret;
>> }
>>
>> template <class ELFT>
>> @@ -153,7 +153,7 @@ createRTDyldELFObject(MemoryBufferRef Buffer, const ObjectFile &SourceObject,
>> Expected<std::unique_ptr<DyldELFObject<ELFT>>> ObjOrErr =
>> DyldELFObject<ELFT>::create(Buffer);
>> if (Error E = ObjOrErr.takeError())
>> - return std::move(E);
>> + return E;
>>
>> std::unique_ptr<DyldELFObject<ELFT>> Obj = std::move(*ObjOrErr);
>>
>> @@ -180,7 +180,7 @@ createRTDyldELFObject(MemoryBufferRef Buffer, const ObjectFile &SourceObject,
>> ++SI;
>> }
>>
>> - return std::move(Obj);
>> + return Obj;
>> }
>>
>> static OwningBinary<ObjectFile>
>> @@ -1460,7 +1460,7 @@ RuntimeDyldELF::processRelocationRef(
>> // so the final symbol value is calculated based on the relocation
>> // values in the .opd section.
>> if (auto Err = findOPDEntrySection(Obj, ObjSectionToID, Value))
>> - return std::move(Err);
>> + return Err;
>> } else {
>> // In the ELFv2 ABI, a function symbol may provide a local entry
>> // point, which must be used for direct calls.
>> @@ -1574,7 +1574,7 @@ RuntimeDyldELF::processRelocationRef(
>>
>> RelocationValueRef TOCValue;
>> if (auto Err = findPPC64TOCSection(Obj, ObjSectionToID, TOCValue))
>> - return std::move(Err);
>> + return Err;
>> if (Value.SymbolName || Value.SectionID != TOCValue.SectionID)
>> llvm_unreachable("Unsupported TOC relocation.");
>> Value.Addend -= TOCValue.Addend;
>> @@ -1587,10 +1587,10 @@ RuntimeDyldELF::processRelocationRef(
>> if (RelType == ELF::R_PPC64_TOC) {
>> RelType = ELF::R_PPC64_ADDR64;
>> if (auto Err = findPPC64TOCSection(Obj, ObjSectionToID, Value))
>> - return std::move(Err);
>> + return Err;
>> } else if (TargetName == ".TOC.") {
>> if (auto Err = findPPC64TOCSection(Obj, ObjSectionToID, Value))
>> - return std::move(Err);
>> + return Err;
>> Value.Addend += Addend;
>> }
>>
>>
>> diff --git a/llvm/lib/IR/LLVMRemarkStreamer.cpp b/llvm/lib/IR/LLVMRemarkStreamer.cpp
>> index 326523eaa102..c137208c4423 100644
>> --- a/llvm/lib/IR/LLVMRemarkStreamer.cpp
>> +++ b/llvm/lib/IR/LLVMRemarkStreamer.cpp
>> @@ -133,7 +133,7 @@ Expected<std::unique_ptr<ToolOutputFile>> llvm::setupLLVMOptimizationRemarks(
>> if (Error E = Context.getMainRemarkStreamer()->setFilter(RemarksPasses))
>> return make_error<LLVMRemarkSetupPatternError>(std::move(E));
>>
>> - return std::move(RemarksFile);
>> + return RemarksFile;
>> }
>>
>> Error llvm::setupLLVMOptimizationRemarks(LLVMContext &Context, raw_ostream &OS,
>>
>> diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
>> index 1d23c6bab36d..1c52bea8709a 100644
>> --- a/llvm/lib/LTO/LTO.cpp
>> +++ b/llvm/lib/LTO/LTO.cpp
>> @@ -456,7 +456,7 @@ Expected<std::unique_ptr<InputFile>> InputFile::create(MemoryBufferRef Object) {
>>
>> File->Mods = FOrErr->Mods;
>> File->Strtab = std::move(FOrErr->Strtab);
>> - return std::move(File);
>> + return File;
>> }
>>
>> StringRef InputFile::getName() const {
>> @@ -676,7 +676,7 @@ LTO::addRegularLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
>> Mod.M = std::move(*MOrErr);
>>
>> if (Error Err = M.materializeMetadata())
>> - return std::move(Err);
>> + return Err;
>> UpgradeDebugInfo(M);
>>
>> ModuleSymbolTable SymTab;
>> @@ -776,7 +776,7 @@ LTO::addRegularLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
>> for (GlobalValue &GV : M.global_values())
>> handleNonPrevailingComdat(GV, NonPrevailingComdats);
>> assert(MsymI == MsymE);
>> - return std::move(Mod);
>> + return Mod;
>> }
>>
>> Error LTO::linkRegularLTO(RegularLTOState::AddedModule Mod,
>> @@ -1429,7 +1429,7 @@ Expected<std::unique_ptr<ToolOutputFile>> lto::setupLLVMOptimizationRemarks(
>> auto ResultOrErr = llvm::setupLLVMOptimizationRemarks(
>> Context, Filename, RemarksPasses, RemarksFormat, RemarksWithHotness);
>> if (Error E = ResultOrErr.takeError())
>> - return std::move(E);
>> + return E;
>>
>> if (*ResultOrErr)
>> (*ResultOrErr)->keep();
>> @@ -1451,5 +1451,5 @@ lto::setupStatsFile(StringRef StatsFilename) {
>> return errorCodeToError(EC);
>>
>> StatsFile->keep();
>> - return std::move(StatsFile);
>> + return StatsFile;
>> }
>>
>> diff --git a/llvm/lib/LTO/LTOModule.cpp b/llvm/lib/LTO/LTOModule.cpp
>> index 587b332e7064..0210953f2117 100644
>> --- a/llvm/lib/LTO/LTOModule.cpp
>> +++ b/llvm/lib/LTO/LTOModule.cpp
>> @@ -232,7 +232,7 @@ LTOModule::makeLTOModule(MemoryBufferRef Buffer, const TargetOptions &options,
>> Ret->parseSymbols();
>> Ret->parseMetadata();
>>
>> - return std::move(Ret);
>> + return Ret;
>> }
>>
>> /// Create a MemoryBuffer from a memory range with an optional name.
>>
>> diff --git a/llvm/lib/MCA/InstrBuilder.cpp b/llvm/lib/MCA/InstrBuilder.cpp
>> index b2503f348d66..90ac0bdc0e0d 100644
>> --- a/llvm/lib/MCA/InstrBuilder.cpp
>> +++ b/llvm/lib/MCA/InstrBuilder.cpp
>> @@ -564,7 +564,7 @@ InstrBuilder::createInstrDescImpl(const MCInst &MCI) {
>> computeMaxLatency(*ID, MCDesc, SCDesc, STI);
>>
>> if (Error Err = verifyOperands(MCDesc, MCI))
>> - return std::move(Err);
>> + return Err;
>>
>> populateWrites(*ID, MCI, SchedClassID);
>> populateReads(*ID, MCI, SchedClassID);
>> @@ -574,7 +574,7 @@ InstrBuilder::createInstrDescImpl(const MCInst &MCI) {
>>
>> // Sanity check on the instruction descriptor.
>> if (Error Err = verifyInstrDesc(*ID, MCI))
>> - return std::move(Err);
>> + return Err;
>>
>> // Now add the new descriptor.
>> bool IsVariadic = MCDesc.isVariadic();
>> @@ -666,7 +666,7 @@ InstrBuilder::createInstruction(const MCInst &MCI) {
>>
>> // Early exit if there are no writes.
>> if (D.Writes.empty())
>> - return std::move(NewIS);
>> + return NewIS;
>>
>> // Track register writes that implicitly clear the upper portion of the
>> // underlying super-registers using an APInt.
>> @@ -695,7 +695,7 @@ InstrBuilder::createInstruction(const MCInst &MCI) {
>> ++WriteIndex;
>> }
>>
>> - return std::move(NewIS);
>> + return NewIS;
>> }
>> } // namespace mca
>> } // namespace llvm
>>
>> diff --git a/llvm/lib/MCA/Pipeline.cpp b/llvm/lib/MCA/Pipeline.cpp
>> index 22b9d0799f77..76258fcb1784 100644
>> --- a/llvm/lib/MCA/Pipeline.cpp
>> +++ b/llvm/lib/MCA/Pipeline.cpp
>> @@ -40,7 +40,7 @@ Expected<unsigned> Pipeline::run() {
>> do {
>> notifyCycleBegin();
>> if (Error Err = runCycle())
>> - return std::move(Err);
>> + return Err;
>> notifyCycleEnd();
>> ++Cycles;
>> } while (hasWorkToProcess());
>>
>> diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp
>> index 17d5eec9156c..4f7cea8f9e1f 100644
>> --- a/llvm/lib/Object/Archive.cpp
>> +++ b/llvm/lib/Object/Archive.cpp
>> @@ -481,7 +481,7 @@ Expected<Archive::Child> Archive::Child::getNext() const {
>> Error Err = Error::success();
>> Child Ret(Parent, NextLoc, &Err);
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>> return Ret;
>> }
>>
>> @@ -531,8 +531,8 @@ Expected<std::unique_ptr<Archive>> Archive::create(MemoryBufferRef Source) {
>> Error Err = Error::success();
>> std::unique_ptr<Archive> Ret(new Archive(Source, Err));
>> if (Err)
>> - return std::move(Err);
>> - return std::move(Ret);
>> + return Err;
>> + return Ret;
>> }
>>
>> void Archive::setFirstRegular(const Child &C) {
>> @@ -852,7 +852,7 @@ Expected<Archive::Child> Archive::Symbol::getMember() const {
>> Error Err = Error::success();
>> Child C(Parent, Loc, &Err);
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>> return C;
>> }
>>
>>
>> diff --git a/llvm/lib/Object/ArchiveWriter.cpp b/llvm/lib/Object/ArchiveWriter.cpp
>> index 13dafb58f472..7af798eceed6 100644
>> --- a/llvm/lib/Object/ArchiveWriter.cpp
>> +++ b/llvm/lib/Object/ArchiveWriter.cpp
>> @@ -70,7 +70,7 @@ NewArchiveMember::getOldMember(const object::Archive::Child &OldMember,
>> return AccessModeOrErr.takeError();
>> M.Perms = AccessModeOrErr.get();
>> }
>> - return std::move(M);
>> + return M;
>> }
>>
>> Expected<NewArchiveMember> NewArchiveMember::getFile(StringRef FileName,
>> @@ -109,7 +109,7 @@ Expected<NewArchiveMember> NewArchiveMember::getFile(StringRef FileName,
>> M.GID = Status.getGroup();
>> M.Perms = Status.permissions();
>> }
>> - return std::move(M);
>> + return M;
>> }
>>
>> template <typename T>
>> @@ -379,7 +379,7 @@ getSymbols(MemoryBufferRef Buf, raw_ostream &SymNames, bool &HasObject) {
>> continue;
>> Ret.push_back(SymNames.tell());
>> if (Error E = S.printName(SymNames))
>> - return std::move(E);
>> + return E;
>> SymNames << '\0';
>> }
>> return Ret;
>> @@ -492,7 +492,7 @@ computeMemberData(raw_ostream &StringTable, raw_ostream &SymNames,
>> Expected<std::vector<unsigned>> Symbols =
>> getSymbols(Buf, SymNames, HasObject);
>> if (auto E = Symbols.takeError())
>> - return std::move(E);
>> + return E;
>>
>> Pos += Header.size() + Data.size() + Padding.size();
>> Ret.push_back({std::move(*Symbols), std::move(Header), Data, Padding});
>>
>> diff --git a/llvm/lib/Object/COFFModuleDefinition.cpp b/llvm/lib/Object/COFFModuleDefinition.cpp
>> index 8f29f7a658fd..d72a1cf1aafa 100644
>> --- a/llvm/lib/Object/COFFModuleDefinition.cpp
>> +++ b/llvm/lib/Object/COFFModuleDefinition.cpp
>> @@ -151,7 +151,7 @@ class Parser {
>> Expected<COFFModuleDefinition> parse() {
>> do {
>> if (Error Err = parseOne())
>> - return std::move(Err);
>> + return Err;
>> } while (Tok.K != Eof);
>> return Info;
>> }
>>
>> diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
>> index 2c0f6dc2b1e9..bab9a7cc8259 100644
>> --- a/llvm/lib/Object/COFFObjectFile.cpp
>> +++ b/llvm/lib/Object/COFFObjectFile.cpp
>> @@ -297,7 +297,7 @@ COFFObjectFile::getSectionContents(DataRefImpl Ref) const {
>> const coff_section *Sec = toSec(Ref);
>> ArrayRef<uint8_t> Res;
>> if (Error E = getSectionContents(Sec, Res))
>> - return std::move(E);
>> + return E;
>> return Res;
>> }
>>
>> @@ -1625,7 +1625,7 @@ ObjectFile::createCOFFObjectFile(MemoryBufferRef Object) {
>> std::unique_ptr<COFFObjectFile> Ret(new COFFObjectFile(Object, EC));
>> if (EC)
>> return errorCodeToError(EC);
>> - return std::move(Ret);
>> + return Ret;
>> }
>>
>> bool BaseRelocRef::operator==(const BaseRelocRef &Other) const {
>> @@ -1666,7 +1666,7 @@ std::error_code BaseRelocRef::getRVA(uint32_t &Result) const {
>> do { \
>> Error E = (Expr); \
>> if (E) \
>> - return std::move(E); \
>> + return E; \
>> } while (0)
>>
>> Expected<ArrayRef<UTF16>>
>> @@ -1832,7 +1832,7 @@ ResourceSectionRef::getContents(const coff_resource_data_entry &Entry) {
>> uint64_t Offset = Entry.DataRVA + Sym->getValue();
>> ArrayRef<uint8_t> Contents;
>> if (Error E = Obj->getSectionContents(Section, Contents))
>> - return std::move(E);
>> + return E;
>> if (Offset + Entry.DataSize > Contents.size())
>> return createStringError(object_error::parse_failed,
>> "data outside of section");
>>
>> diff --git a/llvm/lib/Object/Decompressor.cpp b/llvm/lib/Object/Decompressor.cpp
>> index 11efd857d1a1..6682e4979edb 100644
>> --- a/llvm/lib/Object/Decompressor.cpp
>> +++ b/llvm/lib/Object/Decompressor.cpp
>> @@ -26,7 +26,7 @@ Expected<Decompressor> Decompressor::create(StringRef Name, StringRef Data,
>> Error Err = isGnuStyle(Name) ? D.consumeCompressedGnuHeader()
>> : D.consumeCompressedZLibHeader(Is64Bit, IsLE);
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>> return D;
>> }
>>
>>
>> diff --git a/llvm/lib/Object/ELFObjectFile.cpp b/llvm/lib/Object/ELFObjectFile.cpp
>> index bf6ffd6c37b9..671f7b7e6d91 100644
>> --- a/llvm/lib/Object/ELFObjectFile.cpp
>> +++ b/llvm/lib/Object/ELFObjectFile.cpp
>> @@ -62,7 +62,7 @@ static Expected<std::unique_ptr<ELFObjectFile<ELFT>>>
>> createPtr(MemoryBufferRef Object) {
>> auto Ret = ELFObjectFile<ELFT>::create(Object);
>> if (Error E = Ret.takeError())
>> - return std::move(E);
>> + return E;
>> return std::make_unique<ELFObjectFile<ELFT>>(std::move(*Ret));
>> }
>>
>>
>> diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp
>> index 636f1521262f..79e8f4d681dc 100644
>> --- a/llvm/lib/Object/IRObjectFile.cpp
>> +++ b/llvm/lib/Object/IRObjectFile.cpp
>> @@ -151,5 +151,5 @@ Expected<IRSymtabFile> object::readIRSymtab(MemoryBufferRef MBRef) {
>> F.Symtab = std::move(FCOrErr->Symtab);
>> F.Strtab = std::move(FCOrErr->Strtab);
>> F.TheReader = std::move(FCOrErr->TheReader);
>> - return std::move(F);
>> + return F;
>> }
>>
>> diff --git a/llvm/lib/Object/IRSymtab.cpp b/llvm/lib/Object/IRSymtab.cpp
>> index a92cb02ed290..3fde16c11546 100644
>> --- a/llvm/lib/Object/IRSymtab.cpp
>> +++ b/llvm/lib/Object/IRSymtab.cpp
>> @@ -363,7 +363,7 @@ static Expected<FileContents> upgrade(ArrayRef<BitcodeModule> BMs) {
>> StringTableBuilder StrtabBuilder(StringTableBuilder::RAW);
>> BumpPtrAllocator Alloc;
>> if (Error E = build(Mods, FC.Symtab, StrtabBuilder, Alloc))
>> - return std::move(E);
>> + return E;
>>
>> StrtabBuilder.finalizeInOrder();
>> FC.Strtab.resize(StrtabBuilder.getSize());
>> @@ -371,7 +371,7 @@ static Expected<FileContents> upgrade(ArrayRef<BitcodeModule> BMs) {
>>
>> FC.TheReader = {{FC.Symtab.data(), FC.Symtab.size()},
>> {FC.Strtab.data(), FC.Strtab.size()}};
>> - return std::move(FC);
>> + return FC;
>> }
>>
>> Expected<FileContents> irsymtab::readBitcode(const BitcodeFileContents &BFC) {
>> @@ -405,5 +405,5 @@ Expected<FileContents> irsymtab::readBitcode(const BitcodeFileContents &BFC) {
>> if (FC.TheReader.getNumModules() != BFC.Mods.size())
>> return upgrade(std::move(BFC.Mods));
>>
>> - return std::move(FC);
>> + return FC;
>> }
>>
>> diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
>> index 8540b7ab03cd..02e8682149be 100644
>> --- a/llvm/lib/Object/MachOObjectFile.cpp
>> +++ b/llvm/lib/Object/MachOObjectFile.cpp
>> @@ -1251,8 +1251,8 @@ MachOObjectFile::create(MemoryBufferRef Object, bool IsLittleEndian,
>> Is64Bits, Err, UniversalCputype,
>> UniversalIndex));
>> if (Err)
>> - return std::move(Err);
>> - return std::move(Obj);
>> + return Err;
>> + return Obj;
>> }
>>
>> MachOObjectFile::MachOObjectFile(MemoryBufferRef Object, bool IsLittleEndian,
>>
>> diff --git a/llvm/lib/Object/MachOUniversal.cpp b/llvm/lib/Object/MachOUniversal.cpp
>> index a178ecde949e..ba4b631a3abb 100644
>> --- a/llvm/lib/Object/MachOUniversal.cpp
>> +++ b/llvm/lib/Object/MachOUniversal.cpp
>> @@ -105,8 +105,8 @@ MachOUniversalBinary::create(MemoryBufferRef Source) {
>> std::unique_ptr<MachOUniversalBinary> Ret(
>> new MachOUniversalBinary(Source, Err));
>> if (Err)
>> - return std::move(Err);
>> - return std::move(Ret);
>> + return Err;
>> + return Ret;
>> }
>>
>> MachOUniversalBinary::MachOUniversalBinary(MemoryBufferRef Source, Error &Err)
>>
>> diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp
>> index 098b3d8f8dd0..766c59a38817 100644
>> --- a/llvm/lib/Object/ObjectFile.cpp
>> +++ b/llvm/lib/Object/ObjectFile.cpp
>> @@ -182,7 +182,7 @@ ObjectFile::createObjectFile(StringRef ObjectPath) {
>> Expected<std::unique_ptr<ObjectFile>> ObjOrErr =
>> createObjectFile(Buffer->getMemBufferRef());
>> if (Error Err = ObjOrErr.takeError())
>> - return std::move(Err);
>> + return Err;
>> std::unique_ptr<ObjectFile> Obj = std::move(ObjOrErr.get());
>>
>> return OwningBinary<ObjectFile>(std::move(Obj), std::move(Buffer));
>>
>> diff --git a/llvm/lib/Object/SymbolicFile.cpp b/llvm/lib/Object/SymbolicFile.cpp
>> index 3db4ad9ed14b..921cb2170d8a 100644
>> --- a/llvm/lib/Object/SymbolicFile.cpp
>> +++ b/llvm/lib/Object/SymbolicFile.cpp
>> @@ -82,13 +82,13 @@ SymbolicFile::createSymbolicFile(MemoryBufferRef Object, file_magic Type,
>> Expected<std::unique_ptr<ObjectFile>> Obj =
>> ObjectFile::createObjectFile(Object, Type);
>> if (!Obj || !Context)
>> - return std::move(Obj);
>> + return Obj;
>>
>> Expected<MemoryBufferRef> BCData =
>> IRObjectFile::findBitcodeInObject(*Obj->get());
>> if (!BCData) {
>> consumeError(BCData.takeError());
>> - return std::move(Obj);
>> + return Obj;
>> }
>>
>> return IRObjectFile::create(
>>
>> diff --git a/llvm/lib/Object/TapiUniversal.cpp b/llvm/lib/Object/TapiUniversal.cpp
>> index b3273e345a61..c297e319fcc3 100644
>> --- a/llvm/lib/Object/TapiUniversal.cpp
>> +++ b/llvm/lib/Object/TapiUniversal.cpp
>> @@ -49,6 +49,6 @@ TapiUniversal::create(MemoryBufferRef Source) {
>> Error Err = Error::success();
>> std::unique_ptr<TapiUniversal> Ret(new TapiUniversal(Source, Err));
>> if (Err)
>> - return std::move(Err);
>> - return std::move(Ret);
>> + return Err;
>> + return Ret;
>> }
>>
>> diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp
>> index 2e42324629f5..348cb56df95b 100644
>> --- a/llvm/lib/Object/WasmObjectFile.cpp
>> +++ b/llvm/lib/Object/WasmObjectFile.cpp
>> @@ -58,9 +58,9 @@ ObjectFile::createWasmObjectFile(MemoryBufferRef Buffer) {
>> Error Err = Error::success();
>> auto ObjectFile = std::make_unique<WasmObjectFile>(Buffer, Err);
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>>
>> - return std::move(ObjectFile);
>> + return ObjectFile;
>> }
>>
>> #define VARINT7_MAX ((1 << 7) - 1)
>>
>> diff --git a/llvm/lib/Object/WindowsResource.cpp b/llvm/lib/Object/WindowsResource.cpp
>> index 0cf9da43ae29..dc1d86ae76a2 100644
>> --- a/llvm/lib/Object/WindowsResource.cpp
>> +++ b/llvm/lib/Object/WindowsResource.cpp
>> @@ -63,7 +63,7 @@ WindowsResource::createWindowsResource(MemoryBufferRef Source) {
>> Source.getBufferIdentifier() + ": too small to be a resource file",
>> object_error::invalid_file_type);
>> std::unique_ptr<WindowsResource> Ret(new WindowsResource(Source));
>> - return std::move(Ret);
>> + return Ret;
>> }
>>
>> Expected<ResourceEntryRef> WindowsResource::getHeadEntry() {
>> @@ -81,7 +81,7 @@ Expected<ResourceEntryRef>
>> ResourceEntryRef::create(BinaryStreamRef BSR, const WindowsResource *Owner) {
>> auto Ref = ResourceEntryRef(BSR, Owner);
>> if (auto E = Ref.loadNext())
>> - return std::move(E);
>> + return E;
>> return Ref;
>> }
>>
>> @@ -1005,7 +1005,7 @@ writeWindowsResourceCOFF(COFF::MachineTypes MachineType,
>> Error E = Error::success();
>> WindowsResourceCOFFWriter Writer(MachineType, Parser, E);
>> if (E)
>> - return std::move(E);
>> + return E;
>> return Writer.write(TimeDateStamp);
>> }
>>
>>
>> diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp
>> index 51fc66101646..feb8a19836c3 100644
>> --- a/llvm/lib/Object/XCOFFObjectFile.cpp
>> +++ b/llvm/lib/Object/XCOFFObjectFile.cpp
>> @@ -604,7 +604,7 @@ XCOFFObjectFile::relocations(const XCOFFSectionHeader32 &Sec) const {
>> Sec.FileOffsetToRelocationInfo);
>> auto NumRelocEntriesOrErr = getLogicalNumberOfRelocationEntries(Sec);
>> if (Error E = NumRelocEntriesOrErr.takeError())
>> - return std::move(E);
>> + return E;
>>
>> uint32_t NumRelocEntries = NumRelocEntriesOrErr.get();
>>
>> @@ -613,7 +613,7 @@ XCOFFObjectFile::relocations(const XCOFFSectionHeader32 &Sec) const {
>> getObject<XCOFFRelocation32>(Data, reinterpret_cast<void *>(RelocAddr),
>> NumRelocEntries * sizeof(XCOFFRelocation32));
>> if (Error E = RelocationOrErr.takeError())
>> - return std::move(E);
>> + return E;
>>
>> const XCOFFRelocation32 *StartReloc = RelocationOrErr.get();
>>
>> @@ -639,7 +639,7 @@ XCOFFObjectFile::parseStringTable(const XCOFFObjectFile *Obj, uint64_t Offset) {
>> auto StringTableOrErr =
>> getObject<char>(Obj->Data, Obj->base() + Offset, Size);
>> if (Error E = StringTableOrErr.takeError())
>> - return std::move(E);
>> + return E;
>>
>> const char *StringTablePtr = StringTableOrErr.get();
>> if (StringTablePtr[Size - 1] != '\0')
>> @@ -662,7 +662,7 @@ XCOFFObjectFile::create(unsigned Type, MemoryBufferRef MBR) {
>> auto FileHeaderOrErr =
>> getObject<void>(Data, Base + CurOffset, Obj->getFileHeaderSize());
>> if (Error E = FileHeaderOrErr.takeError())
>> - return std::move(E);
>> + return E;
>> Obj->FileHeader = FileHeaderOrErr.get();
>>
>> CurOffset += Obj->getFileHeaderSize();
>> @@ -676,17 +676,17 @@ XCOFFObjectFile::create(unsigned Type, MemoryBufferRef MBR) {
>> Obj->getNumberOfSections() *
>> Obj->getSectionHeaderSize());
>> if (Error E = SecHeadersOrErr.takeError())
>> - return std::move(E);
>> + return E;
>> Obj->SectionHeaderTable = SecHeadersOrErr.get();
>> }
>>
>> // 64-bit object supports only file header and section headers for now.
>> if (Obj->is64Bit())
>> - return std::move(Obj);
>> + return Obj;
>>
>> // If there is no symbol table we are done parsing the memory buffer.
>> if (Obj->getLogicalNumberOfSymbolTableEntries32() == 0)
>> - return std::move(Obj);
>> + return Obj;
>>
>> // Parse symbol table.
>> CurOffset = Obj->fileHeader32()->SymbolTableOffset;
>> @@ -695,7 +695,7 @@ XCOFFObjectFile::create(unsigned Type, MemoryBufferRef MBR) {
>> auto SymTableOrErr =
>> getObject<XCOFFSymbolEntry>(Data, Base + CurOffset, SymbolTableSize);
>> if (Error E = SymTableOrErr.takeError())
>> - return std::move(E);
>> + return E;
>> Obj->SymbolTblPtr = SymTableOrErr.get();
>> CurOffset += SymbolTableSize;
>>
>> @@ -703,10 +703,10 @@ XCOFFObjectFile::create(unsigned Type, MemoryBufferRef MBR) {
>> Expected<XCOFFStringTable> StringTableOrErr =
>> parseStringTable(Obj.get(), CurOffset);
>> if (Error E = StringTableOrErr.takeError())
>> - return std::move(E);
>> + return E;
>> Obj->StringTable = StringTableOrErr.get();
>>
>> - return std::move(Obj);
>> + return Obj;
>> }
>>
>> Expected<std::unique_ptr<ObjectFile>>
>>
>> diff --git a/llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp b/llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp
>> index 02f053bb0e0f..65843418cdae 100644
>> --- a/llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp
>> +++ b/llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp
>> @@ -694,11 +694,11 @@ YAMLStringTableSubsection::fromCodeViewSubsection(
>> StringRef S;
>> // First item is a single null string, skip it.
>> if (auto EC = Reader.readCString(S))
>> - return std::move(EC);
>> + return EC;
>> assert(S.empty());
>> while (Reader.bytesRemaining() > 0) {
>> if (auto EC = Reader.readCString(S))
>> - return std::move(EC);
>> + return EC;
>> Result->Strings.push_back(S);
>> }
>> return Result;
>> @@ -749,7 +749,7 @@ llvm::CodeViewYAML::toCodeViewSubsectionList(
>> const codeview::StringsAndChecksums &SC) {
>> std::vector<std::shared_ptr<DebugSubsection>> Result;
>> if (Subsections.empty())
>> - return std::move(Result);
>> + return Result;
>>
>> for (const auto &SS : Subsections) {
>> std::shared_ptr<DebugSubsection> CVS;
>> @@ -757,7 +757,7 @@ llvm::CodeViewYAML::toCodeViewSubsectionList(
>> assert(CVS != nullptr);
>> Result.push_back(std::move(CVS));
>> }
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> namespace {
>> @@ -892,7 +892,7 @@ YAMLDebugSubsection::fromCodeViewSubection(const StringsAndChecksumsRef &SC,
>> const DebugSubsectionRecord &SS) {
>> SubsectionConversionVisitor V;
>> if (auto EC = visitDebugSubsection(SS, V, SC))
>> - return std::move(EC);
>> + return EC;
>>
>> return V.Subsection;
>> }
>>
>> diff --git a/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp b/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
>> index 95409fdc3300..094e298c76a0 100644
>> --- a/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
>> +++ b/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp
>> @@ -585,7 +585,7 @@ fromCodeViewSymbolImpl(CVSymbol Symbol) {
>>
>> auto Impl = std::make_shared<SymbolType>(Symbol.kind());
>> if (auto EC = Impl->fromCodeViewSymbol(Symbol))
>> - return std::move(EC);
>> + return EC;
>> Result.Symbol = Impl;
>> return Result;
>> }
>>
>> diff --git a/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp b/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp
>> index a5e3ce1e71e8..a830e829951e 100644
>> --- a/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp
>> +++ b/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp
>> @@ -671,7 +671,7 @@ static inline Expected<LeafRecord> fromCodeViewRecordImpl(CVType Type) {
>>
>> auto Impl = std::make_shared<LeafRecordImpl<T>>(Type.kind());
>> if (auto EC = Impl->fromCodeViewRecord(Type))
>> - return std::move(EC);
>> + return EC;
>> Result.Leaf = Impl;
>> return Result;
>> }
>>
>> diff --git a/llvm/lib/ObjectYAML/DWARFEmitter.cpp b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
>> index b410fed16f09..db99ad9bf795 100644
>> --- a/llvm/lib/ObjectYAML/DWARFEmitter.cpp
>> +++ b/llvm/lib/ObjectYAML/DWARFEmitter.cpp
>> @@ -377,5 +377,5 @@ DWARFYAML::EmitDebugSections(StringRef YAMLString, bool ApplyFixups,
>> DebugSections);
>> EmitDebugSectionImpl(DI, &DWARFYAML::EmitDebugAranges, "debug_aranges",
>> DebugSections);
>> - return std::move(DebugSections);
>> + return DebugSections;
>> }
>>
>> diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
>> index 9d39b7c63f8f..6509afa82a5a 100644
>> --- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
>> +++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
>> @@ -284,14 +284,14 @@ Expected<std::unique_ptr<CoverageMapping>> CoverageMapping::load(
>> for (const auto &CoverageReader : CoverageReaders) {
>> for (auto RecordOrErr : *CoverageReader) {
>> if (Error E = RecordOrErr.takeError())
>> - return std::move(E);
>> + return E;
>> const auto &Record = *RecordOrErr;
>> if (Error E = Coverage->loadFunctionRecord(Record, ProfileReader))
>> - return std::move(E);
>> + return E;
>> }
>> }
>>
>> - return std::move(Coverage);
>> + return Coverage;
>> }
>>
>> // If E is a no_data_found error, returns success. Otherwise returns E.
>> @@ -309,7 +309,7 @@ CoverageMapping::load(ArrayRef<StringRef> ObjectFilenames,
>> StringRef ProfileFilename, ArrayRef<StringRef> Arches) {
>> auto ProfileReaderOrErr = IndexedInstrProfReader::create(ProfileFilename);
>> if (Error E = ProfileReaderOrErr.takeError())
>> - return std::move(E);
>> + return E;
>> auto ProfileReader = std::move(ProfileReaderOrErr.get());
>>
>> SmallVector<std::unique_ptr<CoverageMappingReader>, 4> Readers;
>> @@ -326,7 +326,7 @@ CoverageMapping::load(ArrayRef<StringRef> ObjectFilenames,
>> if (Error E = CoverageReadersOrErr.takeError()) {
>> E = handleMaybeNoDataFoundError(std::move(E));
>> if (E)
>> - return std::move(E);
>> + return E;
>> // E == success (originally a no_data_found error).
>> continue;
>> }
>>
>> diff --git a/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp b/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
>> index 679ff3525eeb..b2132009bb3c 100644
>> --- a/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
>> +++ b/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
>> @@ -321,28 +321,28 @@ Expected<bool> RawCoverageMappingDummyChecker::isDummy() {
>> // A dummy coverage mapping data consists of just one region with zero count.
>> uint64_t NumFileMappings;
>> if (Error Err = readSize(NumFileMappings))
>> - return std::move(Err);
>> + return Err;
>> if (NumFileMappings != 1)
>> return false;
>> // We don't expect any specific value for the filename index, just skip it.
>> uint64_t FilenameIndex;
>> if (Error Err =
>> readIntMax(FilenameIndex, std::numeric_limits<unsigned>::max()))
>> - return std::move(Err);
>> + return Err;
>> uint64_t NumExpressions;
>> if (Error Err = readSize(NumExpressions))
>> - return std::move(Err);
>> + return Err;
>> if (NumExpressions != 0)
>> return false;
>> uint64_t NumRegions;
>> if (Error Err = readSize(NumRegions))
>> - return std::move(Err);
>> + return Err;
>> if (NumRegions != 1)
>> return false;
>> uint64_t EncodedCounterAndRegion;
>> if (Error Err = readIntMax(EncodedCounterAndRegion,
>> std::numeric_limits<unsigned>::max()))
>> - return std::move(Err);
>> + return Err;
>> unsigned Tag = EncodedCounterAndRegion & Counter::EncodingTagMask;
>> return Tag == Counter::Zero;
>> }
>> @@ -494,7 +494,7 @@ class VersionedCovMapFuncRecordReader : public CovMapFuncRecordReader {
>> size_t FilenamesBegin = Filenames.size();
>> RawCoverageFilenamesReader Reader(StringRef(Buf, FilenamesSize), Filenames);
>> if (auto Err = Reader.read())
>> - return std::move(Err);
>> + return Err;
>> Buf += FilenamesSize;
>>
>> // We'll read the coverage mapping records in the loop below.
>> @@ -521,7 +521,7 @@ class VersionedCovMapFuncRecordReader : public CovMapFuncRecordReader {
>>
>> if (Error Err =
>> insertFunctionRecordIfNeeded(CFR, Mapping, FilenamesBegin))
>> - return std::move(Err);
>> + return Err;
>> CFR++;
>> }
>> return Buf;
>> @@ -545,7 +545,7 @@ Expected<std::unique_ptr<CovMapFuncRecordReader>> CovMapFuncRecordReader::get(
>> case CovMapVersion::Version3:
>> // Decompress the name data.
>> if (Error E = P.create(P.getNameData()))
>> - return std::move(E);
>> + return E;
>> if (Version == CovMapVersion::Version2)
>> return std::make_unique<VersionedCovMapFuncRecordReader<
>> CovMapVersion::Version2, IntPtrT, Endian>>(P, R, F);
>> @@ -597,26 +597,26 @@ BinaryCoverageReader::createCoverageReaderFromBuffer(
>> readCoverageMappingData<uint32_t, support::endianness::little>(
>> Reader->ProfileNames, Coverage, Reader->MappingRecords,
>> Reader->Filenames))
>> - return std::move(E);
>> + return E;
>> } else if (BytesInAddress == 4 && Endian == support::endianness::big) {
>> if (Error E = readCoverageMappingData<uint32_t, support::endianness::big>(
>> Reader->ProfileNames, Coverage, Reader->MappingRecords,
>> Reader->Filenames))
>> - return std::move(E);
>> + return E;
>> } else if (BytesInAddress == 8 && Endian == support::endianness::little) {
>> if (Error E =
>> readCoverageMappingData<uint64_t, support::endianness::little>(
>> Reader->ProfileNames, Coverage, Reader->MappingRecords,
>> Reader->Filenames))
>> - return std::move(E);
>> + return E;
>> } else if (BytesInAddress == 8 && Endian == support::endianness::big) {
>> if (Error E = readCoverageMappingData<uint64_t, support::endianness::big>(
>> Reader->ProfileNames, Coverage, Reader->MappingRecords,
>> Reader->Filenames))
>> - return std::move(E);
>> + return E;
>> } else
>> return make_error<CoverageMapError>(coveragemap_error::malformed);
>> - return std::move(Reader);
>> + return Reader;
>> }
>>
>> static Expected<std::unique_ptr<BinaryCoverageReader>>
>> @@ -643,7 +643,7 @@ loadTestingFormat(StringRef Data) {
>> return make_error<CoverageMapError>(coveragemap_error::malformed);
>> InstrProfSymtab ProfileNames;
>> if (Error E = ProfileNames.create(Data.substr(0, ProfileNamesSize), Address))
>> - return std::move(E);
>> + return E;
>> StringRef CoverageMapping = Data.substr(ProfileNamesSize);
>> // Skip the padding bytes because coverage map data has an alignment of 8.
>> if (CoverageMapping.empty())
>> @@ -708,12 +708,12 @@ loadBinaryFormat(std::unique_ptr<Binary> Bin, StringRef Arch) {
>> lookupSection(*OF, getInstrProfSectionName(IPSK_name, ObjFormat,
>> /*AddSegmentInfo=*/false));
>> if (auto E = NamesSection.takeError())
>> - return std::move(E);
>> + return E;
>> auto CoverageSection =
>> lookupSection(*OF, getInstrProfSectionName(IPSK_covmap, ObjFormat,
>> /*AddSegmentInfo=*/false));
>> if (auto E = CoverageSection.takeError())
>> - return std::move(E);
>> + return E;
>>
>> // Get the contents of the given sections.
>> auto CoverageMappingOrErr = CoverageSection->getContents();
>> @@ -722,7 +722,7 @@ loadBinaryFormat(std::unique_ptr<Binary> Bin, StringRef Arch) {
>>
>> InstrProfSymtab ProfileNames;
>> if (Error E = ProfileNames.create(*NamesSection))
>> - return std::move(E);
>> + return E;
>>
>> return BinaryCoverageReader::createCoverageReaderFromBuffer(
>> CoverageMappingOrErr.get(), std::move(ProfileNames), BytesInAddress,
>> @@ -741,7 +741,7 @@ BinaryCoverageReader::create(
>> if (!ReaderOrErr)
>> return ReaderOrErr.takeError();
>> Readers.push_back(std::move(ReaderOrErr.get()));
>> - return std::move(Readers);
>> + return Readers;
>> }
>>
>> auto BinOrErr = createBinary(ObjectBuffer);
>> @@ -786,7 +786,7 @@ BinaryCoverageReader::create(
>> Readers.push_back(std::move(Reader));
>> }
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>>
>> // Thin archives reference object files outside of the archive file, i.e.
>> // files which reside in memory not owned by the caller. Transfer ownership
>> @@ -795,14 +795,14 @@ BinaryCoverageReader::create(
>> for (auto &Buffer : Ar->takeThinBuffers())
>> ObjectFileBuffers.push_back(std::move(Buffer));
>>
>> - return std::move(Readers);
>> + return Readers;
>> }
>>
>> auto ReaderOrErr = loadBinaryFormat(std::move(Bin), Arch);
>> if (!ReaderOrErr)
>> return ReaderOrErr.takeError();
>> Readers.push_back(std::move(ReaderOrErr.get()));
>> - return std::move(Readers);
>> + return Readers;
>> }
>>
>> Error BinaryCoverageReader::readNextRecord(CoverageMappingRecord &Record) {
>>
>> diff --git a/llvm/lib/ProfileData/GCOV.cpp b/llvm/lib/ProfileData/GCOV.cpp
>> index 0c4006d867a6..6331be3b237b 100644
>> --- a/llvm/lib/ProfileData/GCOV.cpp
>> +++ b/llvm/lib/ProfileData/GCOV.cpp
>> @@ -711,7 +711,7 @@ FileInfo::openCoveragePath(StringRef CoveragePath) {
>> errs() << EC.message() << "\n";
>> return std::make_unique<raw_null_ostream>();
>> }
>> - return std::move(OS);
>> + return OS;
>> }
>>
>> /// print - Print source files with collected line count information.
>>
>> diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
>> index 1859127b4a2f..30d2a0e781d2 100644
>> --- a/llvm/lib/ProfileData/InstrProf.cpp
>> +++ b/llvm/lib/ProfileData/InstrProf.cpp
>> @@ -891,9 +891,9 @@ ValueProfData::getValueProfData(const unsigned char *D,
>>
>> Error E = VPD->checkIntegrity();
>> if (E)
>> - return std::move(E);
>> + return E;
>>
>> - return std::move(VPD);
>> + return VPD;
>> }
>>
>> void ValueProfData::swapBytesToHost(support::endianness Endianness) {
>>
>> diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
>> index b904f983dceb..d7f987e7f9ee 100644
>> --- a/llvm/lib/ProfileData/InstrProfReader.cpp
>> +++ b/llvm/lib/ProfileData/InstrProfReader.cpp
>> @@ -55,7 +55,7 @@ InstrProfReader::create(const Twine &Path) {
>> // Set up the buffer to read.
>> auto BufferOrError = setupMemoryBuffer(Path);
>> if (Error E = BufferOrError.takeError())
>> - return std::move(E);
>> + return E;
>> return InstrProfReader::create(std::move(BufferOrError.get()));
>> }
>>
>> @@ -83,9 +83,9 @@ InstrProfReader::create(std::unique_ptr<MemoryBuffer> Buffer) {
>>
>> // Initialize the reader and return the result.
>> if (Error E = initializeReader(*Result))
>> - return std::move(E);
>> + return E;
>>
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> Expected<std::unique_ptr<IndexedInstrProfReader>>
>> @@ -93,7 +93,7 @@ IndexedInstrProfReader::create(const Twine &Path, const Twine &RemappingPath) {
>> // Set up the buffer to read.
>> auto BufferOrError = setupMemoryBuffer(Path);
>> if (Error E = BufferOrError.takeError())
>> - return std::move(E);
>> + return E;
>>
>> // Set up the remapping buffer if requested.
>> std::unique_ptr<MemoryBuffer> RemappingBuffer;
>> @@ -101,7 +101,7 @@ IndexedInstrProfReader::create(const Twine &Path, const Twine &RemappingPath) {
>> if (!RemappingPathStr.empty()) {
>> auto RemappingBufferOrError = setupMemoryBuffer(RemappingPathStr);
>> if (Error E = RemappingBufferOrError.takeError())
>> - return std::move(E);
>> + return E;
>> RemappingBuffer = std::move(RemappingBufferOrError.get());
>> }
>>
>> @@ -124,9 +124,9 @@ IndexedInstrProfReader::create(std::unique_ptr<MemoryBuffer> Buffer,
>>
>> // Initialize the reader and return the result.
>> if (Error E = initializeReader(*Result))
>> - return std::move(E);
>> + return E;
>>
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> void InstrProfIterator::Increment() {
>> @@ -874,7 +874,7 @@ IndexedInstrProfReader::getInstrProfRecord(StringRef FuncName,
>> ArrayRef<NamedInstrProfRecord> Data;
>> Error Err = Remapper->getRecords(FuncName, Data);
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>> // Found it. Look for counters with the right hash.
>> for (unsigned I = 0, E = Data.size(); I < E; ++I) {
>> // Check for a match and fill the vector if there is one.
>>
>> diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp
>> index 6f74cec07b96..5a673931b3f3 100644
>> --- a/llvm/lib/ProfileData/SampleProfReader.cpp
>> +++ b/llvm/lib/ProfileData/SampleProfReader.cpp
>> @@ -1250,7 +1250,7 @@ setupMemoryBuffer(const Twine &Filename) {
>> if (uint64_t(Buffer->getBufferSize()) > std::numeric_limits<uint32_t>::max())
>> return sampleprof_error::too_large;
>>
>> - return std::move(Buffer);
>> + return Buffer;
>> }
>>
>> /// Create a sample profile reader based on the format of the input file.
>> @@ -1362,7 +1362,7 @@ SampleProfileReader::create(std::unique_ptr<MemoryBuffer> &B, LLVMContext &C,
>> return EC;
>> }
>>
>> - return std::move(Reader);
>> + return Reader;
>> }
>>
>> // For text and GCC file formats, we compute the summary after reading the
>>
>> diff --git a/llvm/lib/ProfileData/SampleProfWriter.cpp b/llvm/lib/ProfileData/SampleProfWriter.cpp
>> index 8d09af31f94b..dbb0f309cadc 100644
>> --- a/llvm/lib/ProfileData/SampleProfWriter.cpp
>> +++ b/llvm/lib/ProfileData/SampleProfWriter.cpp
>> @@ -607,7 +607,7 @@ SampleProfileWriter::create(std::unique_ptr<raw_ostream> &OS,
>> return EC;
>>
>> Writer->Format = Format;
>> - return std::move(Writer);
>> + return Writer;
>> }
>>
>> void SampleProfileWriter::computeSummary(
>>
>> diff --git a/llvm/lib/Remarks/BitstreamRemarkParser.cpp b/llvm/lib/Remarks/BitstreamRemarkParser.cpp
>> index 25fbea7d31c2..c1fedfbf09a8 100644
>> --- a/llvm/lib/Remarks/BitstreamRemarkParser.cpp
>> +++ b/llvm/lib/Remarks/BitstreamRemarkParser.cpp
>> @@ -266,7 +266,7 @@ static Expected<bool> isBlock(BitstreamCursor &Stream, unsigned BlockID) {
>> break;
>> }
>> if (Error E = Stream.JumpToBit(PreviousBitNo))
>> - return std::move(E);
>> + return E;
>> return Result;
>> }
>>
>> @@ -316,7 +316,7 @@ remarks::createBitstreamParserFromMeta(
>>
>> if (Error E = validateMagicNumber(
>> StringRef(MagicNumber->data(), MagicNumber->size())))
>> - return std::move(E);
>> + return E;
>>
>> auto Parser =
>> StrTab ? std::make_unique<BitstreamRemarkParser>(Buf, std::move(*StrTab))
>> @@ -325,7 +325,7 @@ remarks::createBitstreamParserFromMeta(
>> if (ExternalFilePrependPath)
>> Parser->ExternalFilePrependPath = std::string(*ExternalFilePrependPath);
>>
>> - return std::move(Parser);
>> + return Parser;
>> }
>>
>> Expected<std::unique_ptr<Remark>> BitstreamRemarkParser::next() {
>> @@ -334,7 +334,7 @@ Expected<std::unique_ptr<Remark>> BitstreamRemarkParser::next() {
>>
>> if (!ReadyToParseRemarks) {
>> if (Error E = parseMeta())
>> - return std::move(E);
>> + return E;
>> ReadyToParseRemarks = true;
>> }
>>
>> @@ -491,7 +491,7 @@ Error BitstreamRemarkParser::processSeparateRemarksMetaMeta(
>> Expected<std::unique_ptr<Remark>> BitstreamRemarkParser::parseRemark() {
>> BitstreamRemarkParserHelper RemarkHelper(ParserHelper.Stream);
>> if (Error E = RemarkHelper.parse())
>> - return std::move(E);
>> + return E;
>>
>> return processRemark(RemarkHelper);
>> }
>> @@ -562,7 +562,7 @@ BitstreamRemarkParser::processRemark(BitstreamRemarkParserHelper &Helper) {
>> R.Hotness = *Helper.Hotness;
>>
>> if (!Helper.Args)
>> - return std::move(Result);
>> + return Result;
>>
>> for (const BitstreamRemarkParserHelper::Argument &Arg : *Helper.Args) {
>> if (!Arg.KeyIdx)
>> @@ -600,5 +600,5 @@ BitstreamRemarkParser::processRemark(BitstreamRemarkParserHelper &Helper) {
>> }
>> }
>>
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> diff --git a/llvm/lib/Remarks/YAMLRemarkParser.cpp b/llvm/lib/Remarks/YAMLRemarkParser.cpp
>> index dd834d85676e..a48b2b85d69f 100644
>> --- a/llvm/lib/Remarks/YAMLRemarkParser.cpp
>> +++ b/llvm/lib/Remarks/YAMLRemarkParser.cpp
>> @@ -164,7 +164,7 @@ remarks::createYAMLParserFromMeta(StringRef Buf,
>> : std::make_unique<YAMLRemarkParser>(Buf);
>> if (SeparateBuf)
>> Result->SeparateBuf = std::move(SeparateBuf);
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> YAMLRemarkParser::YAMLRemarkParser(StringRef Buf)
>> @@ -190,7 +190,7 @@ Error YAMLRemarkParser::error() {
>> Expected<std::unique_ptr<Remark>>
>> YAMLRemarkParser::parseRemark(yaml::Document &RemarkEntry) {
>> if (Error E = error())
>> - return std::move(E);
>> + return E;
>>
>> yaml::Node *YAMLRoot = RemarkEntry.getRoot();
>> if (!YAMLRoot) {
>> @@ -267,7 +267,7 @@ YAMLRemarkParser::parseRemark(yaml::Document &RemarkEntry) {
>> return error("Type, Pass, Name or Function missing.",
>> *RemarkEntry.getRoot());
>>
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> Expected<Type> YAMLRemarkParser::parseType(yaml::MappingNode &Node) {
>>
>> diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
>> index 03f0bb1f705e..6b72593dae45 100644
>> --- a/llvm/lib/Support/APFloat.cpp
>> +++ b/llvm/lib/Support/APFloat.cpp
>> @@ -2518,7 +2518,7 @@ IEEEFloat::convertFromDecimalString(StringRef str, roundingMode rounding_mode) {
>> /* Scan the text. */
>> StringRef::iterator p = str.begin();
>> if (Error Err = interpretDecimal(p, str.end(), &D))
>> - return std::move(Err);
>> + return Err;
>>
>> /* Handle the quick cases. First the case of no significant digits,
>> i.e. zero, and then exponents that are obviously too large or too
>>
>> diff --git a/llvm/lib/Support/FileCheck.cpp b/llvm/lib/Support/FileCheck.cpp
>> index 23e1ece2113e..5c5a510afe5c 100644
>> --- a/llvm/lib/Support/FileCheck.cpp
>> +++ b/llvm/lib/Support/FileCheck.cpp
>> @@ -86,7 +86,7 @@ Expected<uint64_t> BinaryOperation::eval() const {
>> Err = joinErrors(std::move(Err), LeftOp.takeError());
>> if (!RightOp)
>> Err = joinErrors(std::move(Err), RightOp.takeError());
>> - return std::move(Err);
>> + return Err;
>> }
>>
>> return EvalBinop(*LeftOp, *RightOp);
>> @@ -284,7 +284,7 @@ Pattern::parseBinop(StringRef &Expr, std::unique_ptr<ExpressionAST> LeftOp,
>> FileCheckPatternContext *Context, const SourceMgr &SM) {
>> Expr = Expr.ltrim(SpaceChars);
>> if (Expr.empty())
>> - return std::move(LeftOp);
>> + return LeftOp;
>>
>> // Check if this is a supported operation and select a function to perform
>> // it.
>> @@ -425,7 +425,7 @@ Expected<std::unique_ptr<Expression>> Pattern::parseNumericSubstitutionBlock(
>> DefinedNumericVariable = *ParseResult;
>> }
>>
>> - return std::move(ExpressionPointer);
>> + return ExpressionPointer;
>> }
>>
>> bool Pattern::parsePattern(StringRef PatternStr, StringRef Prefix,
>>
>> diff --git a/llvm/lib/Support/JSON.cpp b/llvm/lib/Support/JSON.cpp
>> index 16b1d11efd08..d44eafaca727 100644
>> --- a/llvm/lib/Support/JSON.cpp
>> +++ b/llvm/lib/Support/JSON.cpp
>> @@ -513,7 +513,7 @@ Expected<Value> parse(StringRef JSON) {
>> if (P.checkUTF8())
>> if (P.parseValue(E))
>> if (P.assertEnd())
>> - return std::move(E);
>> + return E;
>> return P.takeError();
>> }
>> char ParseError::ID = 0;
>>
>> diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp
>> index e4027ca7bbfd..a7c7c357fe2f 100644
>> --- a/llvm/lib/Support/MemoryBuffer.cpp
>> +++ b/llvm/lib/Support/MemoryBuffer.cpp
>> @@ -128,7 +128,7 @@ getMemBufferCopyImpl(StringRef InputData, const Twine &BufferName) {
>> if (!Buf)
>> return make_error_code(errc::not_enough_memory);
>> memcpy(Buf->getBufferStart(), InputData.data(), InputData.size());
>> - return std::move(Buf);
>> + return Buf;
>> }
>>
>> std::unique_ptr<MemoryBuffer>
>> @@ -398,7 +398,7 @@ getReadWriteFile(const Twine &Filename, uint64_t FileSize, uint64_t MapSize,
>> Offset, EC));
>> if (EC)
>> return EC;
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> ErrorOr<std::unique_ptr<WriteThroughMemoryBuffer>>
>> @@ -450,7 +450,7 @@ getOpenFileImpl(sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize,
>> new (NamedBufferAlloc(Filename)) MemoryBufferMMapFile<MB>(
>> RequiresNullTerminator, FD, MapSize, Offset, EC));
>> if (!EC)
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> auto Buf = WritableMemoryBuffer::getNewUninitMemBuffer(MapSize, Filename);
>> @@ -475,7 +475,7 @@ getOpenFileImpl(sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize,
>> Offset += *ReadBytes;
>> }
>>
>> - return std::move(Buf);
>> + return Buf;
>> }
>>
>> ErrorOr<std::unique_ptr<MemoryBuffer>>
>>
>> diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
>> index fa3bf47569e8..85698f1289bf 100644
>> --- a/llvm/lib/Support/Path.cpp
>> +++ b/llvm/lib/Support/Path.cpp
>> @@ -1264,7 +1264,7 @@ Expected<TempFile> TempFile::create(const Twine &Model, unsigned Mode) {
>> return errorCodeToError(EC);
>> }
>> #endif
>> - return std::move(Ret);
>> + return Ret;
>> }
>> }
>>
>>
>> diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp
>> index 5f0cedc71829..de7da63609e1 100644
>> --- a/llvm/lib/Support/YAMLTraits.cpp
>> +++ b/llvm/lib/Support/YAMLTraits.cpp
>> @@ -388,7 +388,7 @@ std::unique_ptr<Input::HNode> Input::createHNodes(Node *N) {
>> break;
>> SQHNode->Entries.push_back(std::move(Entry));
>> }
>> - return std::move(SQHNode);
>> + return SQHNode;
>> } else if (MappingNode *Map = dyn_cast<MappingNode>(N)) {
>> auto mapHNode = std::make_unique<MapHNode>(N);
>> for (KeyValueNode &KVN : *Map) {
>> @@ -413,7 +413,7 @@ std::unique_ptr<Input::HNode> Input::createHNodes(Node *N) {
>> break;
>> mapHNode->Mapping[KeyStr] = std::move(ValueHNode);
>> }
>> - return std::move(mapHNode);
>> + return mapHNode;
>> } else if (isa<NullNode>(N)) {
>> return std::make_unique<EmptyHNode>(N);
>> } else {
>>
>> diff --git a/llvm/lib/TableGen/JSONBackend.cpp b/llvm/lib/TableGen/JSONBackend.cpp
>> index 196644cda667..b2e6be6a04f5 100644
>> --- a/llvm/lib/TableGen/JSONBackend.cpp
>> +++ b/llvm/lib/TableGen/JSONBackend.cpp
>> @@ -54,7 +54,7 @@ json::Value JSONEmitter::translateInit(const Init &I) {
>> json::Array array;
>> for (unsigned i = 0, limit = Bits->getNumBits(); i < limit; i++)
>> array.push_back(translateInit(*Bits->getBit(i)));
>> - return std::move(array);
>> + return array;
>> } else if (auto *Int = dyn_cast<IntInit>(&I)) {
>> return Int->getValue();
>> } else if (auto *Str = dyn_cast<StringInit>(&I)) {
>> @@ -65,7 +65,7 @@ json::Value JSONEmitter::translateInit(const Init &I) {
>> json::Array array;
>> for (auto val : *List)
>> array.push_back(translateInit(*val));
>> - return std::move(array);
>> + return array;
>> }
>>
>> // Init subclasses that we return as JSON objects containing a
>> @@ -79,17 +79,17 @@ json::Value JSONEmitter::translateInit(const Init &I) {
>> if (auto *Def = dyn_cast<DefInit>(&I)) {
>> obj["kind"] = "def";
>> obj["def"] = Def->getDef()->getName();
>> - return std::move(obj);
>> + return obj;
>> } else if (auto *Var = dyn_cast<VarInit>(&I)) {
>> obj["kind"] = "var";
>> obj["var"] = Var->getName();
>> - return std::move(obj);
>> + return obj;
>> } else if (auto *VarBit = dyn_cast<VarBitInit>(&I)) {
>> if (auto *Var = dyn_cast<VarInit>(VarBit->getBitVar())) {
>> obj["kind"] = "varbit";
>> obj["var"] = Var->getName();
>> obj["index"] = VarBit->getBitNum();
>> - return std::move(obj);
>> + return obj;
>> }
>> } else if (auto *Dag = dyn_cast<DagInit>(&I)) {
>> obj["kind"] = "dag";
>> @@ -107,7 +107,7 @@ json::Value JSONEmitter::translateInit(const Init &I) {
>> args.push_back(std::move(arg));
>> }
>> obj["args"] = std::move(args);
>> - return std::move(obj);
>> + return obj;
>> }
>>
>> // Final fallback: anything that gets past here is simply given a
>> @@ -116,7 +116,7 @@ json::Value JSONEmitter::translateInit(const Init &I) {
>>
>> assert(!I.isConcrete());
>> obj["kind"] = "complex";
>> - return std::move(obj);
>> + return obj;
>> }
>>
>> void JSONEmitter::run(raw_ostream &OS) {
>>
>> diff --git a/llvm/lib/TextAPI/ELF/TBEHandler.cpp b/llvm/lib/TextAPI/ELF/TBEHandler.cpp
>> index cb597d8896e8..f1357e1112ad 100644
>> --- a/llvm/lib/TextAPI/ELF/TBEHandler.cpp
>> +++ b/llvm/lib/TextAPI/ELF/TBEHandler.cpp
>> @@ -149,7 +149,7 @@ Expected<std::unique_ptr<ELFStub>> elfabi::readTBEFromBuffer(StringRef Buf) {
>> if (std::error_code Err = YamlIn.error())
>> return createStringError(Err, "YAML failed reading as TBE");
>>
>> - return std::move(Stub);
>> + return Stub;
>> }
>>
>> Error elfabi::writeTBEToOutputStream(raw_ostream &OS, const ELFStub &Stub) {
>>
>> diff --git a/llvm/lib/TextAPI/MachO/TextStub.cpp b/llvm/lib/TextAPI/MachO/TextStub.cpp
>> index cdfe7f47ee61..2a99d35a5ab0 100644
>> --- a/llvm/lib/TextAPI/MachO/TextStub.cpp
>> +++ b/llvm/lib/TextAPI/MachO/TextStub.cpp
>> @@ -1122,7 +1122,7 @@ TextAPIReader::get(MemoryBufferRef InputBuffer) {
>> if (YAMLIn.error())
>> return make_error<StringError>(Ctx.ErrorMessage, YAMLIn.error());
>>
>> - return std::move(File);
>> + return File;
>> }
>>
>> Error TextAPIWriter::writeToStream(raw_ostream &OS, const InterfaceFile &File) {
>>
>> diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
>> index 55b5c0377f28..a349020b3235 100644
>> --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
>> +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
>> @@ -1154,7 +1154,7 @@ Expected<bool> FunctionImporter::importFunctions(
>> // If modules were created with lazy metadata loading, materialize it
>> // now, before linking it (otherwise this will be a noop).
>> if (Error Err = SrcModule->materializeMetadata())
>> - return std::move(Err);
>> + return Err;
>>
>> auto &ImportGUIDs = FunctionsToImportPerModule->second;
>> // Find the globals to import
>> @@ -1169,7 +1169,7 @@ Expected<bool> FunctionImporter::importFunctions(
>> << SrcModule->getSourceFileName() << "\n");
>> if (Import) {
>> if (Error Err = F.materialize())
>> - return std::move(Err);
>> + return Err;
>> if (EnableImportMetadata) {
>> // Add 'thinlto_src_module' metadata for statistics and debugging.
>> F.setMetadata(
>> @@ -1191,7 +1191,7 @@ Expected<bool> FunctionImporter::importFunctions(
>> << SrcModule->getSourceFileName() << "\n");
>> if (Import) {
>> if (Error Err = GV.materialize())
>> - return std::move(Err);
>> + return Err;
>> ImportedGVCount += GlobalsToImport.insert(&GV);
>> }
>> }
>> @@ -1205,11 +1205,11 @@ Expected<bool> FunctionImporter::importFunctions(
>> << SrcModule->getSourceFileName() << "\n");
>> if (Import) {
>> if (Error Err = GA.materialize())
>> - return std::move(Err);
>> + return Err;
>> // Import alias as a copy of its aliasee.
>> GlobalObject *Base = GA.getBaseObject();
>> if (Error Err = Base->materialize())
>> - return std::move(Err);
>> + return Err;
>> auto *Fn = replaceAliasWithAliasee(SrcModule.get(), &GA);
>> LLVM_DEBUG(dbgs() << "Is importing aliasee fn " << Base->getGUID()
>> << " " << Base->getName() << " from "
>>
>> diff --git a/llvm/lib/XRay/FDRRecordProducer.cpp b/llvm/lib/XRay/FDRRecordProducer.cpp
>> index 479b710444be..0a5ece55bee6 100644
>> --- a/llvm/lib/XRay/FDRRecordProducer.cpp
>> +++ b/llvm/lib/XRay/FDRRecordProducer.cpp
>> @@ -101,8 +101,8 @@ FileBasedRecordProducer::findNextBufferExtent() {
>> R = std::move(MetadataRecordOrErr.get());
>> RecordInitializer RI(E, OffsetPtr);
>> if (auto Err = R->apply(RI))
>> - return std::move(Err);
>> - return std::move(R);
>> + return Err;
>> + return R;
>> }
>> }
>> }
>> @@ -132,7 +132,7 @@ Expected<std::unique_ptr<Record>> FileBasedRecordProducer::produce() {
>> assert(isa<BufferExtents>(R.get()));
>> auto BE = cast<BufferExtents>(R.get());
>> CurrentBufferBytes = BE->size();
>> - return std::move(R);
>> + return R;
>> }
>>
>> //
>> @@ -172,7 +172,7 @@ Expected<std::unique_ptr<Record>> FileBasedRecordProducer::produce() {
>> RecordInitializer RI(E, OffsetPtr);
>>
>> if (auto Err = R->apply(RI))
>> - return std::move(Err);
>> + return Err;
>>
>> // If we encountered a BufferExtents record, we should record the remaining
>> // bytes for the current buffer, to determine when we should start ignoring
>> @@ -191,7 +191,7 @@ Expected<std::unique_ptr<Record>> FileBasedRecordProducer::produce() {
>> CurrentBufferBytes -= OffsetPtr - PreReadOffset;
>> }
>> assert(R != nullptr);
>> - return std::move(R);
>> + return R;
>> }
>>
>> } // namespace xray
>>
>> diff --git a/llvm/lib/XRay/FileHeaderReader.cpp b/llvm/lib/XRay/FileHeaderReader.cpp
>> index 6b6daf9deba5..e0cb40df2063 100644
>> --- a/llvm/lib/XRay/FileHeaderReader.cpp
>> +++ b/llvm/lib/XRay/FileHeaderReader.cpp
>> @@ -66,7 +66,7 @@ Expected<XRayFileHeader> readBinaryFormatHeader(DataExtractor &HeaderExtractor,
>> // Manually advance the offset pointer 16 bytes, after getting a raw memcpy
>> // from the underlying data.
>> OffsetPtr += 16;
>> - return std::move(FileHeader);
>> + return FileHeader;
>> }
>>
>> } // namespace xray
>>
>> diff --git a/llvm/lib/XRay/InstrumentationMap.cpp b/llvm/lib/XRay/InstrumentationMap.cpp
>> index 1e9b69a5f9dc..79c343fe8db7 100644
>> --- a/llvm/lib/XRay/InstrumentationMap.cpp
>> +++ b/llvm/lib/XRay/InstrumentationMap.cpp
>> @@ -232,26 +232,26 @@ llvm::xray::loadInstrumentationMap(StringRef Filename) {
>> if (!FdOrErr) {
>> // Report the ELF load error if YAML failed.
>> consumeError(FdOrErr.takeError());
>> - return std::move(E);
>> + return E;
>> }
>>
>> uint64_t FileSize;
>> if (sys::fs::file_size(Filename, FileSize))
>> - return std::move(E);
>> + return E;
>>
>> // If the file is empty, we return the original error.
>> if (FileSize == 0)
>> - return std::move(E);
>> + return E;
>>
>> // From this point on the errors will be only for the YAML parts, so we
>> // consume the errors at this point.
>> consumeError(std::move(E));
>> if (auto E = loadYAML(*FdOrErr, FileSize, Filename, Map.Sleds,
>> Map.FunctionAddresses, Map.FunctionIds))
>> - return std::move(E);
>> + return E;
>> } else if (auto E = loadObj(Filename, *ObjectFileOrError, Map.Sleds,
>> Map.FunctionAddresses, Map.FunctionIds)) {
>> - return std::move(E);
>> + return E;
>> }
>> return Map;
>> }
>>
>> diff --git a/llvm/lib/XRay/Profile.cpp b/llvm/lib/XRay/Profile.cpp
>> index c1a43632b600..8aa8eaf9b74b 100644
>> --- a/llvm/lib/XRay/Profile.cpp
>> +++ b/llvm/lib/XRay/Profile.cpp
>> @@ -90,7 +90,7 @@ static Expected<std::vector<Profile::FuncID>> readPath(DataExtractor &Extractor,
>> CurrentOffset = Offset;
>> Path.push_back(FuncId);
>> } while (FuncId != 0);
>> - return std::move(Path);
>> + return Path;
>> }
>>
>> static Expected<Profile::Data> readData(DataExtractor &Extractor,
>> @@ -137,7 +137,7 @@ Expected<std::vector<Profile::FuncID>> Profile::expandPath(PathID P) const {
>> std::vector<Profile::FuncID> Path;
>> for (auto Node = It->second; Node; Node = Node->Caller)
>> Path.push_back(Node->Func);
>> - return std::move(Path);
>> + return Path;
>> }
>>
>> Profile::PathID Profile::internPath(ArrayRef<FuncID> P) {
>> @@ -308,7 +308,7 @@ Expected<Profile> loadProfile(StringRef Filename) {
>> if (auto E =
>> P.addBlock(Profile::Block{Profile::ThreadID{Header.Thread},
>> {{P.internPath(Path), std::move(Data)}}}))
>> - return std::move(E);
>> + return E;
>> }
>>
>> return P;
>> @@ -393,7 +393,7 @@ Expected<Profile> profileFromTrace(const Trace &T) {
>> std::vector<std::pair<Profile::PathID, Profile::Data>>(
>> PathsData.begin(), PathsData.end()),
>> }))
>> - return std::move(E);
>> + return E;
>> }
>>
>> return P;
>>
>> diff --git a/llvm/lib/XRay/Trace.cpp b/llvm/lib/XRay/Trace.cpp
>> index 4f107e1059cc..48c6fc9039a8 100644
>> --- a/llvm/lib/XRay/Trace.cpp
>> +++ b/llvm/lib/XRay/Trace.cpp
>> @@ -443,7 +443,7 @@ Expected<Trace> llvm::xray::loadTrace(const DataExtractor &DE, bool Sort) {
>> if (Version == 1 || Version == 2 || Version == 3) {
>> if (auto E = loadNaiveFormatLog(DE.getData(), DE.isLittleEndian(),
>> T.FileHeader, T.Records))
>> - return std::move(E);
>> + return E;
>> } else {
>> return make_error<StringError>(
>> Twine("Unsupported version for Basic/Naive Mode logging: ") +
>> @@ -455,7 +455,7 @@ Expected<Trace> llvm::xray::loadTrace(const DataExtractor &DE, bool Sort) {
>> if (Version >= 1 && Version <= 5) {
>> if (auto E = loadFDRLog(DE.getData(), DE.isLittleEndian(), T.FileHeader,
>> T.Records))
>> - return std::move(E);
>> + return E;
>> } else {
>> return make_error<StringError>(
>> Twine("Unsupported version for FDR Mode logging: ") + Twine(Version),
>> @@ -464,7 +464,7 @@ Expected<Trace> llvm::xray::loadTrace(const DataExtractor &DE, bool Sort) {
>> break;
>> default:
>> if (auto E = loadYAMLLog(DE.getData(), T.FileHeader, T.Records))
>> - return std::move(E);
>> + return E;
>> }
>>
>> if (Sort)
>> @@ -472,5 +472,5 @@ Expected<Trace> llvm::xray::loadTrace(const DataExtractor &DE, bool Sort) {
>> return L.TSC < R.TSC;
>> });
>>
>> - return std::move(T);
>> + return T;
>> }
>>
>> diff --git a/llvm/tools/bugpoint/ExecutionDriver.cpp b/llvm/tools/bugpoint/ExecutionDriver.cpp
>> index 4c83a9598976..0aa58372dc2b 100644
>> --- a/llvm/tools/bugpoint/ExecutionDriver.cpp
>> +++ b/llvm/tools/bugpoint/ExecutionDriver.cpp
>> @@ -347,7 +347,7 @@ Expected<std::string> BugDriver::executeProgram(const Module &Program,
>> OutputFile, AdditionalLinkerArgs,
>> SharedObjs, Timeout, MemoryLimit);
>> if (Error E = RetVal.takeError())
>> - return std::move(E);
>> + return E;
>>
>> if (*RetVal == -1) {
>> errs() << "<timeout>";
>> @@ -393,12 +393,12 @@ BugDriver::compileSharedObject(const std::string &BitcodeFile) {
>> Expected<CC::FileType> FT =
>> SafeInterpreter->OutputCode(BitcodeFile, OutputFile);
>> if (Error E = FT.takeError())
>> - return std::move(E);
>> + return E;
>>
>> std::string SharedObjectFile;
>> if (Error E = cc->MakeSharedObject(OutputFile, *FT, SharedObjectFile,
>> AdditionalLinkerArgs))
>> - return std::move(E);
>> + return E;
>>
>> // Remove the intermediate C file
>> sys::fs::remove(OutputFile);
>> @@ -444,7 +444,7 @@ Expected<bool> BugDriver::
>> diff Program(const Module &Program,
>> Expected<std::string> Output =
>> executeProgram(Program, "", BitcodeFile, SharedObject, nullptr);
>> if (Error E = Output.takeError())
>> - return std::move(E);
>> + return E;
>>
>> std::string Error;
>> bool FilesDifferent = false;
>>
>> diff --git a/llvm/tools/bugpoint/ListReducer.h b/llvm/tools/bugpoint/ListReducer.h
>> index 04f2207a31ed..e9445498b6be 100644
>> --- a/llvm/tools/bugpoint/ListReducer.h
>> +++ b/llvm/tools/bugpoint/ListReducer.h
>> @@ -49,7 +49,7 @@ template <typename ElTy> struct ListReducer {
>> std::mt19937 randomness(0x6e5ea738); // Seed the random number generator
>> Expected<TestResult> Result = doTest(TheList, empty);
>> if (Error E = Result.takeError())
>> - return std::move(E);
>> + return E;
>> switch (*Result) {
>> case KeepPrefix:
>> if (TheList.size() == 1) // we are done, it's the base case and it fails
>> @@ -122,7 +122,7 @@ template <typename ElTy> struct ListReducer {
>>
>> Expected<TestResult> Result = doTest(Prefix, Suffix);
>> if (Error E = Result.takeError())
>> - return std::move(E);
>> + return E;
>> switch (*Result) {
>> case KeepSuffix:
>> // The property still holds. We can just drop the prefix elements, and
>> @@ -185,7 +185,7 @@ template <typename ElTy> struct ListReducer {
>>
>> Expected<TestResult> Result = doTest(EmptyList, TestList);
>> if (Error E = Result.takeError())
>> - return std::move(E);
>> + return E;
>> if (*Result == KeepSuffix) {
>> // We can trim down the list!
>> TheList.swap(TestList);
>>
>> diff --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp
>> index e69fe9ff6c15..cd5eb19d3afc 100644
>> --- a/llvm/tools/bugpoint/Miscompilation.cpp
>> +++ b/llvm/tools/bugpoint/Miscompilation.cpp
>> @@ -82,7 +82,7 @@ ReduceMiscompilingPasses::doTest(std::vector<std::string> &Prefix,
>> Expected<bool> Diff = BD.
>> diff Program(BD.getProgram(), BitcodeResult, "",
>> true /*delete bitcode*/);
>> if (Error E = Diff.takeError())
>> - return std::move(E);
>> + return E;
>> if (*Diff) {
>> outs() << " nope.\n";
>> if (Suffix.empty()) {
>> @@ -123,7 +123,7 @@ ReduceMiscompilingPasses::doTest(std::vector<std::string> &Prefix,
>> // If the prefix maintains the predicate by itself, only keep the prefix!
>> Diff = BD.
>> diff Program(BD.getProgram(), BitcodeResult, "", false);
>> if (Error E = Diff.takeError())
>> - return std::move(E);
>> + return E;
>> if (*Diff) {
>> outs() << " nope.\n";
>> sys::fs::remove(BitcodeResult);
>> @@ -169,7 +169,7 @@ ReduceMiscompilingPasses::doTest(std::vector<std::string> &Prefix,
>> Diff = BD.
>> diff Program(BD.getProgram(), BitcodeResult, "",
>> true /*delete bitcode*/);
>> if (Error E = Diff.takeError())
>> - return std::move(E);
>> + return E;
>> if (*Diff) {
>> outs() << " nope.\n";
>> return KeepSuffix;
>> @@ -200,14 +200,14 @@ class ReduceMiscompilingFunctions : public ListReducer<Function *> {
>> if (!Suffix.empty()) {
>> Expected<bool> Ret = TestFuncs(Suffix);
>> if (Error E = Ret.takeError())
>> - return std::move(E);
>> + return E;
>> if (*Ret)
>> return KeepSuffix;
>> }
>> if (!Prefix.empty()) {
>> Expected<bool> Ret = TestFuncs(Prefix);
>> if (Error E = Ret.takeError())
>> - return std::move(E);
>> + return E;
>> if (*Ret)
>> return KeepPrefix;
>> }
>> @@ -237,9 +237,9 @@ static Expected<std::unique_ptr<Module>> testMergedProgram(const BugDriver &BD,
>> // Execute the program.
>> Expected<bool> Diff = BD.
>> diff Program(*Merged, "", "", false);
>> if (Error E = Diff.takeError())
>> - return std::move(E);
>> + return E;
>> Broken = *Diff;
>> - return std::move(Merged);
>> + return Merged;
>> }
>>
>> /// split functions in a Module into two groups: those that are under
>> @@ -335,7 +335,7 @@ ExtractLoops(BugDriver &BD,
>> Expected<std::unique_ptr<Module>> New = testMergedProgram(
>> BD, *ToOptimizeLoopExtracted, *ToNotOptimize, Failure);
>> if (Error E = New.takeError())
>> - return std::move(E);
>> + return E;
>> if (!*New)
>> return false;
>>
>> @@ -377,7 +377,7 @@ ExtractLoops(BugDriver &BD,
>> Expected<bool> Result = TestFn(BD, std::move(ToOptimizeLoopExtracted),
>> std::move(ToNotOptimize));
>> if (Error E = Result.takeError())
>> - return std::move(E);
>> + return E;
>>
>> ToOptimizeLoopExtracted = std::move(TOLEBackup);
>> ToNotOptimize = std::move(TNOBackup);
>> @@ -462,14 +462,14 @@ class ReduceMiscompiledBlocks : public ListReducer<BasicBlock *> {
>> if (!Suffix.empty()) {
>> Expected<bool> Ret = TestFuncs(Suffix);
>> if (Error E = Ret.takeError())
>> - return std::move(E);
>> + return E;
>> if (*Ret)
>> return KeepSuffix;
>> }
>> if (!Prefix.empty()) {
>> Expected<bool> Ret = TestFuncs(Prefix);
>> if (Error E = Ret.takeError())
>> - return std::move(E);
>> + return E;
>> if (*Ret)
>> return KeepPrefix;
>> }
>> @@ -556,7 +556,7 @@ ExtractBlocks(BugDriver &BD,
>> Expected<bool> Ret = ReduceMiscompiledBlocks(BD, TestFn, MiscompiledFunctions)
>> .TestFuncs(std::vector<BasicBlock *>());
>> if (Error E = Ret.takeError())
>> - return std::move(E);
>> + return E;
>> if (*Ret) {
>> Blocks.clear();
>> } else {
>> @@ -564,7 +564,7 @@ ExtractBlocks(BugDriver &BD,
>> ReduceMiscompiledBlocks(BD, TestFn, MiscompiledFunctions)
>> .reduceList(Blocks);
>> if (Error E = Ret.takeError())
>> - return std::move(E);
>> + return E;
>> if (Blocks.size() == OldSize)
>> return false;
>> }
>> @@ -632,7 +632,7 @@ static Expected<std::vector<Function *>> DebugAMiscompilation(
>> .reduceList(MiscompiledFunctions);
>> if (Error E = Ret.takeError()) {
>> errs() << "\n***Cannot reduce functions: ";
>> - return std::move(E);
>> + return E;
>> }
>> }
>> outs() << "\n*** The following function"
>> @@ -647,7 +647,7 @@ static Expected<std::vector<Function *>> DebugAMiscompilation(
>> if (!BugpointIsInterrupted && !DisableLoopExtraction) {
>> Expected<bool> Ret = ExtractLoops(BD, TestFn, MiscompiledFunctions);
>> if (Error E = Ret.takeError())
>> - return std::move(E);
>> + return E;
>> if (*Ret) {
>> // Okay, we extracted some loops and the problem still appears. See if
>> // we can eliminate some of the created functions from being candidates.
>> @@ -658,7 +658,7 @@ static Expected<std::vector<Function *>> DebugAMiscompilation(
>> Ret = ReduceMiscompilingFunctions(BD, TestFn)
>> .reduceList(MiscompiledFunctions);
>> if (Error E = Ret.takeError())
>> - return std::move(E);
>> + return E;
>>
>> outs() << "\n*** The following function"
>> << (MiscompiledFunctions.size() == 1 ? " is" : "s are")
>> @@ -671,7 +671,7 @@ static Expected<std::vector<Function *>> DebugAMiscompilation(
>> if (!BugpointIsInterrupted && !DisableBlockExtraction) {
>> Expected<bool> Ret = ExtractBlocks(BD, TestFn, MiscompiledFunctions);
>> if (Error E = Ret.takeError())
>> - return std::move(E);
>> + return E;
>> if (*Ret) {
>> // Okay, we extracted some blocks and the problem still appears. See if
>> // we can eliminate some of the created functions from being candidates.
>> @@ -681,7 +681,7 @@ static Expected<std::vector<Function *>> DebugAMiscompilation(
>> Ret = ReduceMiscompilingFunctions(BD, TestFn)
>> .reduceList(MiscompiledFunctions);
>> if (Error E = Ret.takeError())
>> - return std::move(E);
>> + return E;
>>
>> outs() << "\n*** The following function"
>> << (MiscompiledFunctions.size() == 1 ? " is" : "s are")
>> @@ -711,7 +711,7 @@ static Expected<bool> TestOptimizer(BugDriver &BD, std::unique_ptr<Module> Test,
>> BD.EmitProgressBitcode(*Test, "pass-error", false);
>> BD.setNewProgram(std::move(Test));
>> if (Error E = BD.debugOptimizerCrash())
>> - return std::move(E);
>> + return E;
>> return false;
>> }
>> outs() << "done.\n";
>> @@ -720,7 +720,7 @@ static Expected<bool> TestOptimizer(BugDriver &BD, std::unique_ptr<Module> Test,
>> bool Broken;
>> auto Result = testMergedProgram(BD, *Optimized, *Safe, Broken);
>> if (Error E = Result.takeError())
>> - return std::move(E);
>> + return E;
>> if (auto New = std::move(*Result)) {
>> outs() << (Broken ? " nope.\n" : " yup.\n");
>> // Delete the original and set the new program.
>> @@ -987,7 +987,7 @@ static Expected<bool> TestCodeGenerator(BugDriver &BD,
>> Expected<std::string> SharedObject =
>> BD.compileSharedObject(std::string(SafeModuleBC.str()));
>> if (Error E = SharedObject.takeError())
>> - return std::move(E);
>> + return E;
>>
>> FileRemover SharedObjectRemover(*SharedObject, !SaveTemps);
>>
>> @@ -996,7 +996,7 @@ static Expected<bool> TestCodeGenerator(BugDriver &BD,
>> Expected<bool> Result = BD.
>> diff Program(
>> BD.getProgram(), std::string(TestModuleBC.str()), *SharedObject, false);
>> if (Error E = Result.takeError())
>> - return std::move(E);
>> + return E;
>>
>> if (*Result)
>> errs() << ": still failing!\n";
>>
>> diff --git a/llvm/tools/bugpoint/ToolRunner.cpp b/llvm/tools/bugpoint/ToolRunner.cpp
>> index d880aca044d1..2fc2d9bdf9b6 100644
>> --- a/llvm/tools/bugpoint/ToolRunner.cpp
>> +++ b/llvm/tools/bugpoint/ToolRunner.cpp
>> @@ -492,7 +492,7 @@ Expected<int> LLC::ExecuteProgram(const std::string &Bitcode,
>> OutputCode(Bitcode, OutputAsmFile, Timeout, MemoryLimit);
>> FileRemover OutFileRemover(OutputAsmFile, !SaveTemps);
>> if (Error E = FileKind.takeError())
>> - return std::move(E);
>> + return E;
>>
>> std::vector<std::string> CCArgs(ArgsForCC);
>> CCArgs.insert(CCArgs.end(), SharedLibs.begin(), SharedLibs.end());
>>
>> diff --git a/llvm/tools/dsymutil/BinaryHolder.cpp b/llvm/tools/dsymutil/BinaryHolder.cpp
>> index 31d32d8d8e80..ba3ecbeb2957 100644
>> --- a/llvm/tools/dsymutil/BinaryHolder.cpp
>> +++ b/llvm/tools/dsymutil/BinaryHolder.cpp
>> @@ -197,7 +197,7 @@ BinaryHolder::ArchiveEntry::getObjectEntry(StringRef Filename,
>> }
>> }
>> if (Err)
>> - return std::move(Err);
>> + return Err;
>> }
>>
>> if (OE.Objects.empty())
>> @@ -243,7 +243,7 @@ BinaryHolder::getObjectEntry(StringRef Filename, TimestampTy Timestamp) {
>> auto Err = OE.load(Filename, Verbose);
>> if (Err) {
>> ObjectCache.erase(Filename);
>> - return std::move(Err);
>> + return Err;
>> }
>> }
>>
>>
>> diff --git a/llvm/tools/dsymutil/DebugMap.cpp b/llvm/tools/dsymutil/DebugMap.cpp
>> index 41067106e02c..f6c3400b49b7 100644
>> --- a/llvm/tools/dsymutil/DebugMap.cpp
>> +++ b/llvm/tools/dsymutil/DebugMap.cpp
>> @@ -142,7 +142,7 @@ DebugMap::parseYAMLDebugMap(StringRef InputFile, StringRef PrependPath,
>> return EC;
>> std::vector<std::unique_ptr<DebugMap>> Result;
>> Result.push_back(std::move(Res));
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> } // end namespace dsymutil
>>
>> diff --git a/llvm/tools/dsymutil/MachODebugMapParser.cpp b/llvm/tools/dsymutil/MachODebugMapParser.cpp
>> index 83703fb13f0a..087f514bfcdc 100644
>> --- a/llvm/tools/dsymutil/MachODebugMapParser.cpp
>> +++ b/llvm/tools/dsymutil/MachODebugMapParser.cpp
>> @@ -391,7 +391,7 @@ ErrorOr<std::vector<std::unique_ptr<DebugMap>>> MachODebugMapParser::parse() {
>> if (shouldLinkArch(Archs, Object->getArchTriple().getArchName()))
>> Results.push_back(parseOneBinary(*Object, BinaryPath));
>>
>> - return std::move(Results);
>> + return Results;
>> }
>>
>> /// Interpret the STAB entries to fill the DebugMap.
>>
>> diff --git a/llvm/tools/dsymutil/dsymutil.cpp b/llvm/tools/dsymutil/dsymutil.cpp
>> index 6b2608160aea..fa5ac47ef409 100644
>> --- a/llvm/tools/dsymutil/dsymutil.cpp
>> +++ b/llvm/tools/dsymutil/dsymutil.cpp
>> @@ -279,7 +279,7 @@ static Expected<DsymutilOptions> getOptions(opt::InputArgList &Args) {
>> }
>>
>> if (Error E = verifyOptions(Options))
>> - return std::move(E);
>> + return E;
>> return Options;
>> }
>>
>> @@ -433,9 +433,9 @@ getOutputFileName(StringRef InputFile, const DsymutilOptions &Options) {
>> Path = DwarfFile + ".dSYM";
>> if (!Options.LinkOpts.NoOutput) {
>> if (auto E = createBundleDir(Path))
>> - return std::move(E);
>> + return E;
>> if (auto E = createPlistFile(DwarfFile, Path, Options.Toolchain))
>> - return std::move(E);
>> + return E;
>> }
>>
>> sys::path::append(Path, "Contents", "Resources");
>>
>> diff --git a/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp b/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
>> index 639a6d1ec02c..3307facf7fad 100644
>> --- a/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
>> +++ b/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
>> @@ -73,14 +73,14 @@ static Expected<std::unique_ptr<MemoryBuffer>> openBitcodeFile(StringRef Path) {
>> Expected<std::unique_ptr<MemoryBuffer>> MemBufOrErr =
>> errorOrToExpected(MemoryBuffer::getFileOrSTDIN(Path));
>> if (Error E = MemBufOrErr.takeError())
>> - return std::move(E);
>> + return E;
>>
>> std::unique_ptr<MemoryBuffer> MemBuf = std::move(*MemBufOrErr);
>>
>> if (MemBuf->getBufferSize() & 3)
>> return reportError(
>> "Bitcode stream should be a multiple of 4 bytes in length");
>> - return std::move(MemBuf);
>> + return MemBuf;
>> }
>>
>> int main(int argc, char **argv) {
>>
>> diff --git a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
>> index d2b4db3b5751..8b0d257232f6 100644
>> --- a/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
>> +++ b/llvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
>> @@ -100,15 +100,15 @@ Expected<FileAnalysis> FileAnalysis::Create(StringRef Filename) {
>>
>> // Init the rest of the object.
>> if (auto InitResponse = Analysis.initialiseDisassemblyMembers())
>> - return std::move(InitResponse);
>> + return InitResponse;
>>
>> if (auto SectionParseResponse = Analysis.parseCodeSections())
>> - return std::move(SectionParseResponse);
>> + return SectionParseResponse;
>>
>> if (auto SymbolTableParseResponse = Analysis.parseSymbolTable())
>> - return std::move(SymbolTableParseResponse);
>> + return SymbolTableParseResponse;
>>
>> - return std::move(Analysis);
>> + return Analysis;
>> }
>>
>> FileAnalysis::FileAnalysis(object::OwningBinary<object::Binary> Binary)
>>
>> diff --git a/llvm/tools/llvm-cov/SourceCoverageView.cpp b/llvm/tools/llvm-cov/SourceCoverageView.cpp
>> index cd7395a1a87d..c1c3fec709e2 100644
>> --- a/llvm/tools/llvm-cov/SourceCoverageView.cpp
>> +++ b/llvm/tools/llvm-cov/SourceCoverageView.cpp
>> @@ -69,7 +69,7 @@ CoveragePrinter::createOutputStream(StringRef Path, StringRef Extension,
>> auto OS = CoveragePrinter::OwnedStream(RawStream);
>> if (E)
>> return errorCodeToError(E);
>> - return std::move(OS);
>> + return OS;
>> }
>>
>> std::unique_ptr<CoveragePrinter>
>>
>> diff --git a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
>> index 1363e0a52c11..70f8f9454768 100644
>> --- a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
>> +++ b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
>> @@ -295,7 +295,7 @@ CoveragePrinterHTML::createViewFile(StringRef Path, bool InToplevel) {
>> emitPrelude(*OS.get(), Opts, getPathToStyle(ViewPath));
>> }
>>
>> - return std::move(OS);
>> + return OS;
>> }
>>
>> void CoveragePrinterHTML::closeViewFile(OwnedStream OS) {
>>
>> diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp
>> index 23513ef8fb4e..bd629905fc9d 100644
>> --- a/llvm/tools/llvm-dwp/llvm-dwp.cpp
>> +++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp
>> @@ -499,7 +499,7 @@ getDWOFilenames(StringRef ExecFilename) {
>> DWOPaths.push_back(std::move(DWOName));
>> }
>> }
>> - return std::move(DWOPaths);
>> + return DWOPaths;
>> }
>>
>> static Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
>>
>> diff --git a/llvm/tools/llvm-elfabi/ELFObjHandler.cpp b/llvm/tools/llvm-elfabi/ELFObjHandler.cpp
>> index 124fffbb9cf6..420239a1631f 100644
>> --- a/llvm/tools/llvm-elfabi/ELFObjHandler.cpp
>> +++ b/llvm/tools/llvm-elfabi/ELFObjHandler.cpp
>> @@ -309,7 +309,7 @@ buildStub(const ELFObjectFile<ELFT> &ElfObj) {
>> // Collect relevant .dynamic entries.
>> DynamicEntries DynEnt;
>> if (Error Err = populateDynamic<ELFT>(DynEnt, *DynTable))
>> - return std::move(Err);
>> + return Err;
>>
>> // Get pointer to in-memory location of .dynstr section.
>> Expected<const uint8_t *> DynStrPtr =
>> @@ -364,7 +364,7 @@ buildStub(const ELFObjectFile<ELFT> &ElfObj) {
>> "when reading dynamic symbols");
>> }
>>
>> - return std::move(DestStub);
>> + return DestStub;
>> }
>>
>> Expected<std::unique_ptr<ELFStub>> readELFFile(MemoryBufferRef Buf) {
>>
>> diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
>> index 6981aaa46cd9..e93ab457c256 100644
>> --- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
>> +++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
>> @@ -139,7 +139,7 @@ Expected<InstructionBenchmark> BenchmarkRunner::runConfiguration(
>> auto Measurements = runMeasurements(Executor);
>> if (Error E = Measurements.takeError()) {
>> if (!E.isA<SnippetCrash>())
>> - return std::move(E);
>> + return E;
>> InstrBenchmark.Error = toString(std::move(E));
>> return InstrBenchmark;
>> }
>> @@ -163,7 +163,7 @@ BenchmarkRunner::writeObjectFile(const BenchmarkCode &BC,
>> SmallString<256> ResultPath;
>> if (Error E = errorCodeToError(
>> sys::fs::createTemporaryFile("snippet", "o", ResultFD, ResultPath)))
>> - return std::move(E);
>> + return E;
>> raw_fd_ostream OFS(ResultFD, true /*ShouldClose*/);
>> assembleToStream(State.getExegesisTarget(), State.createTargetMachine(),
>> BC.LiveIns, BC.Key.RegisterInitialValues, FillFunction, OFS);
>>
>> diff --git a/llvm/tools/llvm-exegesis/lib/Clustering.cpp b/llvm/tools/llvm-exegesis/lib/Clustering.cpp
>> index 33a8e018f515..e73d6ec8ec90 100644
>> --- a/llvm/tools/llvm-exegesis/lib/Clustering.cpp
>> +++ b/llvm/tools/llvm-exegesis/lib/Clustering.cpp
>> @@ -320,7 +320,7 @@ Expected<InstructionBenchmarkClustering> InstructionBenchmarkClustering::create(
>> InstructionBenchmarkClustering Clustering(
>> Points, AnalysisClusteringEpsilon * AnalysisClusteringEpsilon);
>> if (auto Error = Clustering.validateAndSetup()) {
>> - return std::move(Error);
>> + return Error;
>> }
>> if (Clustering.ErrorCluster_.PointIndices.size() == Points.size()) {
>> return Clustering; // Nothing to cluster.
>>
>> diff --git a/llvm/tools/llvm-exegesis/lib/LatencyBenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/LatencyBenchmarkRunner.cpp
>> index 83a3f0183e39..3134d03685e6 100644
>> --- a/llvm/tools/llvm-exegesis/lib/LatencyBenchmarkRunner.cpp
>> +++ b/llvm/tools/llvm-exegesis/lib/LatencyBenchmarkRunner.cpp
>> @@ -49,7 +49,7 @@ Expected<std::vector<BenchmarkMeasure>> LatencyBenchmarkRunner::runMeasurements(
>> default:
>> break;
>> }
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> } // namespace exegesis
>>
>> diff --git a/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp b/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp
>> index fea6dc95ce82..9c7f7da1072d 100644
>> --- a/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp
>> +++ b/llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp
>> @@ -172,7 +172,7 @@ SerialSnippetGenerator::generateCodeTemplates(
>> if (Results.empty())
>> return make_error<Failure>(
>> "No strategy found to make the execution serial");
>> - return std::move(Results);
>> + return Results;
>> }
>>
>> } // namespace exegesis
>>
>> diff --git a/llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp b/llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp
>> index 21932f416aa7..e7f95d07bf21 100644
>> --- a/llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp
>> +++ b/llvm/tools/llvm-exegesis/lib/SnippetGenerator.cpp
>> @@ -73,7 +73,7 @@ Expected<std::vector<BenchmarkCode>> SnippetGenerator::generateConfigurations(
>> BC.Info = CT.Info;
>> for (InstructionTemplate &IT : CT.Instructions) {
>> if (auto error = randomizeUnsetVariables(State, ForbiddenRegs, IT))
>> - return std::move(error);
>> + return error;
>> BC.Key.Instructions.push_back(IT.build());
>> }
>> if (CT.ScratchSpacePointerInReg)
>> @@ -152,7 +152,7 @@ generateSelfAliasingCodeTemplates(const Instruction &Instr) {
>> setRandomAliasing(SelfAliasing, IT, IT);
>> }
>> CT.Instructions.push_back(std::move(IT));
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> Expected<std::vector<CodeTemplate>>
>> @@ -163,7 +163,7 @@ generateUnconstrainedCodeTemplates(const Instruction &Instr, StringRef Msg) {
>> CT.Info =
>> std::string(formatv("{0}, repeating an unconstrained assignment", Msg));
>> CT.Instructions.emplace_back(&Instr);
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> std::mt19937 &randomGenerator() {
>>
>> diff --git a/llvm/tools/llvm-exegesis/lib/UopsBenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/UopsBenchmarkRunner.cpp
>> index b99b1c5e7113..af5b977b4700 100644
>> --- a/llvm/tools/llvm-exegesis/lib/UopsBenchmarkRunner.cpp
>> +++ b/llvm/tools/llvm-exegesis/lib/UopsBenchmarkRunner.cpp
>> @@ -39,7 +39,7 @@ UopsBenchmarkRunner::runMeasurements(const FunctionExecutor &Executor) const {
>> Result.push_back(
>> BenchmarkMeasure::Create("NumMicroOps", *ExpectedCounterValue));
>> }
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> } // namespace exegesis
>>
>> diff --git a/llvm/tools/llvm-exegesis/lib/X86/Target.cpp b/llvm/tools/llvm-exegesis/lib/X86/Target.cpp
>> index 72553af823f1..876847b8c08c 100644
>> --- a/llvm/tools/llvm-exegesis/lib/X86/Target.cpp
>> +++ b/llvm/tools/llvm-exegesis/lib/X86/Target.cpp
>> @@ -241,13 +241,13 @@ static Expected<std::vector<CodeTemplate>> generateLEATemplatesCommon(
>> .str();
>> Result.push_back(std::move(CT));
>> if (Result.size() >= Opts.MaxConfigsPerOpcode)
>> - return std::move(Result);
>> + return Result;
>> }
>> }
>> }
>> }
>>
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> namespace {
>>
>> diff --git a/llvm/tools/llvm-ifs/llvm-ifs.cpp b/llvm/tools/llvm-ifs/llvm-ifs.cpp
>> index 3b0d2ee725ff..f653c3a94f52 100644
>> --- a/llvm/tools/llvm-ifs/llvm-ifs.cpp
>> +++ b/llvm/tools/llvm-ifs/llvm-ifs.cpp
>> @@ -215,7 +215,7 @@ static Expected<std::unique_ptr<IFSStub>> readInputFile(StringRef FilePath) {
>> if (std::error_code Err = YamlIn.error())
>> return createStringError(Err, "Failed reading Interface Stub File.");
>>
>> - return std::move(Stub);
>> + return Stub;
>> }
>>
>> int writeTbdStub(const llvm::Triple &T, const std::set<IFSSymbol> &Symbols,
>>
>> diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
>> index 26bcf46d60a6..df04a2e950a3 100644
>> --- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
>> +++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
>> @@ -238,8 +238,8 @@ class JITLinkSlabAllocator final : public JITLinkMemoryManager {
>> std::unique_ptr<JITLinkSlabAllocator> Allocator(
>> new JITLinkSlabAllocator(SlabSize, Err));
>> if (Err)
>> - return std::move(Err);
>> - return std::move(Allocator);
>> + return Err;
>> + return Allocator;
>> }
>>
>> Expected<std::unique_ptr<JITLinkMemoryManager::Allocation>>
>>
>> diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp
>> index 06c1ce957f74..a4b2514bbf93 100644
>> --- a/llvm/tools/llvm-mca/llvm-mca.cpp
>> +++ b/llvm/tools/llvm-mca/llvm-mca.cpp
>> @@ -240,7 +240,7 @@ ErrorOr<std::unique_ptr<ToolOutputFile>> getOutputStream() {
>> auto Out =
>> std::make_unique<ToolOutputFile>(OutputFilename, EC, sys::fs::OF_Text);
>> if (!EC)
>> - return std::move(Out);
>> + return Out;
>> return EC;
>> }
>> } // end of anonymous namespace
>>
>> diff --git a/llvm/tools/llvm-objcopy/COFF/Reader.cpp b/llvm/tools/llvm-objcopy/COFF/Reader.cpp
>> index 7be9cce2be3d..ad612af21fdc 100644
>> --- a/llvm/tools/llvm-objcopy/COFF/Reader.cpp
>> +++ b/llvm/tools/llvm-objcopy/COFF/Reader.cpp
>> @@ -207,15 +207,15 @@ Expected<std::unique_ptr<Object>> COFFReader::create() const {
>> }
>>
>> if (Error E = readExecutableHeaders(*Obj))
>> - return std::move(E);
>> + return E;
>> if (Error E = readSections(*Obj))
>> - return std::move(E);
>> + return E;
>> if (Error E = readSymbols(*Obj, IsBigObj))
>> - return std::move(E);
>> + return E;
>> if (Error E = setSymbolTargets(*Obj))
>> - return std::move(E);
>> + return E;
>>
>> - return std::move(Obj);
>> + return Obj;
>> }
>>
>> } // end namespace coff
>>
>> diff --git a/llvm/tools/llvm-objcopy/CopyConfig.cpp b/llvm/tools/llvm-objcopy/CopyConfig.cpp
>> index 69d6180d86e0..42bddf7a97ff 100644
>> --- a/llvm/tools/llvm-objcopy/CopyConfig.cpp
>> +++ b/llvm/tools/llvm-objcopy/CopyConfig.cpp
>> @@ -342,7 +342,7 @@ NameOrPattern::create(StringRef Pattern, MatchStyle MS,
>> // a literal if the error reporting is non-fatal.
>> if (!GlobOrErr) {
>> if (Error E = ErrorCallback(GlobOrErr.takeError()))
>> - return std::move(E);
>> + return E;
>> return create(Pattern, MatchStyle::Literal, ErrorCallback);
>> }
>>
>> @@ -572,7 +572,7 @@ parseObjcopyOptions(ArrayRef<const char *> ArgsArr,
>> for (auto Arg : InputArgs.filtered(OBJCOPY_redefine_symbols))
>> if (Error E = addSymbolsToRenameFromFile(Config.SymbolsToRename, DC.Alloc,
>> Arg->getValue()))
>> - return std::move(E);
>> + return E;
>>
>> for (auto Arg : InputArgs.filtered(OBJCOPY_rename_section)) {
>> Expected<SectionRename> SR =
>> @@ -623,15 +623,15 @@ parseObjcopyOptions(ArrayRef<const char *> ArgsArr,
>> for (auto Arg : InputArgs.filtered(OBJCOPY_remove_section))
>> if (Error E = Config.ToRemove.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SectionMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_keep_section))
>> if (Error E = Config.KeepSection.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SectionMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_only_section))
>> if (Error E = Config.OnlySection.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SectionMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_add_section)) {
>> StringRef ArgValue(Arg->getValue());
>> if (!ArgValue.contains('='))
>> @@ -671,67 +671,67 @@ parseObjcopyOptions(ArrayRef<const char *> ArgsArr,
>> for (auto Arg : InputArgs.filtered(OBJCOPY_localize_symbol))
>> if (Error E = Config.SymbolsToLocalize.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SymbolMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_localize_symbols))
>> if (Error E = addSymbolsFromFile(Config.SymbolsToLocalize, DC.Alloc,
>> Arg->getValue(), SymbolMatchStyle,
>> ErrorCallback))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_keep_global_symbol))
>> if (Error E = Config.SymbolsToKeepGlobal.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SymbolMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_keep_global_symbols))
>> if (Error E = addSymbolsFromFile(Config.SymbolsToKeepGlobal, DC.Alloc,
>> Arg->getValue(), SymbolMatchStyle,
>> ErrorCallback))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_globalize_symbol))
>> if (Error E = Config.SymbolsToGlobalize.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SymbolMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_globalize_symbols))
>> if (Error E = addSymbolsFromFile(Config.SymbolsToGlobalize, DC.Alloc,
>> Arg->getValue(), SymbolMatchStyle,
>> ErrorCallback))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_weaken_symbol))
>> if (Error E = Config.SymbolsToWeaken.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SymbolMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_weaken_symbols))
>> if (Error E = addSymbolsFromFile(Config.SymbolsToWeaken, DC.Alloc,
>> Arg->getValue(), SymbolMatchStyle,
>> ErrorCallback))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_strip_symbol))
>> if (Error E = Config.SymbolsToRemove.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SymbolMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_strip_symbols))
>> if (Error E = addSymbolsFromFile(Config.SymbolsToRemove, DC.Alloc,
>> Arg->getValue(), SymbolMatchStyle,
>> ErrorCallback))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_strip_unneeded_symbol))
>> if (Error E =
>> Config.UnneededSymbolsToRemove.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SymbolMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_strip_unneeded_symbols))
>> if (Error E = addSymbolsFromFile(Config.UnneededSymbolsToRemove, DC.Alloc,
>> Arg->getValue(), SymbolMatchStyle,
>> ErrorCallback))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_keep_symbol))
>> if (Error E = Config.SymbolsToKeep.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SymbolMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_keep_symbols))
>> if (Error E =
>> addSymbolsFromFile(Config.SymbolsToKeep, DC.Alloc, Arg->getValue(),
>> SymbolMatchStyle, ErrorCallback))
>> - return std::move(E);
>> + return E;
>> for (auto Arg : InputArgs.filtered(OBJCOPY_add_symbol))
>> Config.SymbolsToAdd.push_back(Arg->getValue());
>>
>> @@ -788,7 +788,7 @@ parseObjcopyOptions(ArrayRef<const char *> ArgsArr,
>> "--extract-main-partition");
>>
>> DC.CopyConfigs.push_back(std::move(Config));
>> - return std::move(DC);
>> + return DC;
>> }
>>
>> // ParseInstallNameToolOptions returns the config and sets the input arguments.
>> @@ -839,7 +839,7 @@ parseInstallNameToolOptions(ArrayRef<const char *> ArgsArr) {
>> Config.OutputFilename = Positional[0];
>>
>> DC.CopyConfigs.push_back(std::move(Config));
>> - return std::move(DC);
>> + return DC;
>> }
>>
>> // ParseStripOptions returns the config and sets the input arguments. If a
>> @@ -915,22 +915,22 @@ parseStripOptions(ArrayRef<const char *> ArgsArr,
>> for (auto Arg : InputArgs.filtered(STRIP_keep_section))
>> if (Error E = Config.KeepSection.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SectionMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>>
>> for (auto Arg : InputArgs.filtered(STRIP_remove_section))
>> if (Error E = Config.ToRemove.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SectionMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>>
>> for (auto Arg : InputArgs.filtered(STRIP_strip_symbol))
>> if (Error E = Config.SymbolsToRemove.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SymbolMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>>
>> for (auto Arg : InputArgs.filtered(STRIP_keep_symbol))
>> if (Error E = Config.SymbolsToKeep.addMatcher(NameOrPattern::create(
>> Arg->getValue(), SymbolMatchStyle, ErrorCallback)))
>> - return std::move(E);
>> + return E;
>>
>> if (!InputArgs.hasArg(STRIP_no_strip_all) && !Config.StripDebug &&
>> !Config.StripUnneeded && Config.DiscardMode == DiscardType::None &&
>> @@ -965,7 +965,7 @@ parseStripOptions(ArrayRef<const char *> ArgsArr,
>> if (Error E = ErrorCallback(createStringError(
>> errc::invalid_argument, "'%s' was already specified",
>> Filename.str().c_str())))
>> - return std::move(E);
>> + return E;
>> }
>> Config.InputFilename = Filename;
>> Config.OutputFilename = Filename;
>> @@ -978,7 +978,7 @@ parseStripOptions(ArrayRef<const char *> ArgsArr,
>> return createStringError(errc::invalid_argument,
>> "--preserve-dates requires a file");
>>
>> - return std::move(DC);
>> + return DC;
>> }
>>
>> } // namespace objcopy
>>
>> diff --git a/llvm/tools/llvm-objcopy/ELF/Object.cpp b/llvm/tools/llvm-objcopy/ELF/Object.cpp
>> index 14ac7bba24fa..691034f81369 100644
>> --- a/llvm/tools/llvm-objcopy/ELF/Object.cpp
>> +++ b/llvm/tools/llvm-objcopy/ELF/Object.cpp
>> @@ -277,7 +277,7 @@ Expected<IHexRecord> IHexRecord::parse(StringRef Line) {
>> "line is too short: %zu chars.", Line.size());
>>
>> if (Error E = checkChars(Line))
>> - return std::move(E);
>> + return E;
>>
>> IHexRecord Rec;
>> size_t DataLen = checkedGetHex<uint8_t>(Line.substr(1, 2));
>> @@ -293,7 +293,7 @@ Expected<IHexRecord> IHexRecord::parse(StringRef Line) {
>> if (getChecksum(Line.drop_front(1)) != 0)
>> return createStringError(errc::invalid_argument, "incorrect checksum.");
>> if (Error E = checkRecord(Rec))
>> - return std::move(E);
>> + return E;
>> return Rec;
>> }
>>
>> @@ -1665,7 +1665,7 @@ Expected<std::vector<IHexRecord>> IHexReader::parse() const {
>> if (!HasSections)
>> return parseError(-1U, "no sections");
>>
>> - return std::move(Records);
>> + return Records;
>> }
>>
>> std::unique_ptr<Object> IHexReader::create(bool /*EnsureSymtab*/) const {
>>
>> diff --git a/llvm/tools/llvm-objcopy/wasm/Reader.cpp b/llvm/tools/llvm-objcopy/wasm/Reader.cpp
>> index 13fa84ad8020..20443cc22537 100644
>> --- a/llvm/tools/llvm-objcopy/wasm/Reader.cpp
>> +++ b/llvm/tools/llvm-objcopy/wasm/Reader.cpp
>> @@ -25,7 +25,7 @@ Expected<std::unique_ptr<Object>> Reader::create() const {
>> Obj->Sections.push_back(
>> {static_cast<uint8_t>(WS.Type), WS.Name, WS.Content});
>> }
>> - return std::move(Obj);
>> + return Obj;
>> }
>>
>> } // end namespace wasm
>>
>> diff --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
>> index 32448cec88f6..63dc4610c7fb 100644
>> --- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
>> +++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
>> @@ -429,7 +429,7 @@ static Expected<ModuleDebugStreamRef> getModuleDebugStream(PDBFile &File,
>> return make_error<RawError>(raw_error_code::corrupt_file,
>> "Invalid module stream");
>>
>> - return std::move(ModS);
>> + return ModS;
>> }
>>
>> template <typename CallbackT>
>>
>> diff --git a/llvm/tools/llvm-pdbutil/InputFile.cpp b/llvm/tools/llvm-pdbutil/InputFile.cpp
>> index b316882de64d..7a5dfd32d58a 100644
>> --- a/llvm/tools/llvm-pdbutil/InputFile.cpp
>> +++ b/llvm/tools/llvm-pdbutil/InputFile.cpp
>> @@ -60,7 +60,7 @@ getModuleDebugStream(PDBFile &File, StringRef &ModuleName, uint32_t Index) {
>> return make_error<RawError>(raw_error_code::corrupt_file,
>> "Invalid module stream");
>>
>> - return std::move(ModS);
>> + return ModS;
>> }
>>
>> static inline bool isCodeViewDebugSubsection(object::SectionRef Section,
>> @@ -269,18 +269,18 @@ Expected<InputFile> InputFile::open(StringRef Path, bool AllowUnknownFile) {
>>
>> IF.CoffObject = std::move(*BinaryOrErr);
>> IF.PdbOrObj = llvm::cast<COFFObjectFile>(IF.CoffObject.getBinary());
>> - return std::move(IF);
>> + return IF;
>> }
>>
>> if (Magic == file_magic::pdb) {
>> std::unique_ptr<IPDBSession> Session;
>> if (auto Err = loadDataForPDB(PDB_ReaderType::Native, Path, Session))
>> - return std::move(Err);
>> + return Err;
>>
>> IF.PdbSession.reset(static_cast<NativeSession *>(Session.release()));
>> IF.PdbOrObj = &IF.PdbSession->getPDBFile();
>>
>> - return std::move(IF);
>> + return IF;
>> }
>>
>> if (!AllowUnknownFile)
>> @@ -295,7 +295,7 @@ Expected<InputFile> InputFile::open(StringRef Path, bool AllowUnknownFile) {
>>
>> IF.UnknownFile = std::move(*Result);
>> IF.PdbOrObj = IF.UnknownFile.get();
>> - return std::move(IF);
>> + return IF;
>> }
>>
>> PDBFile &InputFile::pdb() {
>>
>> diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.cpp b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
>> index 36b305645fb8..62adb5125663 100644
>> --- a/llvm/tools/llvm-rc/ResourceScriptParser.cpp
>> +++ b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
>> @@ -19,7 +19,7 @@
>> // Take an expression returning llvm::Error and forward the error if it exists.
>> #define RETURN_IF_ERROR(Expr) \
>> if (auto Err = (Expr)) \
>> - return std::move(Err);
>> + return Err;
>>
>> // Take an expression returning llvm::Expected<T> and assign it to Var or
>> // forward the error out of the function.
>> @@ -295,7 +295,7 @@ Expected<SmallVector<RCInt, 8>> RCParser::readIntsWithCommas(size_t MinCount,
>> auto FailureHandler =
>> [&](llvm::Error Err) -> Expected<SmallVector<RCInt, 8>> {
>> if (Result.size() < MinCount)
>> - return std::move(Err);
>> + return Err;
>> consumeError(std::move(Err));
>> return Result;
>> };
>> @@ -315,7 +315,7 @@ Expected<SmallVector<RCInt, 8>> RCParser::readIntsWithCommas(size_t MinCount,
>> return FailureHandler(IntResult.takeError());
>> }
>>
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> Expected<uint32_t> RCParser::parseFlags(ArrayRef<StringRef> FlagDesc,
>> @@ -386,7 +386,7 @@ RCParser::parseOptionalStatements(OptStmtType StmtsType) {
>> Result.addStmt(std::move(*SingleParse));
>> }
>>
>> - return std::move(Result);
>> + return Result;
>> }
>>
>> Expected<std::unique_ptr<OptionalStmt>>
>> @@ -442,7 +442,7 @@ RCParser::ParseType RCParser::parseAcceleratorsResource() {
>> Accels->addAccelerator(*EventResult, *IDResult, *FlagsResult);
>> }
>>
>> - return std::move(Accels);
>> + return Accels;
>> }
>>
>> RCParser::ParseType RCParser::parseCursorResource() {
>> @@ -484,7 +484,7 @@ RCParser::ParseType RCParser::parseDialogResource(bool IsExtended) {
>> Dialog->addControl(std::move(*ControlDefResult));
>> }
>>
>> - return std::move(Dialog);
>> + return Dialog;
>> }
>>
>> RCParser::ParseType RCParser::parseUserDefinedResource(IntOrString Type) {
>> @@ -679,7 +679,7 @@ Expected<MenuDefinitionList> RCParser::parseMenuItemsList() {
>> std::make_unique<MenuItem>(*CaptionResult, MenuResult, *FlagsResult));
>> }
>>
>> - return std::move(List);
>> + return List;
>> }
>>
>> RCParser::ParseType RCParser::parseStringTableResource() {
>> @@ -702,7 +702,7 @@ RCParser::ParseType RCParser::parseStringTableResource() {
>> Table->addString(*IDResult, *StrResult);
>> }
>>
>> - return std::move(Table);
>> + return Table;
>> }
>>
>> Expected<std::unique_ptr<VersionInfoBlock>>
>> @@ -718,7 +718,7 @@ RCParser::parseVersionInfoBlockContents(StringRef BlockName) {
>>
>> consume(); // Consume BlockEnd.
>>
>> - return std::move(Contents);
>> + return Contents;
>> }
>>
>> Expected<std::unique_ptr<VersionInfoStmt>> RCParser::parseVersionInfoStmt() {
>>
>> diff --git a/llvm/tools/llvm-rc/ResourceScriptToken.cpp b/llvm/tools/llvm-rc/ResourceScriptToken.cpp
>> index 175374788769..3c88d904a993 100644
>> --- a/llvm/tools/llvm-rc/ResourceScriptToken.cpp
>> +++ b/llvm/tools/llvm-rc/ResourceScriptToken.cpp
>> @@ -170,7 +170,7 @@ Expected<std::vector<RCToken>> Tokenizer::run() {
>>
>> const size_t TokenStart = Pos;
>> if (Error TokenError = consumeToken(TokenKind))
>> - return std::move(TokenError);
>> + return TokenError;
>>
>> // Comments are just deleted, don't bother saving them.
>> if (TokenKind == Kind::LineComment || TokenKind == Kind::StartComment)
>>
>> diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
>> index 4dd4e4129c24..eda064a11622 100644
>> --- a/llvm/tools/llvm-readobj/ELFDumper.cpp
>> +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
>> @@ -1087,7 +1087,7 @@ ELFDumper<ELFT>::getSymbolVersionByIndex(uint32_t SymbolVersionIndex,
>>
>> // Lookup this symbol in the version table.
>> if (Error E = LoadVersionMap())
>> - return std::move(E);
>> + return E;
>> if (VersionIndex >= VersionMap.size() || !VersionMap[VersionIndex])
>> return createError("SHT_GNU_versym section refers to a version index " +
>> Twine(VersionIndex) + " which is missing");
>>
>> diff --git a/llvm/tools/obj2yaml/elf2yaml.cpp b/llvm/tools/obj2yaml/elf2yaml.cpp
>> index d399b95c1cfb..b6a8395f237c 100644
>> --- a/llvm/tools/obj2yaml/elf2yaml.cpp
>> +++ b/llvm/tools/obj2yaml/elf2yaml.cpp
>> @@ -218,13 +218,13 @@ template <class ELFT> Expected<ELFYAML::Object *> ELFDumper<ELFT>::dump() {
>> if (SymTab) {
>> Y->Symbols.emplace();
>> if (Error E = dumpSymbols(SymTab, *Y->Symbols))
>> - return std::move(E);
>> + return E;
>> }
>>
>> if (DynSymTab) {
>> Y->DynamicSymbols.emplace();
>> if (Error E = dumpSymbols(DynSymTab, *Y->DynamicSymbols))
>> - return std::move(E);
>> + return E;
>> }
>>
>> for (const Elf_Shdr &Sec : Sections) {
>> @@ -563,7 +563,7 @@ Expected<ELFYAML::StackSizesSection *>
>> ELFDumper<ELFT>::dumpStackSizesSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::StackSizesSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> auto ContentOrErr = Obj.getSectionContents(Shdr);
>> if (!ContentOrErr)
>> @@ -596,7 +596,7 @@ Expected<ELFYAML::AddrsigSection *>
>> ELFDumper<ELFT>::dumpAddrsigSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::AddrsigSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> auto ContentOrErr = Obj.getSectionContents(Shdr);
>> if (!ContentOrErr)
>> @@ -637,7 +637,7 @@ Expected<ELFYAML::LinkerOptionsSection *>
>> ELFDumper<ELFT>::dumpLinkerOptionsSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::LinkerOptionsSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> auto ContentOrErr = Obj.getSectionContents(Shdr);
>> if (!ContentOrErr)
>> @@ -668,7 +668,7 @@ Expected<ELFYAML::DependentLibrariesSection *>
>> ELFDumper<ELFT>::dumpDependentLibrariesSection(const Elf_Shdr *Shdr) {
>> auto DL = std::make_unique<ELFYAML::DependentLibrariesSection>();
>> if (Error E = dumpCommonSection(Shdr, *DL))
>> - return std::move(E);
>> + return E;
>>
>> Expected<ArrayRef<uint8_t>> ContentOrErr = Obj.getSectionContents(Shdr);
>> if (!ContentOrErr)
>> @@ -695,7 +695,7 @@ Expected<ELFYAML::CallGraphProfileSection *>
>> ELFDumper<ELFT>::dumpCallGraphProfileSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::CallGraphProfileSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> Expected<ArrayRef<uint8_t>> ContentOrErr = Obj.getSectionContents(Shdr);
>> if (!ContentOrErr)
>> @@ -751,7 +751,7 @@ Expected<ELFYAML::DynamicSection *>
>> ELFDumper<ELFT>::dumpDynamicSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::DynamicSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> auto DynTagsOrErr = Obj.template getSectionContentsAsArray<Elf_Dyn>(Shdr);
>> if (!DynTagsOrErr)
>> @@ -768,7 +768,7 @@ Expected<ELFYAML::RelocationSection *>
>> ELFDumper<ELFT>::dumpRelocSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::RelocationSection>();
>> if (auto E = dumpCommonRelocationSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> auto SymTabOrErr = Obj.getSection(Shdr->sh_link);
>> if (!SymTabOrErr)
>> @@ -782,7 +782,7 @@ ELFDumper<ELFT>::dumpRelocSection(const Elf_Shdr *Shdr) {
>> for (const Elf_Rel &Rel : *Rels) {
>> ELFYAML::Relocation R;
>> if (Error E = dumpRelocation(&Rel, SymTab, R))
>> - return std::move(E);
>> + return E;
>> S->Relocations.push_back(R);
>> }
>> } else {
>> @@ -792,7 +792,7 @@ ELFDumper<ELFT>::dumpRelocSection(const Elf_Shdr *Shdr) {
>> for (const Elf_Rela &Rel : *Rels) {
>> ELFYAML::Relocation R;
>> if (Error E = dumpRelocation(&Rel, SymTab, R))
>> - return std::move(E);
>> + return E;
>> R.Addend = Rel.r_addend;
>> S->Relocations.push_back(R);
>> }
>> @@ -806,7 +806,7 @@ Expected<ELFYAML::RelrSection *>
>> ELFDumper<ELFT>::dumpRelrSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::RelrSection>();
>> if (auto E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> if (Expected<ArrayRef<Elf_Relr>> Relrs = Obj.relrs(Shdr)) {
>> S->Entries.emplace();
>> @@ -830,7 +830,7 @@ Expected<ELFYAML::RawContentSection *>
>> ELFDumper<ELFT>::dumpContentSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::RawContentSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> unsigned SecIndex = Shdr - &Sections[0];
>> if (SecIndex != 0 || Shdr->sh_type != ELF::SHT_NULL) {
>> @@ -854,7 +854,7 @@ Expected<ELFYAML::SymtabShndxSection *>
>> ELFDumper<ELFT>::dumpSymtabShndxSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::SymtabShndxSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> auto EntriesOrErr = Obj.template getSectionContentsAsArray<Elf_Word>(Shdr);
>> if (!EntriesOrErr)
>> @@ -869,7 +869,7 @@ Expected<ELFYAML::NoBitsSection *>
>> ELFDumper<ELFT>::dumpNoBitsSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::NoBitsSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>> S->Size = Shdr->sh_size;
>>
>> return S.release();
>> @@ -880,7 +880,7 @@ Expected<ELFYAML::NoteSection *>
>> ELFDumper<ELFT>::dumpNoteSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::NoteSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> auto ContentOrErr = Obj.getSectionContents(Shdr);
>> if (!ContentOrErr)
>> @@ -916,7 +916,7 @@ Expected<ELFYAML::HashSection *>
>> ELFDumper<ELFT>::dumpHashSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::HashSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> auto ContentOrErr = Obj.getSectionContents(Shdr);
>> if (!ContentOrErr)
>> @@ -957,7 +957,7 @@ Expected<ELFYAML::GnuHashSection *>
>> ELFDumper<ELFT>::dumpGnuHashSection(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::GnuHashSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> auto ContentOrErr = Obj.getSectionContents(Shdr);
>> if (!ContentOrErr)
>> @@ -1011,7 +1011,7 @@ ELFDumper<ELFT>::dumpVerdefSection(const Elf_Shdr *Shdr) {
>>
>> auto S = std::make_unique<ELFYAML::VerdefSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> S->Info = Shdr->sh_info;
>>
>> @@ -1062,7 +1062,7 @@ ELFDumper<ELFT>::dumpSymverSection(const Elf_Shdr *Shdr) {
>>
>> auto S = std::make_unique<ELFYAML::SymverSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> auto VersionsOrErr = Obj.template getSectionContentsAsArray<Elf_Half>(Shdr);
>> if (!VersionsOrErr)
>> @@ -1081,7 +1081,7 @@ ELFDumper<ELFT>::dumpVerneedSection(const Elf_Shdr *Shdr) {
>>
>> auto S = std::make_unique<ELFYAML::VerneedSection>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> S->Info = Shdr->sh_info;
>>
>> @@ -1154,7 +1154,7 @@ template <class ELFT>
>> Expected<ELFYAML::Group *> ELFDumper<ELFT>::dumpGroup(const Elf_Shdr *Shdr) {
>> auto S = std::make_unique<ELFYAML::Group>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> // Get symbol with index sh_info. This symbol's name is the signature of the group.
>> Expected<StringRef> SymbolName = getSymbolName(Shdr->sh_link, Shdr->sh_info);
>> @@ -1190,7 +1190,7 @@ ELFDumper<ELFT>::dumpMipsABIFlags(const Elf_Shdr *Shdr) {
>> "Section type is not SHT_MIPS_ABIFLAGS");
>> auto S = std::make_unique<ELFYAML::MipsABIFlags>();
>> if (Error E = dumpCommonSection(Shdr, *S))
>> - return std::move(E);
>> + return E;
>>
>> auto ContentOrErr = Obj.getSectionContents(Shdr);
>> if (!ContentOrErr)
>>
>> diff --git a/llvm/tools/obj2yaml/macho2yaml.cpp b/llvm/tools/obj2yaml/macho2yaml.cpp
>> index 0ee8814d35ab..aff2d9442c3c 100644
>> --- a/llvm/tools/obj2yaml/macho2yaml.cpp
>> +++ b/llvm/tools/obj2yaml/macho2yaml.cpp
>> @@ -198,8 +198,8 @@ Expected<std::unique_ptr<MachOYAML::Object>> MachODumper::dump() {
>>
>> std::unique_ptr<DWARFContext> DICtx = DWARFContext::create(Obj);
>> if (auto Err = dwarf2yaml(*DICtx, Y->DWARF))
>> - return std::move(Err);
>> - return std::move(Y);
>> + return Err;
>> + return Y;
>> }
>>
>> void MachODumper::dumpHeader(std::unique_ptr<MachOYAML::Object> &Y) {
>>
>> diff --git a/llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp
>> index 31a4247e27d0..a9f2d3fff036 100644
>> --- a/llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp
>> +++ b/llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp
>> @@ -56,7 +56,7 @@ class MockObjectLayer {
>> if (auto Sym = KV.second(Name, ExportedSymbolsOnly))
>> return Sym;
>> else if (auto Err = Sym.takeError())
>> - return std::move(Err);
>> + return Err;
>> }
>> return JITSymbol(nullptr);
>> }
>>
>> diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp
>> index 9a2f1a1b5ea0..726e4ab73f00 100644
>> --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp
>> +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp
>> @@ -3817,7 +3817,7 @@ Expected<InstructionMatcher &> GlobalISelEmitter::createAndImportSelDAGMatcher(
>> if (auto Error =
>> importChildMatcher(Rule, InsnMatcher, SrcChild, OperandIsAPointer,
>> OperandIsImmArg, OpIdx++, TempOpIdx))
>> - return std::move(Error);
>> + return Error;
>> }
>> }
>>
>> @@ -4083,7 +4083,7 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderer(
>> auto InsertPtOrError = createAndImportSubInstructionRenderer(
>> ++InsertPt, Rule, DstChild, TempRegID);
>> if (auto Error = InsertPtOrError.takeError())
>> - return std::move(Error);
>> + return Error;
>> return InsertPtOrError.get();
>> }
>>
>> @@ -4162,7 +4162,7 @@ Expected<BuildMIAction &> GlobalISelEmitter::createAndImportInstructionRenderer(
>> const TreePatternNode *Dst) {
>> auto InsertPtOrError = createInstructionRenderer(M.actions_end(), M, Dst);
>> if (auto Error = InsertPtOrError.takeError())
>> - return std::move(Error);
>> + return Error;
>>
>> action_iterator InsertPt = InsertPtOrError.get();
>> BuildMIAction &DstMIBuilder = *static_cast<BuildMIAction *>(InsertPt->get());
>> @@ -4182,7 +4182,7 @@ Expected<BuildMIAction &> GlobalISelEmitter::createAndImportInstructionRenderer(
>>
>> if (auto Error = importExplicitUseRenderers(InsertPt, M, DstMIBuilder, Dst)
>> .takeError())
>> - return std::move(Error);
>> + return Error;
>>
>> return DstMIBuilder;
>> }
>> @@ -4196,7 +4196,7 @@ GlobalISelEmitter::createAndImportSubInstructionRenderer(
>> // TODO: Assert there's exactly one result.
>>
>> if (auto Error = InsertPtOrError.takeError())
>> - return std::move(Error);
>> + return Error;
>>
>> BuildMIAction &DstMIBuilder =
>> *static_cast<BuildMIAction *>(InsertPtOrError.get()->get());
>> @@ -4207,7 +4207,7 @@ GlobalISelEmitter::createAndImportSubInstructionRenderer(
>> InsertPtOrError =
>> importExplicitUseRenderers(InsertPtOrError.get(), M, DstMIBuilder, Dst);
>> if (auto Error = InsertPtOrError.takeError())
>> - return std::move(Error);
>> + return Error;
>>
>> // We need to make sure that when we import an INSERT_SUBREG as a
>> // subinstruction that it ends up being constrained to the correct super
>> @@ -4347,7 +4347,7 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderers(
>> auto InsertPtOrError = createAndImportSubInstructionRenderer(
>> ++InsertPt, M, ValChild, TempRegID);
>> if (auto Error = InsertPtOrError.takeError())
>> - return std::move(Error);
>> + return Error;
>>
>> DstMIBuilder.addRenderer<TempRegRenderer>(TempRegID, false, SubIdx);
>> return InsertPt;
>> @@ -4397,7 +4397,7 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderers(
>> auto InsertPtOrError =
>> importExplicitUseRenderer(InsertPt, M, DstMIBuilder, ValChild);
>> if (auto Error = InsertPtOrError.takeError())
>> - return std::move(Error);
>> + return Error;
>> InsertPt = InsertPtOrError.get();
>> DstMIBuilder.addRenderer<SubRegIndexRenderer>(SubIdx);
>> }
>> @@ -4458,7 +4458,7 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderers(
>> DagInit *DefaultOps = DstIOperand.Rec->getValueAsDag("DefaultOps");
>> if (auto Error = importDefaultOperandRenderers(
>> InsertPt, M, DstMIBuilder, DefaultOps))
>> - return std::move(Error);
>> + return Error;
>> ++NumDefaultOps;
>> continue;
>> }
>> @@ -4466,7 +4466,7 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderers(
>> auto InsertPtOrError = importExplicitUseRenderer(InsertPt, M, DstMIBuilder,
>> Dst->getChild(Child));
>> if (auto Error = InsertPtOrError.takeError())
>> - return std::move(Error);
>> + return Error;
>> InsertPt = InsertPtOrError.get();
>> ++Child;
>> }
>> @@ -4667,7 +4667,7 @@ Expected<RuleMatcher> GlobalISelEmitter::runOnPattern(const PatternToMatch &P) {
>> llvm::to_string(*P.getDstPattern()));
>>
>> if (auto Error = importRulePredicates(M, P.getPredicates()))
>> - return std::move(Error);
>> + return Error;
>>
>> // Next, analyze the pattern operators.
>> TreePatternNode *Src = P.getSrcPattern();
>> @@ -4707,7 +4707,7 @@ Expected<RuleMatcher> GlobalISelEmitter::runOnPattern(const PatternToMatch &P) {
>> auto InsnMatcherOrError =
>> createAndImportSelDAGMatcher(M, InsnMatcherTemp, Src, TempOpIdx);
>> if (auto Error = InsnMatcherOrError.takeError())
>> - return std::move(Error);
>> + return Error;
>> InstructionMatcher &InsnMatcher = InsnMatcherOrError.get();
>>
>> if (Dst->isLeaf()) {
>> @@ -4735,7 +4735,7 @@ Expected<RuleMatcher> GlobalISelEmitter::runOnPattern(const PatternToMatch &P) {
>> // We're done with this pattern! It's eligible for GISel emission; return
>> // it.
>> ++NumPatternImported;
>> - return std::move(M);
>> + return M;
>> }
>>
>> return failedImport("Dst pattern root isn't a known leaf");
>> @@ -4823,13 +4823,13 @@ Expected<RuleMatcher> GlobalISelEmitter::runOnPattern(const PatternToMatch &P) {
>> auto DstMIBuilderOrError =
>> createAndImportInstructionRenderer(M, InsnMatcher, Src, Dst);
>> if (auto Error = DstMIBuilderOrError.takeError())
>> - return std::move(Error);
>> + return Error;
>> BuildMIAction &DstMIBuilder = DstMIBuilderOrError.get();
>>
>> // Render the implicit defs.
>> // These are only added to the root of the result.
>> if (auto Error = importImplicitDefRenderers(DstMIBuilder, P.getDstRegs()))
>> - return std::move(Error);
>> + return Error;
>>
>> DstMIBuilder.chooseInsnToMutate(M);
>>
>> @@ -4850,7 +4850,7 @@ Expected<RuleMatcher> GlobalISelEmitter::runOnPattern(const PatternToMatch &P) {
>> // We're done with this pattern! It's eligible for GISel emission; return
>> // it.
>> ++NumPatternImported;
>> - return std::move(M);
>> + return M;
>> }
>>
>> if (DstIName == "EXTRACT_SUBREG") {
>> @@ -4886,7 +4886,7 @@ Expected<RuleMatcher> GlobalISelEmitter::runOnPattern(const PatternToMatch &P) {
>> // We're done with this pattern! It's eligible for GISel emission; return
>> // it.
>> ++NumPatternImported;
>> - return std::move(M);
>> + return M;
>> }
>>
>> if (DstIName == "INSERT_SUBREG") {
>> @@ -4907,7 +4907,7 @@ Expected<RuleMatcher> GlobalISelEmitter::runOnPattern(const PatternToMatch &P) {
>> M.addAction<ConstrainOperandToRegClassAction>(0, 1, **SuperClass);
>> M.addAction<ConstrainOperandToRegClassAction>(0, 2, **SubClass);
>> ++NumPatternImported;
>> - return std::move(M);
>> + return M;
>> }
>>
>> if (DstIName == "SUBREG_TO_REG") {
>> @@ -4931,14 +4931,14 @@ Expected<RuleMatcher> GlobalISelEmitter::runOnPattern(const PatternToMatch &P) {
>> M.addAction<ConstrainOperandToRegClassAction>(0, 0, **SuperClass);
>> M.addAction<ConstrainOperandToRegClassAction>(0, 2, **SubClass);
>> ++NumPatternImported;
>> - return std::move(M);
>> + return M;
>> }
>>
>> M.addAction<ConstrainOperandsToDefinitionAction>(0);
>>
>> // We're done with this pattern! It's eligible for GISel emission; return it.
>> ++NumPatternImported;
>> - return std::move(M);
>> + return M;
>> }
>>
>> // Emit imm predicate table and an enum to reference them with.
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list