[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-09-26 Thread Jonas Toth via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe66345d54d5f: [clang-tidy] adjust treating of array-of-pointers when AnalyzePointers is… (authored by JonasToth). Repository: rG LLVM Github

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-09-26 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 462838. JonasToth added a comment. - remove unproductive check-fixes line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130793/new/ https://reviews.llvm.org/D130793 Files:

[PATCH] D130181: [clang-tidy] Add readability-use-early-exits check

2022-09-19 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D130181#3769618 , @njames93 wrote: > In D130181#3769083 , @JonasToth > wrote: > >> ... > > Your concerns aren't actually that important. Because the transformations > only work on

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added a comment. ping @njames93 :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130793/new/ https://reviews.llvm.org/D130793 ___ cfe-commits

[PATCH] D130181: [clang-tidy] Add readability-use-early-exits check

2022-09-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. IMHO the check looks good, but I do have concerns about correctness of the transformation in specific cases, especially overloaded operators. If the conditions are inverted, it might be the case that the inverted operator is not overloaded, resulting in compilation

[PATCH] D131386: [clang-tidy] Added `ConstAlignment` option to `misc-const-correctness`

2022-09-01 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-alignment.cpp:43 + // of the `*`. + int *IPtr = + // CHECK-MESSAGES: [[@LINE-1]]:3: warning: variable 'IPtr' of type 'int *' can be declared 'const'

[PATCH] D131386: [clang-tidy] Added `ConstAlignment` option to `misc-const-correctness`

2022-09-01 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. during the original implementation of the fix-util I had the plan to provide an option for east-vs-west const, but during the discussions we came to the conclusion that `clang-format` should do this (the patches were already pending at that point in time). if this

[PATCH] D130181: [clang-tidy] Add readability-use-early-exits check

2022-08-31 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/readability/use-early-exits.rst:63 +void Process(bool A, bool B) { + if (A && B) { +// Long processing. njames93 wrote: > JonasToth wrote: > > if this option

[PATCH] D130181: [clang-tidy] Add readability-use-early-exits check

2022-08-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. just my 2 cents Comment at: clang-tools-extra/clang-tidy/readability/UseEarlyExitsCheck.cpp:66 + if (needsParensAfterUnaryNegation(Condition)) { +Diag << FixItHint::CreateInsertion(Condition->getBeginLoc(), "!(") + <<

[PATCH] D132244: [docs] improve documentation for misc-const-correctness

2022-08-29 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb5b750346346: [docs] improve documentation for misc-const-correctness (authored by JonasToth). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132244/new/

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-08-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-pointer-as-values.cpp:27-30 + for (const int *p_local1 : p_local0) { + // CHECK-MESSAGES: [[@LINE-1]]:8: warning: variable 'p_local1' of type 'const int *' can be

[PATCH] D132244: [docs] improve documentation for misc-const-correctness

2022-08-26 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @njames93 friendly ping, for https://reviews.llvm.org/D130793 as well :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132244/new/ https://reviews.llvm.org/D132244 ___

[PATCH] D132244: [docs] improve documentation for misc-const-correctness

2022-08-19 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 454067. JonasToth added a comment. - mention C limitation Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132244/new/ https://reviews.llvm.org/D132244 Files:

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-08-19 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 454032. JonasToth added a comment. - remove bad change from diff Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130793/new/ https://reviews.llvm.org/D130793 Files:

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-08-19 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 454031. JonasToth marked an inline comment as done. JonasToth added a comment. - split patch - remove unnecessary includes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130793/new/

[PATCH] D132244: [docs] improve documentation for misc-const-correctness

2022-08-19 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: njames93, aaron.ballman, alexfh, hokein, sammccall. Herald added a project: All. JonasToth requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. Improve the documentation

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-08-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 450359. JonasToth added a comment. - improve test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130793/new/ https://reviews.llvm.org/D130793 Files:

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-08-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 450358. JonasToth added a comment. - add test with typedef - [docs] improve documentation for misc-const-correctness Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130793/new/ https://reviews.llvm.org/D130793

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-07-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-pointer-as-values.cpp:16 +void range_for() { + int np_local0[2] = {1, 2}; + int *p_local0[2] = {_local0[0], _local0[1]}; the tests must be exanded

[PATCH] D130793: [clang-tidy] adjust treating of array-of-pointers when 'AnalyzePointers' is deactivated

2022-07-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: njames93, aaron.ballman, alexfh. Herald added subscribers: carlosgalvezp, xazax.hun. Herald added a project: All. JonasToth requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber:

[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-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-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-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-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] D127036: [clang-tidy] Warn about arrays in `bugprone-undefined-memory-manipulation`

2022-06-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.cpp:27 void UndefinedMemoryManipulationCheck::registerMatchers(MatchFinder *Finder) { - const auto NotTriviallyCopyableObject = -

[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-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 const-transformation for misc-const-correctness

2022-04-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 424788. JonasToth added a comment. - fix: remove clangAnalysis link in cppcoreguidelines and add it in misc 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 const-transformation for cppcoreguidelines-const-correctness

2022-04-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 424787. JonasToth added a comment. - refactor: rename check to 'misc-const-correctness' and adjust the tests accordingly - docs: adjust release notes and adjust check docs slightly Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D119481: run-clang-tidy: Fix infinite loop on windows

2022-04-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Sorry for the long delay, i simply forgot. The patch is commited! :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119481/new/ https://reviews.llvm.org/D119481 ___ cfe-commits

[PATCH] D119481: run-clang-tidy: Fix infinite loop on windows

2022-04-24 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3f0f20366622: run-clang-tidy: Fix infinite loop on windows (authored by JonasToth). Herald added a project: All. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-03-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. ok. then i will continue under `misc-const-correctness`. thank you for the clarifications! 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 const-transformation for cppcoreguidelines-const-correctness

2022-03-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. > Sorry, for my own sanity, I've stopped reviewing C++ Core Guideline reviews > for their diagnostic behavior until the guideline authors put effort into > specifying realistic enforcement guidance. And how can we continue now? I fear that this is effectively the

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-03-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. ping @aaron.ballman @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] D120331: [clang-tidy][run-clang-tidy.py] Add --config-file= option

2022-03-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth accepted this revision. JonasToth added a comment. This revision is now accepted and ready to land. Herald added a project: All. LGTM, but please adjust the naming nit to a better name. do you have commit rights? Otherwise someone (e.g. me) could commit on your behalf, of course with

[PATCH] D120331: [clang-tidy][run-clang-tidy.py] Add --config-file= option

2022-02-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/tool/run-clang-tidy.py:236 'each source file in its parent directories.') + parser.add_argument('-config-file', default=None, + help='Specify the path of

[PATCH] D54141: [clang-tidy] add deduplication support for run-clang-tidy.py

2022-02-21 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth abandoned this revision. JonasToth added a comment. Herald added a subscriber: mgehre. won't happen anymore realistically. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54141/new/ https://reviews.llvm.org/D54141

[PATCH] D119481: run-clang-tidy: Fix infinite loop on windows

2022-02-21 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth accepted this revision. JonasToth added a comment. This revision is now accepted and ready to land. LGTM with a small nit Comment at: clang-tools-extra/clang-tidy/tool/run-clang-tidy.py:69 while not os.path.isfile(os.path.join(result, path)): -if

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-02-21 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Another full run on LLVM with: $ ./clang-tools-extra/clang-tidy/tool/run-clang-tidy.py \ -clang-tidy-binary ~/software/llvm-project/build_clang_tidy/bin/clang-tidy \ -checks="-*,cppcoreguidelines-const-correctness" \ -config "{CheckOptions:

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-02-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 3 inline comments as done. JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt:33 LINK_LIBS + clangAnalysis clangTidy sammccall wrote: > JonasToth wrote: > > njames93 wrote: > > >

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-02-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 410179. JonasToth marked 14 inline comments as done. JonasToth added a comment. - address reviews comments, part 1 - Merge branch 'main' into feature_rebase_const_transform_20210808 - fixing iterator-to-bool conversion and addressing other more review

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-02-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt:33 LINK_LIBS + clangAnalysis clangTidy njames93 wrote: > Will this work under clangd as I don't think that links in the clangAnalysis > libraries

[PATCH] D118927: [clang-tidy] Fix invalid fix-it for cppcoreguidelines-prefer-member-initializer

2022-02-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer.cpp:550 + // CHECK-FIXES-NEXT: } + PR53515(PR53515 &) : M() { +M = Other.M; could you please add a test-case for

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-02-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#3292552 , @0x8000- wrote: > @aaron.ballman - can this land for Clang14, or does it have wait for 15? > > Are there any other reviewers that can approve this? Sadly, cherry-picking to 14 is very unlikely, as this

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-02-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-transform-pointer-as-values.cpp:12 + // CHECK-MESSAGES: [[@LINE-1]]:3: warning: variable 'p_local0' of type 'double *' can be declared 'const' + //

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-02-01 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-transform-pointer-as-values.cpp:12 + // CHECK-MESSAGES: [[@LINE-1]]:3: warning: variable 'p_local0' of type

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-02-01 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-templates.cpp:16 + int value_int = 42; + // CHECK-MESSAGES:[[@LINE-1]]:3: warning: variable 'value_int' of

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-01-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added a comment. ping @aaron.ballman just in case the patch is now down on the list, I am sorry for my high latency :( Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.h:29 + :

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-01-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 404297. JonasToth added a comment. - use boolean for options - fix snafoo on `arc` usage 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 const-transformation for cppcoreguidelines-const-correctness

2022-01-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 404296. JonasToth added a comment. - use boolean for option parsing 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 const-transformation for cppcoreguidelines-const-correctness

2022-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 400296. JonasToth added a comment. - fix: adjust unit test for new array-pointer condition in range-based for loops 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 const-transformation for cppcoreguidelines-const-correctness

2022-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 400293. JonasToth added a comment. - fix release note ordering 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 const-transformation for cppcoreguidelines-const-correctness

2022-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 400291. JonasToth marked an inline comment as done. JonasToth added a comment. - improve documentation a bit 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 const-transformation for cppcoreguidelines-const-correctness

2022-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added a comment. addressed all outstanding review comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-transform-values.cpp:107-108 + int *np_local3[2] = {_local0[0],

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 400288. JonasToth marked 2 inline comments as done. JonasToth added a comment. - Merge branch 'main' into feature_rebase_const_transform_20210808 - fix: address other review comments - remove one false positive with pointers in a range-based for loop on

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.h:31 +WarnPointersAsValues(Options.get("WarnPointersAsValues", 0)), +TransformValues(Options.get("TransformValues", 1)), +

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2022-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 400280. JonasToth marked 10 inline comments as done. JonasToth added a comment. - Merge branch 'main' into feature_rebase_const_transform_20210808 - fix: fixes for most review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-12-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.h:31 +WarnPointersAsValues(Options.get("WarnPointersAsValues", 0)), +TransformValues(Options.get("TransformValues", 1)), +

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-12-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#3194643 , @aaron.ballman wrote: > Thanks for pinging on this, it had fallen off my radar! @JonasToth -- did you > ever get the chance to talk with @cjdb about the overlap mentioned in >

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-12-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Herald added a subscriber: carlosgalvezp. @aaron.ballman ping for review :) I do not intend to fix the raised issues with this revision. I think it is more valuable to get this check in and get more user-feedback. But the found bugs are on the todo-list!

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-10-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-09-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I further analyzer the false positive and its probably not so simple to fix. 'NoOp' is always used to add qualifiers. This is true for `const` and `__unaligned`, but there seems to be no further information to disambiguate those. Maybe this requires even something in

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-09-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 370813. JonasToth added a comment. - add reproducer for '__unaligned' bug 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 const-transformation for cppcoreguidelines-const-correctness

2021-09-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#2956218 , @tiagoma wrote: > I am getting false positives with > > struct S{}; > > void f(__unaligned S*); > > void scope() > { > S s; > f(); > } This godbolt link has the AST for the

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-09-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 370808. JonasToth added a comment. - Merge branch 'main' into feature_rebase_const_transform_20210808 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 const-transformation for cppcoreguidelines-const-correctness

2021-09-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 370807. JonasToth marked 2 inline comments as done. JonasToth added a comment. - minor adjustments for comments 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 const-transformation for cppcoreguidelines-const-correctness

2021-08-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. thanks for your testing! i will look at the `__unaligned` issue, not sure if clang supports it, its an MSVC extension, is it? Did the transformations produce issues and approximately how much code did you check? I would like to get a better feeling for its quality

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#2947902 , @cjdb wrote: > @JonasToth, @aaron.ballman suspects that there's enough overlap between this > patch and D107873 to consider merging the > two efforts. I'm happy to

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.cpp:145 + /// const emit multiple warnings otherwise. + const bool IsNormalVariableInTemplate = Function->isTemplateInstantiation(); + if

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. The check in the latest form can properly transform `llvm/lib` and `clang/` and requires 28 manual fixes afterwards (values and references are transformed, no other modifications). Some are good and not an issue with the analysis itself, some may or may not be an

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 366516. JonasToth added a comment. - fix: auto and type-dependent initializers fixed by ignoring them correctly in the matcher - fix docs on limitations - fix: deduplicate diagnostics from template instantiations Repository: rG LLVM Github Monorepo

[PATCH] D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 366482. JonasToth added a comment. - write documentation for const-analysis check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

[PATCH] D54943: WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 366480. JonasToth added a comment. - Merge branch 'main' into feature_rebase_const_transform_20210808 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

[PATCH] D54943: WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#2944680 , @0x8000- wrote: > Using the checker now in our production BuildBot - no crashes and no false > positives. Can't say if there are false negatives, but at any rate the > checker is better than most

[PATCH] D54943: WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Whats left from my personal todo is adjusting the documentation. I think then this check can work as linter and if you want as fixer as well, but this has to be enable explicitly. I think that fixing still has more value than harm, e.g. in your IDE/editor. The most

[PATCH] D54943: WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 365257. JonasToth marked 4 inline comments as done. JonasToth added a comment. - remove transformation as default option, now it must be activated by the user explicitly - register only for C++ - add a test-case for VLAs Repository: rG LLVM Github

[PATCH] D54943: WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 365253. JonasToth added a comment. - retry upload of patch to be a diff to main Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

[PATCH] D54943: WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 365252. JonasToth marked an inline comment as done. JonasToth added a comment. - rebase to master - fix a crash where a scope matched but non of its variables, leading to nullptr dereference (found with the current test-suite) - remove outcommenting of

[PATCH] D54943: WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-08-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#2633408 , @tiagoma wrote: > Can we get this in? I work in Microsoft Office and we have been using this > checker and it works great! There are a couple of issues with it and I would > like to contribute fixes. Hey,

[PATCH] D90972: [clang-tidy] Install run-clang-tidy.py in bin/ as run-clang-tidy

2020-11-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth accepted this revision. JonasToth added a comment. LGTM! thanks for fixing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90972/new/ https://reviews.llvm.org/D90972 ___ cfe-commits mailing

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. You can land it. Worst case would be post-commit comments, but this is not a complicated patch and should be fine! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89194/new/ https://reviews.llvm.org/D89194 ___

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth accepted this revision. JonasToth added a comment. I am fine now, thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89194/new/ https://reviews.llvm.org/D89194 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D79113: Revert "Remove false positive in AvoidNonConstGlobalVariables."

2020-10-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. The issue is resolved now in the CppCoreGuidelines. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79113/new/ https://reviews.llvm.org/D79113 ___ cfe-commits mailing list

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. The context thingie was not that important here, but still thanks :) Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:4658 +/// functionDecl(isWeak()) +/// matches the weak declaration foo, but not bar. +AST_MATCHER(FunctionDecl, isWeak) {

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:4658 +/// functionDecl(isWeak()) +/// matches the weak declaration foo, but not bar. +AST_MATCHER(FunctionDecl, isWeak) { return Node.isWeak(); } Short oversight. Please

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth accepted this revision. JonasToth added a comment. LGTM. Short reminder to please use full context patches. Its not an issue right now, but review sometimes just needs the context to understand the changes :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89194/new/

[PATCH] D54943: WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-10-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 297407. JonasToth added a comment. - fix test RUN line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

[PATCH] D54943: WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-10-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.cpp:46 + +void ConstCorrectnessCheck::registerMatchers(MatchFinder *Finder) { + const auto ConstType =

[PATCH] D54943: WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2020-10-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 297405. JonasToth added a comment. - no delayed template parsing - adjust release note issue Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

  1   2   3   4   5   6   7   8   9   10   >