[clang-tools-extra] [clang-tidy] Improve performance-use-std-move in presence of control-flow (PR #184136)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 9 07:53:52 PDT 2026
serge-sans-paille wrote:
> On second thought, one observation about the implementation:
>
> The backward worklist only pushes a block when `RemainingSuccessors` becomes 0. When we encounter a CFG with cycles, blocks in the cycle never get all their successors processed (have at least one successor that is also in the cycle), so they never enter the worklist and are never analyzed.
>
> ~TBH I don't have idea on how to fix this issue. It seems that we may have to handle cycles explicitly, which is non-trivial. Keeping` the current conservative behavior for loops looks acceptable to me.~
>
> Update: For loops that may run multiple times, not suggesting `std::move` is correct anyways, so LGTM.
Yes! That was the goal!
https://github.com/llvm/llvm-project/pull/184136
More information about the cfe-commits
mailing list