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:
Pete Cooper 2016-03-31 00:35:50 +00:00
parent 021de058df
commit e487da165c
3 changed files with 4 additions and 4 deletions

View File

@ -779,7 +779,7 @@ llvm::Error MachOFileLayout::writeLoadCommands() {
// Object files have one unnamed segment which holds all sections.
if (_is64) {
if (auto ec = writeSingleSegmentLoadCommand<MachO64Trait>(lc))
return std::move(ec);
return ec;
} else {
if (auto ec = writeSingleSegmentLoadCommand<MachO32Trait>(lc))
return std::move(ec);

View File

@ -1177,7 +1177,7 @@ normalizedObjectToAtoms(MachOFile *file,
continue;
if (llvm::Error ec = convertRelocs(sect, normalizedFile, scatterable,
*file, *handler))
return std::move(ec);
return ec;
}
// Add additional arch-specific References

View File

@ -33,13 +33,13 @@ public:
llvm::Expected<std::unique_ptr<NormalizedFile>> nFile =
normalized::normalizedFromAtoms(file, _ctx);
if (auto ec = nFile.takeError())
return std::move(ec);
return ec;
// For testing, write out yaml form of normalized file.
if (_ctx.printAtoms()) {
std::unique_ptr<Writer> yamlWriter = createWriterYAML(_ctx);
if (auto ec = yamlWriter->writeFile(file, "-"))
return std::move(ec);
return ec;
}
// Write normalized file as mach-o binary.