[PATCH] D124918: [clang-tidy] Add a new check for non-trivial unused variables.

Luca Versari via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 17 09:38:54 PDT 2022


veluca93 marked an inline comment as done.
veluca93 added inline comments.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/performance-unused-no-side-effect.rst:172-173
+List of functions that are considered not to read some of their arguments
+unless their return value is read. Arguments are identified by a bitmask, where
+the i-th LSB being set indicates that the i-th argument is unused.
+
----------------
LegalizeAdulthood wrote:
> veluca93 wrote:
> > LegalizeAdulthood wrote:
> > > This isn't user-friendly at all.  Why not an array of argument indices starting at zero?
> > Done. I'm using an empty array to indicate "everything", which is perhaps a bit weird.
> I think `[-1]` might be a better sentinel.  What do you do for functions that take zero arguments?
It doesn't matter, right? For the purpose of tracking whether variables are used, 0-argument free/static functions are meaningless anyway.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124918/new/

https://reviews.llvm.org/D124918



More information about the cfe-commits mailing list