Skip to content

Commit

Permalink
Fix -Wpessimizing-move warnings in rustllvm/PassWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Jul 29, 2018
1 parent a5c2d0f commit 9ccd7ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rustllvm/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ LLVMRustPrepareThinLTOImport(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
auto MOrErr = getLazyBitcodeModule(Memory, Context, true, true);

if (!MOrErr)
return std::move(MOrErr);
return MOrErr;

// The rest of this closure is a workaround for
// https://bugs.llvm.org/show_bug.cgi?id=38184 where during ThinLTO imports
Expand All @@ -1110,14 +1110,14 @@ LLVMRustPrepareThinLTOImport(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
// shouldn't be a perf hit.
if (Error Err = (*MOrErr)->materializeMetadata()) {
Expected<std::unique_ptr<Module>> Ret(std::move(Err));
return std::move(Ret);
return Ret;
}

auto *WasmCustomSections = (*MOrErr)->getNamedMetadata("wasm.custom_sections");
if (WasmCustomSections)
WasmCustomSections->eraseFromParent();

return std::move(MOrErr);
return MOrErr;
};
FunctionImporter Importer(Data->Index, Loader);
Expected<bool> Result = Importer.importFunctions(Mod, ImportList);
Expand Down

0 comments on commit 9ccd7ee

Please sign in to comment.