From 14ea122e6ee126b025fa1cf8d2439944c64e5ae6 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 30 May 2017 19:36:58 +0000 Subject: [PATCH] [Object] Fix pessimizing move. Returning the Error by value triggers copy elision, the move is more expensive. Clang rightfully warns about it. llvm-svn: 304232 --- llvm/lib/Object/WindowsResource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Object/WindowsResource.cpp b/llvm/lib/Object/WindowsResource.cpp index 9dea5539858b..c1adb26bd3d8 100644 --- a/llvm/lib/Object/WindowsResource.cpp +++ b/llvm/lib/Object/WindowsResource.cpp @@ -20,7 +20,7 @@ namespace object { #define RETURN_IF_ERROR(X) \ if (auto EC = X) \ - return std::move(EC); + return EC; const uint32_t MIN_HEADER_SIZE = 7 * sizeof(uint32_t) + 2 * sizeof(uint16_t);