From dc59c794d081cf759a7a24bee8b8a73afbabbf02 Mon Sep 17 00:00:00 2001 From: Pete Cooper Date: Thu, 31 Mar 2016 00:38:02 +0000 Subject: [PATCH] Fix a bunch more of -Wpessimizing-move issues. Thanks to Rui for pointing out this warning was firing. llvm-svn: 264978 --- .../MachO/MachONormalizedFileBinaryWriter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp index 5eb5924ff8ad..f3e159684e15 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp @@ -782,7 +782,7 @@ llvm::Error MachOFileLayout::writeLoadCommands() { return ec; } else { if (auto ec = writeSingleSegmentLoadCommand(lc)) - return std::move(ec); + return ec; } // Add LC_SYMTAB with symbol table info symtab_command* st = reinterpret_cast(lc); @@ -828,10 +828,10 @@ llvm::Error MachOFileLayout::writeLoadCommands() { // Final linked images have sections under segments. if (_is64) { if (auto ec = writeSegmentLoadCommands(lc)) - return std::move(ec); + return ec; } else { if (auto ec = writeSegmentLoadCommands(lc)) - return std::move(ec); + return ec; } // Add LC_ID_DYLIB command for dynamic libraries. @@ -1481,7 +1481,7 @@ llvm::Error MachOFileLayout::writeBinary(StringRef path) { _buffer = fob->getBufferStart(); writeMachHeader(); if (auto ec = writeLoadCommands()) - return std::move(ec); + return ec; writeSectionContent(); writeLinkEditContent(); fob->commit();