forked from OSchip/llvm-project
Fix a bunch of -Wpessimizing-move issues.
Thanks to Rui for pointing out this warning was firing. llvm-svn: 264977
This commit is contained in:
parent
021de058df
commit
e487da165c
|
@ -779,7 +779,7 @@ llvm::Error MachOFileLayout::writeLoadCommands() {
|
||||||
// Object files have one unnamed segment which holds all sections.
|
// Object files have one unnamed segment which holds all sections.
|
||||||
if (_is64) {
|
if (_is64) {
|
||||||
if (auto ec = writeSingleSegmentLoadCommand<MachO64Trait>(lc))
|
if (auto ec = writeSingleSegmentLoadCommand<MachO64Trait>(lc))
|
||||||
return std::move(ec);
|
return ec;
|
||||||
} else {
|
} else {
|
||||||
if (auto ec = writeSingleSegmentLoadCommand<MachO32Trait>(lc))
|
if (auto ec = writeSingleSegmentLoadCommand<MachO32Trait>(lc))
|
||||||
return std::move(ec);
|
return std::move(ec);
|
||||||
|
|
|
@ -1177,7 +1177,7 @@ normalizedObjectToAtoms(MachOFile *file,
|
||||||
continue;
|
continue;
|
||||||
if (llvm::Error ec = convertRelocs(sect, normalizedFile, scatterable,
|
if (llvm::Error ec = convertRelocs(sect, normalizedFile, scatterable,
|
||||||
*file, *handler))
|
*file, *handler))
|
||||||
return std::move(ec);
|
return ec;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add additional arch-specific References
|
// Add additional arch-specific References
|
||||||
|
|
|
@ -33,13 +33,13 @@ public:
|
||||||
llvm::Expected<std::unique_ptr<NormalizedFile>> nFile =
|
llvm::Expected<std::unique_ptr<NormalizedFile>> nFile =
|
||||||
normalized::normalizedFromAtoms(file, _ctx);
|
normalized::normalizedFromAtoms(file, _ctx);
|
||||||
if (auto ec = nFile.takeError())
|
if (auto ec = nFile.takeError())
|
||||||
return std::move(ec);
|
return ec;
|
||||||
|
|
||||||
// For testing, write out yaml form of normalized file.
|
// For testing, write out yaml form of normalized file.
|
||||||
if (_ctx.printAtoms()) {
|
if (_ctx.printAtoms()) {
|
||||||
std::unique_ptr<Writer> yamlWriter = createWriterYAML(_ctx);
|
std::unique_ptr<Writer> yamlWriter = createWriterYAML(_ctx);
|
||||||
if (auto ec = yamlWriter->writeFile(file, "-"))
|
if (auto ec = yamlWriter->writeFile(file, "-"))
|
||||||
return std::move(ec);
|
return ec;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write normalized file as mach-o binary.
|
// Write normalized file as mach-o binary.
|
||||||
|
|
Loading…
Reference in New Issue