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