[lld] r264978 - Fix a bunch more of -Wpessimizing-move issues.

Pete Cooper via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 17:38:03 PDT 2016


Author: pete
Date: Wed Mar 30 19:38:02 2016
New Revision: 264978

URL: http://llvm.org/viewvc/llvm-project?rev=264978&view=rev
Log:
Fix a bunch more of -Wpessimizing-move issues.

Thanks to Rui for pointing out this warning was firing.

Modified:
    lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp

Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp?rev=264978&r1=264977&r2=264978&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp Wed Mar 30 19:38:02 2016
@@ -782,7 +782,7 @@ llvm::Error MachOFileLayout::writeLoadCo
        return ec;
     } else {
       if (auto ec = writeSingleSegmentLoadCommand<MachO32Trait>(lc))
-        return std::move(ec);
+        return ec;
     }
     // Add LC_SYMTAB with symbol table info
     symtab_command* st = reinterpret_cast<symtab_command*>(lc);
@@ -828,10 +828,10 @@ llvm::Error MachOFileLayout::writeLoadCo
     // Final linked images have sections under segments.
     if (_is64) {
       if (auto ec = writeSegmentLoadCommands<MachO64Trait>(lc))
-        return std::move(ec);
+        return ec;
     } else {
       if (auto ec = writeSegmentLoadCommands<MachO32Trait>(lc))
-        return std::move(ec);
+        return ec;
     }
 
     // Add LC_ID_DYLIB command for dynamic libraries.
@@ -1481,7 +1481,7 @@ llvm::Error MachOFileLayout::writeBinary
   _buffer = fob->getBufferStart();
   writeMachHeader();
   if (auto ec = writeLoadCommands())
-    return std::move(ec);
+    return ec;
   writeSectionContent();
   writeLinkEditContent();
   fob->commit();




More information about the llvm-commits mailing list