[lld] r264977 - Fix a bunch of -Wpessimizing-move issues.
Pete Cooper via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 30 17:35:50 PDT 2016
Author: pete
Date: Wed Mar 30 19:35:50 2016
New Revision: 264977
URL: http://llvm.org/viewvc/llvm-project?rev=264977&view=rev
Log:
Fix a bunch of -Wpessimizing-move issues.
Thanks to Rui for pointing out this warning was firing.
Modified:
lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp
Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp?rev=264977&r1=264976&r2=264977&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp Wed Mar 30 19:35:50 2016
@@ -779,7 +779,7 @@ llvm::Error MachOFileLayout::writeLoadCo
// 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);
Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp?rev=264977&r1=264976&r2=264977&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp Wed Mar 30 19:35:50 2016
@@ -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
Modified: lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp?rev=264977&r1=264976&r2=264977&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp Wed Mar 30 19:35:50 2016
@@ -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.
More information about the llvm-commits
mailing list