[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-13 Thread Florin Iucha via Phabricator via cfe-commits
0x8000- added a comment. 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 colleagues at finding what should be declared const. Repository: rG LLVM Github Monorepo

[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 Florin Iucha via Phabricator via cfe-commits
0x8000- added a comment. In D54943#2933179 , @JonasToth wrote: > 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

[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] D54943: WIP [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness

2021-03-17 Thread Tiago Macarios via Phabricator via cfe-commits
tiagoma added a comment. Herald added a subscriber: shchenz. 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. Repository: rG LLVM Github Monorepo CHANGES SINCE

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

2020-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D54943#2352196 , @0x8000- wrote: > Would it be possible to split this review further, into "checking" and > "fixing" portions? I understand that fix-it portion is more difficult, and > sometimes results in multiple

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

2020-10-24 Thread Florin Iucha via Phabricator via cfe-commits
0x8000- added a comment. Would it be possible to split this review further, into "checking" and "fixing" portions? I understand that fix-it portion is more difficult, and sometimes results in multiple 'const' keywords being added, but for the past year we have used the check as part of

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

2020-10-13 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.cpp:46 + +void ConstCorrectnessCheck::registerMatchers(MatchFinder *Finder) { + const auto ConstType = hasType(isConstQualified()); JonasToth

[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:

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

2020-10-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.cpp:46 + +void ConstCorrectnessCheck::registerMatchers(MatchFinder *Finder) { + const auto ConstType = hasType(isConstQualified()); JonasToth

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

2020-10-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 297231. JonasToth added a comment. - missed one place of decltype 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-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 297224. JonasToth added a comment. - fix platform dependent warning message for decltype to just match the beginning and not the 'a.k.a' Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/

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

2020-10-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 297215. JonasToth marked an inline comment as done. JonasToth added a comment. - address review comments 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-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt:37 + clangLex + clangSerialization clangTidy aaron.ballman wrote: > Why do serialization and lex need to

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

2020-10-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 297197. JonasToth added a comment. - update to landed ExprMutAnalyzer changes 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-08 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt:37 + clangLex + clangSerialization clangTidy Why do serialization and lex need to be pulled in? Comment at:

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

2020-10-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#2302315 , @0x8000- wrote: > In D54943#2292377 , @0x8000- > wrote: > >> In D54943#2291969 , @JonasToth >> wrote: >> >>>

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

2020-10-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 296549. JonasToth added a comment. rebase to newest expmutanalyzer patch 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-09-29 Thread Florin Iucha via Phabricator via cfe-commits
0x8000- added a comment. In D54943#2292377 , @0x8000- wrote: > In D54943#2291969 , @JonasToth wrote: > >> @AlexanderLanin @0x8000- i created the branch `release-11-const` >>

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

2020-09-26 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#2295894 , @AlexanderLanin wrote: > Off-Topic: I was just attempting to apply this to my codebase at work. > Seems this will be more challenging than anticipated  > My best guess is this is related to D72730

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

2020-09-25 Thread Alexander Lanin via Phabricator via cfe-commits
AlexanderLanin added a comment. Off-Topic: I was just attempting to apply this to my codebase at work. Seems this will be more challenging than anticipated  My best guess is this is related to D72730 Applying fixes ... terminate called after throwing an

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

2020-09-25 Thread Alexander Lanin via Phabricator via cfe-commits
AlexanderLanin added a comment. "Minimal" example for the behavior I described before. `clang++ -fsyntax-only ~/llvm/clang/test/SemaCXX/warn-range-loop-analysis.cpp -Wrange-loop-analysis 2>&1 | wc -l` 269 Then fix it by: `~/llvm/build-const-fix/bin/clang-tidy

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

2020-09-24 Thread Florin Iucha via Phabricator via cfe-commits
0x8000- added a comment. In D54943#2291969 , @JonasToth wrote: > @AlexanderLanin @0x8000- i created the branch `release-11-const` > (https://github.com/JonasToth/llvm-project/tree/release-11-const) in my fork. > > This branch is based on 11-rc3

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

2020-09-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @AlexanderLanin @0x8000- i created the branch `release-11-const` (https://github.com/JonasToth/llvm-project/tree/release-11-const) in my fork. This branch is based on 11-rc3 and cherry picks the commits that correspond to this revision. I hope this is of any use

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

2020-09-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 293970. JonasToth added a comment. rebase to current exprmutanalyzer - remove spurious formatting change - fix include and typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/

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

2020-09-23 Thread Florin Iucha via Phabricator via cfe-commits
0x8000- added a comment. In D54943#2290713 , @AlexanderLanin wrote: >> Could you please provide me a full reproducer (optimally without >> dependencies on includes/libraries)? > > I can certainly do that based on my old version from ~9 months ago or

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

2020-09-23 Thread Alexander Lanin via Phabricator via cfe-commits
AlexanderLanin added a comment. > Could you please provide me a full reproducer (optimally without dependencies > on includes/libraries)? I can certainly do that based on my old version from ~9 months ago or preferably if you provide me some branch somewhere (github?). I have trouble applying

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

2020-09-23 Thread Florin Iucha via Phabricator via cfe-commits
0x8000- added a comment. In D54943#2289410 , @JonasToth wrote: > In D54943#2289037 , @0x8000- > wrote: > >> Master branch has too many false positives for tidy - would it be possible >> to create a branch

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

2020-09-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#2289037 , @0x8000- wrote: > Master branch has too many false positives for tidy - would it be possible to > create a branch that contains this patch set on top of llvm-11.0-rc3? I would > then add this to our

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

2020-09-22 Thread Florin Iucha via Phabricator via cfe-commits
0x8000- added a comment. Master branch has too many false positives for tidy - would it be possible to create a branch that contains this patch set on top of llvm-11.0-rc3? I would then add this to our internal CI. For the legacy code (see previous reports) we found quite a few false