This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Zircon fbl::move -> std::move
AbandonedPublic

Authored by juliehockett on Nov 6 2018, 11:26 AM.

Details

Summary

Adds a check to convert fbl::move to std::move.

This check is part of a set of migration checks as we prepare to move Zircon user code to use the C++ standard library, and should prevent regressions after the migration is complete.

Diff Detail

Event Timeline

juliehockett created this revision.Nov 6 2018, 11:26 AM

I think this check is ok in the current form, but does it really need to be in upstream clang-tidy? You said its for migration only, so it is not valuable for you for a long time either?

clang-tools-extra/clang-tidy/zircon/FblMoveCheck.h
21

Please highlight code with quotes (single or backticks)

clang-tools-extra/test/clang-tidy/zircon-fbl-move.cpp
6

please add test for aliases, function pointers and similar indirections.

Eugene.Zelenko added inline comments.
clang-tools-extra/clang-tidy/zircon/FblMoveCheck.cpp
62

Please don't use auto when type could not be deduced from statement.

clang-tools-extra/docs/ReleaseNotes.rst
188

I think first statement is not necessary. Second should start from Suggests. Will be good idea to synchronize it with documentation.

I think this check is ok in the current form, but does it really need to be in upstream clang-tidy? You said its for migration only, so it is not valuable for you for a long time either?

So yes, this check is for a migration, and we would delete it once regressions weren't possible. We would like the suite to be in upstream, however, because we use the ToT llvm/clang/tools/etc, and don't want to have to fork just to use clang-tidy for this sort of thing. Since clang-tidy doesn't provide any way to have external checks to the tool itself, upstreaming is the most ideal option.

Orthogonal to our particular build setup, it'd also be nice to have an example of this sort of migration done by clang-tidy in-tree. There has been a lot of discussion recently about doing migrations with clang-tidy, but it's always describing an internal migration that uses a forked tree and a private suite of checks that can't be released.

juliehockett marked 4 inline comments as done.
Eugene.Zelenko added inline comments.Nov 6 2018, 6:23 PM
clang-tools-extra/docs/ReleaseNotes.rst
188

Please try to fill as much as possible to 80 characters.

189

inserting -> to include? Same in documentation.

juliehockett marked 2 inline comments as done.
juliehockett abandoned this revision.Nov 12 2018, 10:26 AM

After a lot of discussion, we'll do this migration internally. Thanks for your comments!