This is an archive of the discontinued LLVM Phabricator instance.

[llvm][NFC] Use move instead of copy
ClosedPublic

Authored by ccotter on Jan 28 2023, 5:57 PM.

Details

Summary

For functions that accept an rvalue reference type
parameter, use move to avoid copying the parameter.

These were found when implementing CppCoreGuideline F.18 in
clang-tidy.

Diff Detail

Event Timeline

ccotter created this revision.Jan 28 2023, 5:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2023, 5:57 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
ccotter requested review of this revision.Jan 28 2023, 5:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2023, 5:57 PM
Michael137 accepted this revision.Feb 1 2023, 8:20 AM
This revision is now accepted and ready to land.Feb 1 2023, 8:20 AM
thieta accepted this revision.Feb 1 2023, 8:28 AM

Seems fine to me. Have you tried clang-format locally since the CI job seems broken?

Yes, locally I get

$ ./clang/tools/clang-format/git-clang-format HEAD~
clang-format did not modify any files

I think (unless something has broken lately) https://buildkite.com/llvm-project/premerge-checks/builds/133226#0185fb40-6564-4910-a1ac-820fd11c0708 is running clang-format. On other PRs I've submitted over the past few weeks have caught an occasional instance where I forgot to run clang-format locally.

The message on this phabricator diff saying "clang-format not found in user’s local PATH; not linting file." is due to my local setup not having arc diff know how to automatically run clang-format before sending up the diff (which I need to fix).

This revision was automatically updated to reflect the committed changes.