Skip to content

Commit

Permalink
[CGData] Fix -Wpessimizing-move in CodeGenDataReader.cpp (NFC)
Browse files Browse the repository at this point in the history
/llvm-project/llvm/lib/CodeGenData/CodeGenDataReader.cpp:78:12:
error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
    return std::move(E);
           ^
/llvm-project/llvm/lib/CodeGenData/CodeGenDataReader.cpp:78:12: note: remove std::move call here
    return std::move(E);
           ^~~~~~~~~~ ~
1 error generated.
  • Loading branch information
DamonFool committed Jul 23, 2024
1 parent 4dcd91a commit 1f8b2b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGenData/CodeGenDataReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Error IndexedCodeGenDataReader::read() {
auto *End =
reinterpret_cast<const unsigned char *>(DataBuffer->getBufferEnd());
if (auto E = IndexedCGData::Header::readFromBuffer(Start).moveInto(Header))
return std::move(E);
return E;

if (hasOutlinedHashTree()) {
const unsigned char *Ptr = Start + Header.OutlinedHashTreeOffset;
Expand Down

0 comments on commit 1f8b2b1

Please sign in to comment.