Rollup merge of #52824 - varkor:fix-llvm-ret-move-warnings, r=rkruppe
Fix -Wpessimizing-move warnings in rustllvm/PassWrapper These are producing warnings when building rustc (`warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]`).
This commit is contained in:
commit
61b9a516d3
1 changed files with 3 additions and 3 deletions
|
@ -1075,7 +1075,7 @@ LLVMRustPrepareThinLTOImport(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
|
||||||
auto MOrErr = getLazyBitcodeModule(Memory, Context, true, true);
|
auto MOrErr = getLazyBitcodeModule(Memory, Context, true, true);
|
||||||
|
|
||||||
if (!MOrErr)
|
if (!MOrErr)
|
||||||
return std::move(MOrErr);
|
return MOrErr;
|
||||||
|
|
||||||
// The rest of this closure is a workaround for
|
// The rest of this closure is a workaround for
|
||||||
// https://bugs.llvm.org/show_bug.cgi?id=38184 where during ThinLTO imports
|
// https://bugs.llvm.org/show_bug.cgi?id=38184 where during ThinLTO imports
|
||||||
|
@ -1093,14 +1093,14 @@ LLVMRustPrepareThinLTOImport(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
|
||||||
// shouldn't be a perf hit.
|
// shouldn't be a perf hit.
|
||||||
if (Error Err = (*MOrErr)->materializeMetadata()) {
|
if (Error Err = (*MOrErr)->materializeMetadata()) {
|
||||||
Expected<std::unique_ptr<Module>> Ret(std::move(Err));
|
Expected<std::unique_ptr<Module>> Ret(std::move(Err));
|
||||||
return std::move(Ret);
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto *WasmCustomSections = (*MOrErr)->getNamedMetadata("wasm.custom_sections");
|
auto *WasmCustomSections = (*MOrErr)->getNamedMetadata("wasm.custom_sections");
|
||||||
if (WasmCustomSections)
|
if (WasmCustomSections)
|
||||||
WasmCustomSections->eraseFromParent();
|
WasmCustomSections->eraseFromParent();
|
||||||
|
|
||||||
return std::move(MOrErr);
|
return MOrErr;
|
||||||
};
|
};
|
||||||
FunctionImporter Importer(Data->Index, Loader);
|
FunctionImporter Importer(Data->Index, Loader);
|
||||||
Expected<bool> Result = Importer.importFunctions(Mod, ImportList);
|
Expected<bool> Result = Importer.importFunctions(Mod, ImportList);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue