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

2022-06-22 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood requested changes to this revision. LegalizeAdulthood added a comment. This revision now requires changes to proceed. Clang-Tidy tests and docs have moved to module subdirectories. Please rebase this onto `main:HEAD` and: - fold your changes into the appropriate subdirs, stripp

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

2022-06-03 Thread Luca Versari via Phabricator via cfe-commits
veluca93 updated this revision to Diff 434026. veluca93 marked 3 inline comments as done. veluca93 added a comment. Respond to comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124918/new/ https://reviews.llvm.org/D124918 Files: clang-tools

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

2022-06-03 Thread Luca Versari via Phabricator via cfe-commits
veluca93 marked 5 inline comments as done. veluca93 added a comment. In D124918#3555719 , @ymandel wrote: > Luca, > > Can you expand the description to give a better intuition as to what this > check is finding that the diagnostic does not? The example i

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

2022-06-03 Thread Andy Soffer via Phabricator via cfe-commits
asoffer added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnusedNoSideEffectCheck.cpp:90 +if (!Op->isAssignmentOp()) { + markSideEffectFree(Op->getRHS()); +} Perhaps I'm not understanding precisely what `markSideEffectFree`

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

2022-06-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Luca, Can you expand the description to give a better intuition as to what this check is finding that the diagnostic does not? The example is good, but it would be helpful if you could phrase the general rule being enforced. Similarly, that would be helpful in the doc

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

2022-05-30 Thread Luca Versari via Phabricator via cfe-commits
veluca93 marked 2 inline comments as done. veluca93 added a comment. @LegalizeAdulthood friendly ping :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124918/new/ https://reviews.llvm.org/D124918 ___ cfe

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

2022-05-17 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood 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

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

2022-05-17 Thread Luca Versari via Phabricator via cfe-commits
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

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

2022-05-17 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood 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

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

2022-05-16 Thread Luca Versari via Phabricator via cfe-commits
veluca93 added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/performance-unused-no-side-effect.rst:93 + { + "std::string": ["swap"], + "absl::int128": [], LegalizeAdulthood wrote: > Since `std::string` is just a type alias, sh

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

2022-05-16 Thread Luca Versari via Phabricator via cfe-commits
veluca93 updated this revision to Diff 429745. veluca93 marked 6 inline comments as done. veluca93 added a comment. Switch from bitmasks to arrays. Add more tests & update doc. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124918/new/ https://revie

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

2022-05-14 Thread Richard via Phabricator via cfe-commits
LegalizeAdulthood added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/performance-unused-no-side-effect.rst:25-26 + +A function is considered to "not read an argument unless the return value is +used" in the following cases: + The quotes

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

2022-05-04 Thread Luca Versari via Phabricator via cfe-commits
veluca93 marked an inline comment as done. veluca93 added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnusedNoSideEffectCheck.cpp:135 +// or class, and that there are no side effects on `this`. +if (auto *Callee = dyn_cast(Call->getCallee())) {

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

2022-05-04 Thread Luca Versari via Phabricator via cfe-commits
veluca93 updated this revision to Diff 427013. veluca93 added a comment. Missing `const` from auto * Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124918/new/ https://reviews.llvm.org/D124918 Files: clang-tools-extra/clang-tidy/performance/CMake

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

2022-05-04 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnusedNoSideEffectCheck.cpp:135 +// or class, and that there are no side effects on `this`. +if (auto *Callee = dyn_cast(Call->getCallee())) { + markSideEffectFree(Callee); --

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

2022-05-04 Thread Luca Versari via Phabricator via cfe-commits
veluca93 updated this revision to Diff 427007. veluca93 marked 7 inline comments as done. veluca93 added a comment. Address first round of review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124918/new/ https://reviews.llvm.org/D124918

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

2022-05-04 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnusedNoSideEffectCheck.cpp:11 + +#include +#include C++ headers should be after application's ones. Comment at: clang-tools-extra/clang-tidy/perform