[PATCH] D97567: [clang-tidy] performance-* checks: Also allow allow member expressions to be used in a const manner.

Felix Berger via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 26 11:13:29 PST 2021


flx created this revision.
flx added reviewers: aaron.ballman, sbenza.
Herald added a subscriber: xazax.hun.
flx requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Until now when determining all the const uses of a VarDecl we only considered
how the variable itself was used. This change extends checking for const usages
of the type's members as well.

This increases the number of true positives for various performance checks that
share the same const usage analysis.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97567

Files:
  clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp
  clang-tools-extra/test/clang-tidy/checkers/performance-for-range-copy.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97567.326750.patch
Type: text/x-patch
Size: 4544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210226/e4db3b93/attachment.bin>


More information about the cfe-commits mailing list