[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-10-14 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. In D54943#3854279 , @sammccall wrote: > FYI I've sent D135829 to block this check > from running in clangd, after tracking it down as the cause of a >10x > regression in reparse times in a

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-10-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. FYI I've sent D135829 to block this check from running in clangd, after tracking it down as the cause of a >10x regression in reparse times in a project that inadvertently enabled it (`misc-*`). Looking at the implementation, this

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-08-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D54943#3687827 , @JonasToth wrote: > In D54943#3681527 , @sammccall wrote: > >> This check is enabled by default in LLVM (`Checks: misc-*` in >> `llvm-project/.clang-tidy`) >> >>

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-08-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. I agree with Sam on this one, especially on big files it just floods and hides non-stylistic diagnostics (you even hit max diagnostics exceeded errors). I believe unless someone takes the extra mile to fix all the value types in LLVM to be const-correct, this is

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#3681527 , @sammccall wrote: > This check is enabled by default in LLVM (`Checks: misc-*` in > `llvm-project/.clang-tidy`) > > The warning on mutable non-ref local variables is pretty noisy: a *lot* of > existing code

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-27 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. This check is enabled by default in LLVM (`Checks: misc-*` in `llvm-project/.clang-tidy`) The warning on mutable non-ref local variables is pretty noisy: a *lot* of existing code does not do this, for defensible reasons (some of us think that the ratio of extra

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Thank you very much for all you patience, reviews and tests! I hope that the following improvements are now simpler to integrate and that the test matures well. :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-24 Thread Jonas Toth via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG46ae26e7eb70: [clang-tidy] implement new check misc-const-correctness to add const to… (authored by JonasToth).

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-20 Thread Nathan James via Phabricator via cfe-commits
njames93 accepted this revision. njames93 added a comment. LGTM with those changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 ___ cfe-commits mailing list

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @njames93 @LegalizeAdulthood I did integrate the requested changes regarding warning for bad configs, refactoring of map-access and the directory structure of test-files and documentation. given the high interest in the patch and the need to iron out potential

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 443486. JonasToth added a comment. - refactor: adjust warning message for mis-configuration to show which check is configured wrong Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 443485. JonasToth added a comment. - fix: doc list and release-notes reference Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#3619333 , @LegalizeAdulthood wrote: > Clang-tidy tests and docs have been moved to subdirectories by module, please > rebase to `main:HEAD` I moved the tests and the documentation as well. tests + documentation do

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/misc-const-correctness.rst:10 +`CppCoreGuidelines ES.25

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 443484. JonasToth marked 4 inline comments as done. JonasToth added a comment. Herald added a reviewer: jdoerfert. Herald added subscribers: abrachet, sstefan1, phosek. - test: move tests into group specific directory - refactor: use more idiomatic c++ for

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-07-04 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added inline comments. Herald added a reviewer: NoQ. Comment at: clang-tools-extra/docs/clang-tidy/checks/misc-const-correctness.rst:10 +`CppCoreGuidelines ES.25

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-06-29 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 been moved to subdirectories by module, please rebase to `main:HEAD` CHANGES SINCE LAST ACTION

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-06-08 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.h:35 +TransformPointersAsValues( +Options.get("TransformPointersAsValues", false)) {} + JonasToth wrote: > njames93 wrote: > > It may be worth

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-06-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.h:35 +TransformPointersAsValues( +Options.get("TransformPointersAsValues", false)) {} + njames93 wrote: > It may be worth adding some

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-06-08 Thread Nathan James via Phabricator via cfe-commits
njames93 accepted this revision. njames93 added a comment. This revision is now accepted and ready to land. LGTM, just a couple points but not essential. Comment at: clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp:184-187 + if (ScopesCache.find(LocalScope) ==

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-06-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. ping :) @njames93 I added more `CHECK-FIXES` and `CHECK-FIXES-NOT` statements in the tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 ___ cfe-commits mailing list

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 432774. JonasToth added a comment. - addded `CHECK-FIXES` in clang-tidy tests - merged latest main into branch CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-22 Thread Nathan James via Phabricator via cfe-commits
njames93 added a comment. Pretty much good to go, just a few nits with the tests. Can you add CHECK-FIXES directives for all warnings if there should be a fixit. If there shouldn't be one could you either add a comment saying there shouldn't be one, or put a CHECK-FIXES-NOT directive.

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. friendly ping :) (maybe @njames93 ?) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 ___ cfe-commits mailing list

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 427629. JonasToth added a comment. - fix documentation reference Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.h:24 +/// For the user-facing documentation see: +/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines-const.html +class ConstCorrectnessCheck : public

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added a comment. Thank you for the review! I adjusted the patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-05-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 427423. JonasToth marked 3 inline comments as done. JonasToth added a comment. - addressing review comments and remove unrelated changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/

[PATCH] D54943: [clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

2022-04-25 Thread Nathan James via Phabricator via cfe-commits
njames93 added inline comments. Comment at: clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp:103 + +#if 0 + // FIXME: Remove this section if there are no crashes after the iterator-fix. Hasn't this already been addressed, if so can this block just be