[llvm] b223e5f - [Bitstream] Remove pessimizing move
Jan Svoboda via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 15 23:29:39 PST 2022
Author: Jan Svoboda
Date: 2022-02-16T08:23:02+01:00
New Revision: b223e5f8468cbed5cffe0d872de8feac2a73b030
URL: https://github.com/llvm/llvm-project/commit/b223e5f8468cbed5cffe0d872de8feac2a73b030
DIFF: https://github.com/llvm/llvm-project/commit/b223e5f8468cbed5cffe0d872de8feac2a73b030.diff
LOG: [Bitstream] Remove pessimizing move
Commit 4a794d848ce81f41c6e23a4d3d3f70c2d7d1baa4 caused build failure with -Werror -Wpessimizing-move on the clang-ppc64-aix buildbot. This patch applies Clang's suggestion to remove `std::move`.
Added:
Modified:
llvm/lib/Bitstream/Reader/BitstreamReader.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Bitstream/Reader/BitstreamReader.cpp b/llvm/lib/Bitstream/Reader/BitstreamReader.cpp
index ac674e88c61cc..c297e16bdfdf7 100644
--- a/llvm/lib/Bitstream/Reader/BitstreamReader.cpp
+++ b/llvm/lib/Bitstream/Reader/BitstreamReader.cpp
@@ -220,9 +220,9 @@ Expected<unsigned> BitstreamCursor::readRecord(unsigned AbbrevID,
uint32_t Code = MaybeCode.get();
Expected<uint32_t> MaybeNumElts = ReadVBR(6);
if (!MaybeNumElts)
- return error(("Failed to read size: " +
- toString(std::move(MaybeNumElts.takeError())))
- .c_str());
+ return error(
+ ("Failed to read size: " + toString(MaybeNumElts.takeError()))
+ .c_str());
uint32_t NumElts = MaybeNumElts.get();
if (!isSizePlausible(NumElts))
return error("Size is not plausible");
@@ -277,9 +277,9 @@ Expected<unsigned> BitstreamCursor::readRecord(unsigned AbbrevID,
// Array case. Read the number of elements as a vbr6.
Expected<uint32_t> MaybeNumElts = ReadVBR(6);
if (!MaybeNumElts)
- return error(("Failed to read size: " +
- toString(std::move(MaybeNumElts.takeError())))
- .c_str());
+ return error(
+ ("Failed to read size: " + toString(MaybeNumElts.takeError()))
+ .c_str());
uint32_t NumElts = MaybeNumElts.get();
if (!isSizePlausible(NumElts))
return error("Size is not plausible");
More information about the llvm-commits
mailing list