[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] 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] 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 hi

[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] 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 https://reviews.llvm.org/D72333/n

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

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

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

[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] 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 ___ cfe-comm

[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); https://

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

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

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

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

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

[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 https://reviews.llvm.org/D5494

[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 clang/

[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, &P

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

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

[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-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/ https://reviews.llvm.or

[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: clang-tools-extra/CMakeL

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

[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/ https://reviews.llvm.

[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 &LHS, + const CallGraphNode::CallRecord &RHS) { -

[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] 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&R functions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72505/new/ https://reviews.llvm.org/D72505 Files: c

[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: clang/docs/LibASTMatchersReferenc

[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: clang/docs/LibASTMatchersReference

[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 https://reviews.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: clang-tools-extra/test/clang-tidy/checkers/modernize-

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

[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] 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 https://re

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

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

[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: clang/docs/LibASTM

[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: clang/docs/LibASTMatchersRefere

[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 clang/include/clang/AST

[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 const-ana

[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: clang-tools-extra/CMak

[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, " > \t\r\n"))

[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/ https://reviews.llvm.org/

[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 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: clang-tools-extra

[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: clang-tools-extra/clang-tidy/cppcoregu

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

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

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

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

[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/ https://review

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

[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 > - https://github.com/SonarSource/sonar-java/p

[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"), isConst(),

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

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

[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: clang/lib/Analysis

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

[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] 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] 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 list

[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] 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] 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 https://reviews

[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: clang-tools-extra/clang-tidy/cppcore

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

[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 clang/uni

[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: clang/lib/Analysis/ExprMutationAn

[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( + hasTrueExpression(ignoringParens(canResolveToExpr(InnerMatche

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

[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: clang-tools-extra/clang-tidy/cp

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

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

[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/ https://revie

[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: clang-tools-extra/clang-tidy/cppcoreguideli

[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: clang-tools-extr

[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 = hasType(isConstQu

[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: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLi

[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/ https://re

[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 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] 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 cfe-co

[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 https://li

[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 ___ cfe-co

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

[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: clang-tools-extra/clang-tidy/

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

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

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

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

[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: clang-tools-extra/clang-tid

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

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

[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 (IsNormalVariableInTempl

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

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

[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/ https://reviews.llvm.org/D1

<    7   8   9   10   11   12   13   14   15   >