[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] D88088: [clang] improve accuracy of ExprMutAnalyzer

2020-10-09 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. JonasToth marked an inline comment as done. Closed by commit rGe517e5cfec90: [clang] improve accuracy of ExprMutAnalyzer (authored by JonasToth). Repository: rG

[PATCH] D88088: [clang] improve accuracy of ExprMutAnalyzer

2020-10-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: clang/lib/Analysis/ExprMutationAnalyzer.cpp:61 + // below. + auto const ConditionalOperator = conditionalOperator(anyOf( +

[PATCH] D88088: [clang] improve accuracy of ExprMutAnalyzer

2020-10-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 297187. JonasToth added a comment. - [Feature] add elvis operator detection Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88088/new/ https://reviews.llvm.org/D88088 Files:

[PATCH] D88088: [clang] improve accuracy of ExprMutAnalyzer

2020-10-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 296628. JonasToth added a comment. - fix imprecisions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88088/new/ https://reviews.llvm.org/D88088 Files: clang/lib/Analysis/ExprMutationAnalyzer.cpp

[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] D88088: WIP [clang] improve accuracy of ExprMutAnalyzer

2020-10-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @aaron.ballman I update the code a bit. This stuff is just a hydra :/ But i think incrementally the current version is better, but still not perfect. I update the clang-tidy part, too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D88088: WIP [clang] improve accuracy of ExprMutAnalyzer

2020-10-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 296546. JonasToth added a comment. Herald added a subscriber: steakhal. - document sections in the testcases, hopefully little more structure for comprehension - fix derived-to-base-cast OUTSIDE of an conditional operator - improve type-dependent callexpr,

[PATCH] D54222: [clang-tidy] Add a check to detect returning static locals in public headers

2020-10-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I am confused now, but richard knows this stuff very well! The patches you referenced showed only cases where the static was defined in an inline-header definition (and templates). Does this make a difference on the semantics? This should be clear before we continue.

[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] D54222: [clang-tidy] Add a check to detect returning static locals in public headers

2020-09-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54222#2294123 , @jranieri-grammatech wrote: > In D54222#1290789 , @JonasToth wrote: > >> I agree with @Eugene.Zelenko that this check should rather live in >> `bugprone-` as the

[PATCH] D88088: WIP [clang] improve accuracy of ExprMutAnalyzer

2020-09-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 294301. JonasToth added a comment. - fix typo that provided wrong argument to AST building Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88088/new/ https://reviews.llvm.org/D88088 Files:

[PATCH] D88088: WIP [clang] improve accuracy of ExprMutAnalyzer

2020-09-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 294300. JonasToth added a comment. - address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88088/new/ https://reviews.llvm.org/D88088 Files: clang/lib/Analysis/ExprMutationAnalyzer.cpp

[PATCH] D88088: WIP [clang] improve accuracy of ExprMutAnalyzer

2020-09-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 294050. JonasToth marked 9 inline comments as done. JonasToth added a comment. - adress review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88088/new/ https://reviews.llvm.org/D88088 Files:

[PATCH] D88088: WIP [clang] improve accuracy of ExprMutAnalyzer

2020-09-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang/lib/Analysis/ExprMutationAnalyzer.cpp:455 + const auto HasAnyNonConstIterator = + anyOf(allOf(hasMethod(allOf(hasName("begin"), unless(isConst(, + unless(hasMethod(allOf(hasName("begin"),

[PATCH] D36836: [clang-tidy] Implement sonarsource-function-cognitive-complexity check

2020-09-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D36836#2289639 , @lebedev.ri wrote: > Rebased. > > There is a number of official open-source LGPL-3 implementations already: > > - https://github.com/SonarSource/SonarTS/pull/378 > -

[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] D88088: WIP [clang] improve accuracy of ExprMutAnalyzer

2020-09-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 293967. JonasToth added a comment. - improve the expression matcher, to catch the expression in general ternary-operator cases, too - considered unresolved operator calls to be a modification - fix method calls with templates in some instances

[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] D87588: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D87588#2278948 , @ro wrote: > As described in D87825 , this patch broke > `Debug` builds on `sparcv9-sun-solaris2.11` and `amd64-pc-solaris2.11`. Thank you for reporting this issue. I it is

[PATCH] D54222: [clang-tidy] Add a check to detect returning static locals in public headers

2020-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54222#2281642 , @jranieri-grammatech wrote: > @JonasToth It looks like there are some outstanding review comments that need > to be addressed. I've gotten some time allocated to work on this next week. Great!

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

2020-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 293422. JonasToth added a comment. - remove spurious formatting change 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

2020-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 293420. JonasToth added a comment. - rebase to revision for https://reviews.llvm.org/D88088 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

[PATCH] D88088: [clang] improve accuracy of ExprMutAnalyzer

2020-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added a reviewer: aaron.ballman. Herald added subscribers: cfe-commits, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, jfb, a.sidorin, baloghadamsoftware. Herald added a project: clang. JonasToth requested review of this revision. This patch extracts the

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

2020-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 293418. JonasToth added a comment. - include ExprMutAnalyzer implementation changes, that got lost somehow with prior rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/

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

2020-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#2255358 , @AlexanderLanin wrote: > Observed behavior: > > Change: `for(string_view token : split_into_views(file_content, " \t\r\n"))` > --> `for(string_view const token : split_into_views(file_content, " >

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

2020-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 293392. JonasToth added a comment. - rebase to master after AST Matchers are extracted Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

[PATCH] D87588: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-09-15 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 landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG69f98311ca42: [ASTMatchers] extract public matchers from

[PATCH] D87588: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-09-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 291996. JonasToth added a comment. - rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87588/new/ https://reviews.llvm.org/D87588 Files: clang/docs/LibASTMatchersReference.html

[PATCH] D87588: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-09-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 291592. JonasToth added a comment. - fix compilation error from removed brace Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87588/new/ https://reviews.llvm.org/D87588 Files:

[PATCH] D87588: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-09-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 291467. JonasToth added a comment. - fix left over merge marker and one formatting problem Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87588/new/ https://reviews.llvm.org/D87588 Files:

[PATCH] D87588: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-09-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added a reviewer: aaron.ballman. Herald added subscribers: cfe-commits, steven.zhang. Herald added a project: clang. JonasToth requested review of this revision. The analysis for const-ness of local variables required a view generally useful matchers

[PATCH] D72553: [clang-tidy] Add performance-prefer-preincrement check

2020-09-13 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. Sorry for missing this review, i simply hadn't time :/ All my concerns are addressed and I think this is LGTM after rebasing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D54222: [clang-tidy] Add a check to detect returning static locals in public headers

2020-09-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Herald added subscribers: mgehre, Charusso. ping. This checks seems pretty much done. @jranieri-grammatech do you think there is something missing? Otherwise it could be rebased and comitted? Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION

[PATCH] D75107: [clang-tidy] hicpp-signed-bitwise IgnorePositiveIntegerLiterals now partially recursive

2020-09-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. ping. @njames93 are you revisiting this patch? What is the missing piece? Maybe i can help out a bit? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75107/new/ https://reviews.llvm.org/D75107

[PATCH] D82784: [clang-tidy] For `run-clang-tidy.py` do not treat `allow_enabling_alpha_checkers` as a none value.

2020-09-10 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 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82784/new/ https://reviews.llvm.org/D82784

[PATCH] D81923: [clang-tidy] Add modernize-use-ranges check.

2020-06-16 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. great to see such a check! Comment at: clang-tools-extra/clang-tidy/modernize/UseRangesCheck.cpp:77 + MatchCallTo((ID + "Begin").str(), namedDecl().bind(Range), + hasAnyName("::std::begin",

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

2020-01-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#1841086 , @AlexanderLanin wrote: > In D54943#1815772 , @0x8000- > wrote: > > > This generated 56 "const const" declarations, of which 25 were triple const! > This could

[PATCH] D73203: [clang-tidy] Prevent a remove only fixit causing a conflict when enclosed by another fixit

2020-01-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. We need tests for that. There should be tests for the exporting-feature. Maybe they could provide a good starting point on adding tests. (not sure if there is unit-test code for isolated testing, but some tests do exist!) Repository: rG LLVM Github Monorepo

[PATCH] D72553: [clang-tidy] Add performance-prefer-preincrement check

2020-01-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Yeah, the libc++ failures are not your fault :) My 2 cents added. Comment at: clang-tools-extra/clang-tidy/performance/PreferPreIncrementCheck.cpp:63 + + if (!getLangOpts().CPlusPlus || !TransformCxxOpCalls) +return; Why would

[PATCH] D73052: [clang-tidy] RenamerClangTidy now renames dependent member expr when the member can be resolved

2020-01-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp:282 +: DepMemberRef->getBaseType(); +CXXRecordDecl *Base = BaseType.getTypePtr()->getAsCXXRecordDecl(); +if (!Base) can

[PATCH] D71980: [clang-tidy] Disable Checks on If constexpr statements in template Instantiations for BugproneBranchClone and ReadabilityBracesAroundStatements

2020-01-19 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D71980#1810086 , @njames93 wrote: > Is this good to land and if so anyone able to commit? I marked this patch for porting into the release. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72630: [clang-tidy] Ignore implicit casts in modernize-use-default-member-init

2020-01-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. K. Thank you for fixing it! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72630/new/ https://reviews.llvm.org/D72630 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D72630: [clang-tidy] Ignore implicit casts in modernize-use-default-member-init

2020-01-13 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 in general. The linked bug report misses a "4" --> PR0, so please the description for that. Comment at:

[PATCH] D72505: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4c48ea68e491: [ASTMatchers] extract public matchers from const-analysis into own patch (authored by JonasToth). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72505: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 237514. JonasToth added a comment. - remove merge conflict markers in docs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72505/new/ https://reviews.llvm.org/D72505 Files:

[PATCH] D72505: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 237511. JonasToth added a comment. - fix compilation error, missing getType Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72505/new/ https://reviews.llvm.org/D72505 Files:

[PATCH] D72505: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 237510. JonasToth marked 3 inline comments as done. JonasToth added a comment. - add test for K functions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72505/new/ https://reviews.llvm.org/D72505 Files:

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

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. > Thank you for looking into this; I'll start building diff14 to test locally. Thanks :) > I'm good with merging this checker as-is, as long as it is not enabled by > default. Which part shall be disabled in your opinion? The whole check? that would not work xD But

[PATCH] D72362: [clang-tidy] misc-no-recursion: a new check

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. So that is were the CTU question comes from? :) Comment at: clang-tools-extra/clang-tidy/misc/NoRecursionCheck.cpp:21 + +inline bool operator==(const CallGraphNode::CallRecord , + const CallGraphNode::CallRecord ) {

[PATCH] D72239: [clang-tidy] new opencl recursion not supported check

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. The other recursion check seems more sophisticated. What is your take on it? Would you consider it better as well, what is your opinion on it? Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72239/new/

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

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @0x8000- i did remove `dependentTypes` from matching. Locally that works with your reported test-case (i was running clang-tidy wrong :(). I do understand the `auto &` issues now (i think). If the type is deduced to a template-type or something that depends the

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

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 237503. JonasToth added a comment. - fix false positive with ignoring dependentTypes 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

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 237501. JonasToth added a comment. - remove pointee-analysis artifacts as this will be done later - remove unnecessary comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/

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

2020-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#1815358 , @0x8000- wrote: > Here is a minimal example that shows the problem: > > #include > > template > struct DoGooder > { > DoGooder(void* accessor, SomeValue value) > { > } > >

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

2020-01-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#1815073 , @0x8000- wrote: > Applied the fix-it on one of our smaller (but C++ code bases) and it builds > and passes the tests. Comments: > > 1. I'm still seeing some false positives, where some locals that are

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

2020-01-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 237345. JonasToth added a comment. - test if references to pointers are ignored if pointers are ignored as values - add different possible auto constellations - document the problematic cases for 'auto' deductions I think a first pass of review might make

[PATCH] D72505: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-01-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 3 inline comments as done. JonasToth added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:4243 + if (FProto) { +QualType ParamType = FProto->getParamType(ParamIndex); +if (ParamMatcher.matches(ParamType, Finder,

[PATCH] D72505: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-01-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 237338. JonasToth added a comment. - address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72505/new/ https://reviews.llvm.org/D72505 Files: clang/docs/LibASTMatchersReference.html

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

2020-01-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 237317. JonasToth added a comment. - fix unit tests for exprmutanalyzer, whitespace was the problem - Merge branch 'master' into feature_transform_const.patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72505: [ASTMatchers] extract public matchers from const-analysis into own patch

2020-01-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. JonasToth added a child revision: D54943: [clang-tidy] implement const-transformation for cppcoreguidelines-const-correctness. The analysis for

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

2020-01-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 237136. JonasToth added a comment. - Merge branch 'master' into feature_transform_const.patch - actually dismiss function references - work on exclusion of variables that have type, autotype or reference-type to template parameter - by default analyze the

[PATCH] D72438: [clang-tidy] For checker `readability-misleading-indentation` update tests.

2020-01-09 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D72438#1811776 , @thakis wrote: > I'll point out that with this approach we lose all test coverage of the > checker with delayed template parsing on, even though most of the test works > in that mode and delayed template

[PATCH] D72438: [clang-tidy] For checker `readability-misleading-indentation` update tests.

2020-01-09 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. This check already existed in clang-tidy and had a bug. So we should fix that (thank you for that) and probably even backport (release coming soon). So even though clang itself

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

2020-01-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I did evaluate the performance of the check on LLVM with the script in the attachement. F11185973: full_transformation.sh The result, after splitting all multi-decl statements with `readability-isolate-declarations` (which

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

2020-01-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: clang/lib/Analysis/ExprMutationAnalyzer.cpp:20 AST_MATCHER_P(LambdaExpr, hasCaptureInit, const Expr *, E) { return llvm::is_contained(Node.capture_inits(), E);

[PATCH] D72333: [clang-tidy] Disable match on `if constexpr` statements in template instantiation for `readability-misleading-indentation` check.

2020-01-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Adding a `-fno-delayed-template-parsing` to the RUN-line should suffice. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72333/new/ https://reviews.llvm.org/D72333 ___

[PATCH] D72282: [clang-tidy] Add `bugprone-unintended-adl`

2020-01-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @Quuxplusone thank you for the input! I think it is a good idea if the library-implementors take a look at it. I myself don't have enough knowledge of C++ and the libraries to judge all this stuff. So who to ping or to add as reviewer? Comment at:

[PATCH] D72282: [clang-tidy] Add `bugprone-unintended-adl`

2020-01-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UnintendedADLCheck.cpp:43 + Whitelist( + utils::options::parseStringList(Options.get("Whitelist", "swap"))) {} + JonasToth wrote: > logan-5 wrote: > > JonasToth

[PATCH] D72217: [clang-tidy] Added readability-qualified-auto check

2020-01-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/list.rst:402 `hicpp-vararg `_, `cppcoreguidelines-pro-type-vararg `_, + `llvm-qualified-auto `_, `readability-qualified-auto `_, "Yes" That line needs to land above

[PATCH] D72217: [clang-tidy] Added readability-qualified-auto check

2020-01-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D72217#1807941 , @njames93 wrote: > What do you think about volatile qualifiers. Personally I don't think its > important to qualify an volatile on a pointer that is volatile, but i should > adhere to the decl being

[PATCH] D72333: [clang-tidy] Disable match on `if constexpr` statements in template instantiation for `readability-misleading-indentation` check.

2020-01-08 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! Thank you for fixing this issue. Can you please update the bug report as well? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72217: [clang-tidy] Added readability-qualified-auto check

2020-01-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D72217#1809721 , @njames93 wrote: > In D72217#1809685 , @njames93 wrote: > > > In D72217#1809212 , > > @Eugene.Zelenko wrote: > > > > > By the

[PATCH] D72378: [clang-tidy] Add `bugprone-reserved-identifier`

2020-01-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-reserved-identifier.rst:34 + If non-zero, inverts the check, i.e. flags names that are not reserved. + Default is `0`. + i think you need double-tick here. The

[PATCH] D72282: [clang-tidy] Add `bugprone-unintended-adl`

2020-01-08 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UnintendedADLCheck.cpp:89 + +const auto *Lookup = +Result.Nodes.getNodeAs("templateADLexpr"); logan-5 wrote: > JonasToth wrote: > > Can't you just bind directly to the

[PATCH] D72217: [clang-tidy] Added readability-qualified-auto check

2020-01-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/readability-qualified-auto.cpp:183 + + auto LambdaTest = [] { return 0; }; + // CHECK-MESSAGES-NOT: :[[@LINE-1]]:3: warning: 'auto LambdaTest' can be declared as 'auto *LambdaTest'

[PATCH] D72333: [clang-tidy] Disable match on `if constexpr` statements in template instantiation for `readability-misleading-indentation` check.

2020-01-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/readability-misleading-indentation.cpp:172 +void call() { + mustPass(); + mustPass(); please add an case that does not get instantiated, with both bad and good

[PATCH] D72282: [clang-tidy] Add `bugprone-unintended-adl`

2020-01-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UnintendedADLCheck.cpp:43 + Whitelist( + utils::options::parseStringList(Options.get("Whitelist", "swap"))) {} + logan-5 wrote: > JonasToth wrote: > > do you mean

[PATCH] D72284: [clang-tidy] Factor out renaming logic from readability-identifier-naming

2020-01-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. i am still fine with the patch. if no one else has objections, i think this can land. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72284/new/ https://reviews.llvm.org/D72284

[PATCH] D72217: [clang-tidy] Added readability-qualified-auto check

2020-01-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp:61 + Diag << FixItHint::CreateReplacement( + FixItRange, IsPtrConst ? "const auto *const " : "auto *const "); +} else { njames93 wrote:

[PATCH] D72284: [clang-tidy] Factor out renaming logic from readability-identifier-naming

2020-01-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp:272 + if (const auto *Typedef = + Value->getReturnType().getTypePtr()->getAs()) { +addUsage(NamingCheckFailures, Typedef->getDecl(),

[PATCH] D72282: [clang-tidy] Add `bugprone-unintended-adl`

2020-01-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/UnintendedADLCheck.cpp:43 + Whitelist( + utils::options::parseStringList(Options.get("Whitelist", "swap"))) {} + do you mean `std::swap`? If you it should be fully

[PATCH] D72284: [clang-tidy] Factor out renaming logic from readability-identifier-naming

2020-01-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I guess all the tests run? I think this LGTM after the nits are adressed. Comment at: clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp:203 + Decl = Ref.getDecl(); +} + What about the else? If it is unreachable

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

2020-01-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 236339. JonasToth added a comment. - fix false positive with parenListExpr, dont match so narrow for them - try removing more false positives, does not work Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-01-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#1805108 , @0x8000- wrote: > In D54943#1804943 , @JonasToth wrote: > > > - Merge branch 'master' into feature_transform_const.patch > > - link clangAnalysis to the

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

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 236259. JonasToth added a comment. - Merge branch 'master' into feature_transform_const.patch - link clangAnalysis to the cppcoreguidelines-module - fix InitListExpr as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#1804905 , @0x8000- wrote: > In D54943#1804904 , @JonasToth wrote: > > > In D54943#1804890 , @0x8000- > > wrote: > > > > > I

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

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In D54943#1804890 , @0x8000- wrote: > I can't build this on top of current llvm-project tree > (6a6e6f04ec2cd2f4f07ec4943036c5c2d47ce0c7 > ): > >

[PATCH] D72217: [clang-tidy] Added readability-qualified-auto check

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. +1 for the check from me as well :) Comment at: clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp:19 + if (!getLangOpts().CPlusPlus) { +// auto deduction not used in c +return; Please make the comments full

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

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. `clang/lib` almost transforms cleanly. issues still left: - `InitListExpr` can initialize non-const references. Such cases are not figured out yet (see `create_false_positive` at the end of the testcases) - I found a case in clang, where `const` was correctly added to

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

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 236253. JonasToth added a comment. - find more false positives - fix false positive with refernces to containers in range-for. This introduces false negative though - new test-case for check - fix range-for iterator speciality; start working on complex

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

2020-01-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 4 inline comments as done. JonasToth added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-const-correctness-values.cpp:608 +} + +template JonasToth wrote: > 0x8000- wrote: > > JonasToth wrote: > >

[PATCH] D72213: [clang-tidy] Add `bugprone-reserved-identifier` to flag usages of reserved C++ names

2020-01-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. i think it would be easier to review if there are two patches, one refactoring and one new check. Comment at: clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.h:59 + struct FailureInfo { +std::string KindName; // Tag or misc info to be

[PATCH] D56644: [clang-tidy] readability-container-size-empty handle std::string length()

2020-01-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Herald added a subscriber: mgehre. any news here? do you plan to finish this patch @Quolyk ? Do you mind if someone comandeers this patch? Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56644/new/

<    1   2   3   4   5   6   7   8   9   10   >