This is an archive of the discontinued LLVM Phabricator instance.

Remove redundant move call in return statements
AbandonedPublic

Authored by vinograd47 on Jan 14 2021, 12:56 AM.

Details

Summary

They might prevent copy-elision optimization and generate noisy warnings with gcc.

Diff Detail

Event Timeline

vinograd47 created this revision.Jan 14 2021, 12:56 AM
vinograd47 requested review of this revision.Jan 14 2021, 12:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 14 2021, 12:56 AM

I'm not certain but I thought some of these moves had to be kept to appease old versions of gcc - but I can't remember any details.

llvm/include/llvm/Bitstream/BitstreamReader.h
429

Any idea what clang-tidy is warning about here?

I'm not certain but I thought some of these moves had to be kept to appease old versions of gcc - but I can't remember any details.

I'm pretty sure the std::move I added in FileCheck were because of warning I had on my machine (Ubuntu 18.04). I'll try to give the patch a spin and report.

Also, sorry for hijacking but if you're looking at std::move cleanup, this scary static analysis warning has been around for a while: https://llvm.org/reports/scan-build/report-BitcodeReader.cpp-BitcodeReader-0-1.html#EndPath

vinograd47 abandoned this revision.Jan 14 2021, 5:49 AM