[PATCH] D31252: Clang-tidy: add readability-compound-statement-size check.

2017-03-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Hi and welcome to the clang/llvm community :) It seems that you took `readability-size` as starting point and modified it. Thats a good way to learn! My opinion is, that this should land in `readability-function-size`. This is somewhat recursive to function size. Whe

[PATCH] D31252: Clang-tidy: add readability-compound-statement-size check.

2017-03-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Another thought from me: Maybe it would be sensible to create a check like `complexity-limits` where different forms of complicated constructs are examined. This could include extreme inheritance, excessive amount of members in classes (violation of single responsibi

[PATCH] D30547: [clang-tidy] Forwarding reference overload in constructors

2017-03-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Why does diff contain so many files? Could you maybe merge the latest master into your branch? Repository: rL LLVM https://reviews.llvm.org/D30547 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llv

[PATCH] D31370: [clang-tidy] Prototype to check for exception specification

2017-03-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth planned changes to this revision. JonasToth marked 2 inline comments as done. JonasToth added a comment. commented review Comment at: clang-tidy/modernize/NoexceptCorrectnessCheck.cpp:60 + N.getNodeAs("direct_throwing_decl")) { +// FIXME how is that done?

[PATCH] D31370: [clang-tidy] Prototype to check for exception specification

2017-03-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: clang-tidy/modernize/NoexceptCorrectnessCheck.cpp:60 + N.getNodeAs("direct_throwing_decl")) { +// FIXME how is that done? i did not find a noThrow predicate +//if (ThrowingDe

[PATCH] D31887: [clangd] Add documentation page

2017-04-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: docs/clangd.rst:16 + +Clangd is not meant to be used by C/C++ developpers directly but rather from a client implementing the protocol. +A client would be typically implemented in an IDE or an editor. kromanenkov wrote

[PATCH] D29118: [clang-tidy] safety-no-vector-bool

2017-01-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tools-extra/clang-tidy/safety/NoVectorBoolCheck.cpp:50 +diag(MatchedDecl->getLocation(), + " function %0 returns an instance of std::vector") +<< MatchedDecl; jbcoe wrote: > djehuti wrote: > >

[PATCH] D29267: [clang-tidy] safety-no-assembler

2017-02-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. out of curiousity: i would like to contribute to the safety module as well. but currently there is no starting point in master. is there a way to get some code that i can start with? I think the module file where the registration happens would be enough. this is not s

[PATCH] D29267: [clang-tidy] safety-no-assembler

2017-02-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. alright :) https://reviews.llvm.org/D29267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D29267: [clang-tidy] safety-no-assembler

2017-02-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D29267#667614, @jbcoe wrote: > @alexfh Can we defer moving this to a compiler diagnostic? I'm keen to get a > target in place for people to write more safety checks. +1 from me :) and assembler might be bad style, but is it worth a warnin

[PATCH] D34654: Allow passing a regex for headers to exclude from clang-tidy

2017-07-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added reviewers: aaron.ballman, alexfh, hokein. JonasToth added a comment. i added reviewers, since it seems nobody takes care of this check. remove if this was bad. Repository: rL LLVM https://reviews.llvm.org/D34654 ___ cfe-commits ma

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D41815#973265, @lebedev.ri wrote: > In https://reviews.llvm.org/D41815#973260, @JonasToth wrote: > > > - check that jumps will only be forward. AFAIK that is required in all > > sensefull usecases of goto, is it? > > > You could implement lo

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp:20 + +AST_MATCHER(GotoStmt, isForwardJumping) { + lebedev.ri wrote: > It would be nice to have it in standard ASTMatchers, i believe it will be > useful for `else-after-

[PATCH] D41655: [clang-tidy] New check bugprone-unused-return-value

2018-01-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. High Integrity C++ has the rule `17.5.1 Do not ignore the result of std::remove, std::remove_if or std::unique`. Do we want to add those to the preconfigured list? https://reviews.llvm.org/D41655 ___ cfe-commits mailing

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 3 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp:20 + +AST_MATCHER(GotoStmt, isForwardJumping) { + lebedev.ri wrote: > JonasToth wrote: > > lebedev.ri wrote: > > > It would be

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129677. JonasToth marked 8 inline comments as done. JonasToth added a comment. - address review comments - add better documentation with code examples Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41815 Files: clang-tidy/cppcoreguideli

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 5 inline comments as done. JonasToth added inline comments. Comment at: docs/ReleaseNotes.rst:63 + + The usage of ``goto`` has been discouraged for a long time and is diagnosed + with this check. Eugene.Zelenko wrote: > I think will be good ide

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129684. JonasToth added a comment. - simplified the code and merged diagnostics Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41815 Files: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp clang-tidy/cppcoreguidelines/AvoidGotoCheck.h

[PATCH] D40737: [clang-tidy] Resubmit hicpp-multiway-paths-covered without breaking test

2018-01-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @sbenza and/or @klimek did you have time to address the stackoverflow caused from the ASTMatchers? I forgot to add the link to the original break: http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/5470/consoleFull#17462642768254eaf0-7326-4999-85b0-388101f2d

[PATCH] D40737: [clang-tidy] Resubmit hicpp-multiway-paths-covered without breaking test

2018-01-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129686. JonasToth added a comment. - get up to date to 7.0 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D40737 Files: clang-tidy/hicpp/CMakeLists.txt clang-tidy/hicpp/HICPPTidyModule.cpp clang-tidy/hicpp/MultiwayPathsCoveredCheck.c

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-01-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129690. JonasToth marked 3 inline comments as done. JonasToth added a comment. - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41648 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguideli

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-01-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129691. JonasToth added a comment. - minor issues fixed Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41648 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/

[PATCH] D40854: [clang-tidy] WIP implement cppcoreguidelines check for mixed integer arithmetic

2018-01-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129693. JonasToth added a comment. rebase to 7.0.0 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D40854 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppco

[PATCH] D41655: [clang-tidy] New check bugprone-unused-return-value

2018-01-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/bugprone/UnusedReturnValueCheck.cpp:47 +"^::std::launder$|" +"^::std::unique_ptr<.*>::release$|" +"^::std::.*::allocate$|"

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129760. JonasToth added a comment. - add edgecase test from roman Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41815 Files: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp clang-tidy/cppcoreguidelines/AvoidGotoCheck.h clang-tidy/c

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp:21 +AST_MATCHER(GotoStmt, isForwardJumping) { + return Node.getLocStart() < Node.getLabel()->getLocStart(); +} lebedev.ri wrote: > Hm, on a second thought, i think this

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 3 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp:21 +AST_MATCHER(GotoStmt, isForwardJumping) { + return Node.getLocStart() < Node.getLabel()->getLocStart(); +} lebedev.ri wro

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129863. JonasToth marked 4 inline comments as done. JonasToth added a comment. - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41815 Files: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp clang-tidy/cppcoregui

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp:43 + + // Backward jumps are diagnosed in all language modes. Forward jumps + // are sometimes required in C to free resources or do other clean-up aaron.ballman wrote:

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129865. JonasToth marked an inline comment as done. JonasToth added a comment. - [Fix] bug with language mode Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41815 Files: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp clang-tidy/cppco

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129868. JonasToth added a comment. - doc clarified that check is c++ only - add missing tests for `do` and `range-for`, not all combinations done, but every loop construct is used as outer and inner loop Repository: rCTE Clang Tools Extra https://revie

[PATCH] D41655: [clang-tidy] New check bugprone-unused-return-value

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/bugprone/UnusedReturnValueCheck.cpp:47 +"^::std::launder$|" +"^::std::unique_ptr<.*>::release$|" +"^::std::.*::allocate$|"

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129886. JonasToth added a comment. - [Feature] implement regex for allowed macros - [Test] add proper tests for regex silencing Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41648 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt cl

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129889. JonasToth marked 2 inline comments as done. JonasToth added a comment. - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41648 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguideli

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129890. JonasToth marked 2 inline comments as done. JonasToth added a comment. - doc fix Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41648 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuide

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added inline comments. Comment at: docs/clang-tidy/checks/cppcoreguidelines-macro-usage.rst:8 +constructs exist for the task. +The relevant sections in the C++ Coreguidelines are +`Enum.1

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129893. JonasToth added a comment. - address eugene comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41648 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. > Using regex could be a reasonable way out, but isn't going to solve the > problem in general because not all of the macro names are ones the user has > control over. Having to whitelist dozens of macros by name means this check > is simply going to be disabled by th

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129899. JonasToth marked 3 inline comments as done. JonasToth added a comment. - hicpp alias added - update documentation Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41815 Files: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp clan

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129900. JonasToth added a comment. - remove spurious whitespace Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41815 Files: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp clang-tidy/cppcoreguidelines/AvoidGotoCheck.h clang-tidy/cpp

[PATCH] D41648: [clang-tidy] implement cppcoreguidelines macro rules

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D41648#976665, @aaron.ballman wrote: > My gut reaction is still that this check is going to be too chatty on real > world code bases to be of value beyond compliance with the C++ Core > Guidelines, but that's also sufficient enough reason t

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 129901. JonasToth added a comment. - last nits i found Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41815 Files: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp clang-tidy/cppcoreguidelines/AvoidGotoCheck.h clang-tidy/cppcoreguide

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 130113. JonasToth marked an inline comment as done. JonasToth added a comment. - [Misc] remove spurious format Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41815 Files: clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp clang-tidy/cppc

[PATCH] D41815: [clang-tidy] implement check for goto

2018-01-17 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE322626: [clang-tidy] implement check for goto (authored by JonasToth, committed by ). Changed prior to commit: https://reviews.llvm.org/D41815?vs=130113&id=130115#toc Repository: rCTE Clang Tools E

[PATCH] D40854: [clang-tidy] WIP implement cppcoreguidelines check for mixed integer arithmetic

2018-01-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. The guideline authors will focus on mixing integer length and integer signdness. > Thank you for the suggestion! Per our editor's discussion, we agree with "If > one then mixes integer lengths and signedness in calculations confusion on > what happens might occur" and

[PATCH] D30547: [clang-tidy] Forwarding reference overload in constructors

2017-03-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. added my thoughts. i like the check, seems really thought out :) Comment at: docs/clang-tidy/checks/misc-forwarding-reference-overload.rst:36 + +The check warns for constructors C1 and C2, because those can act like +described above. We suppress w

[PATCH] D30547: [clang-tidy] Forwarding reference overload in constructors

2017-03-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. please add the check in the release notes as well. https://reviews.llvm.org/D30547 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D30547: [clang-tidy] Forwarding reference overload in constructors

2017-03-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: docs/clang-tidy/checks/misc-forwarding-reference-overload.rst:38 +constructors. We suppress warnings if the copy and the move constructors are both +disabled (deleted or private), because there is nothing the prefect forwarding +const

[PATCH] D30896: [CLANG-TIDY] add check misc-prefer-switch-for-enums

2017-03-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I like that check. But I think it could take another feature. In my opinion it would be valueable to check if enums are compared against ints as well. For example enum Kind k = Kind::a; if (k == 3) { /* something */ } This usecase is not specially considered here

[PATCH] D30896: [CLANG-TIDY] add check misc-prefer-switch-for-enums

2017-03-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. alright. then i have a good check for myself to write ;) https://reviews.llvm.org/D30896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 3 inline comments as done. JonasToth added a comment. removed the function calls, a little doc tidy as well Repository: rL LLVM https://reviews.llvm.org/D26167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 81103. JonasToth added a comment. fixes last review comments from alex Repository: rL LLVM https://reviews.llvm.org/D26167 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 81193. JonasToth marked 2 inline comments as done. JonasToth added a comment. last fixes in the code, from alex Repository: rL LLVM https://reviews.llvm.org/D26167 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppC

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I did run clang-tidy with $(./run-clang-tidy.py -checks=-*,cppcoreguidelines-no-malloc). The resulting output is in the appended file. Since all warnings came from header files (llvms custom containers?) there are always the same warnings for all source files. Every f

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: docs/clang-tidy/checks/cppcoreguidelines-no-malloc.rst:10 +See `C++ Core Guidelines +` + --

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: clang-tidy/cppcoreguidelines/NoMallocCheck.cpp:29 + Finder->addMatcher( + callExpr(callee(functionDecl(hasAnyName("::malloc", "::calloc" + .bind("aquisition"),

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 81204. JonasToth added a comment. fix missing variable in doc Repository: rL LLVM https://reviews.llvm.org/D26167 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoregu

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 81208. JonasToth added a comment. adjusted doc. Repository: rL LLVM https://reviews.llvm.org/D26167 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp clang-tidy/cppcoreguidelines/NoMal

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 4 inline comments as done. JonasToth added inline comments. Comment at: docs/clang-tidy/checks/cppcoreguidelines-no-malloc.rst:10 +See `C++ Core Guidelines +` + --

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. tbh. i dont know anything how the clang workflow works :) do i need to ask someone to commit, or what be my next step? Repository: rL LLVM https://reviews.llvm.org/D26167 ___ cfe-commits mailing list cfe-commits@lists.

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D26167#621106, @alexfh wrote: > Jonas, do you need someone to commit the patch for you? i think so, yes. can i trigger somehow automatically, that this will go into the code base somehow? Repository: rL LLVM https://reviews.llvm.org/D

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. alright, i will try to get the functionpointers as well. what do you think about configuration of the allocating functions? e.g. for aligned memory you must use OS-specific allocation functions. should the check catch custom allocation functions as well? is there a way

[PATCH] D32346: [clang-tidy] New readability check for strlen argument

2017-04-21 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. My thoughts on the check added. Have you run it over a big codebase? What is the turnout? Comment at: clang-tidy/readability/StrlenArgumentCheck.cpp:23 + Finder->addMatcher( + callExpr(callee(functionDecl(hasName("strlen"))), + has

[PATCH] D32395: [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

2017-04-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. please note this enhancement in the ReleaseNotes. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:93 + to(functionDecl(hasName("::std::make_pair" + + .bind("make_pair")); is the new lin

[PATCH] D32346: [clang-tidy] New readability check for strlen argument

2017-04-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/readability-strlen-argument.cpp:1 +// RUN: %check_clang_tidy %s readability-strlen-argument %t + danielmarjamaki wrote: > JonasToth wrote: > > Same as documentation, maybe a little more telling examples

[PATCH] D32346: [clang-tidy] New readability check for strlen argument

2017-04-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: docs/clang-tidy/checks/readability-strlen-argument.rst:8 + +In the example code below the developer probably wanted to make room for an extra char in the allocation but misplaced the addition. + when the intend was to

[PATCH] D32346: [clang-tidy] New readability check for strlen argument

2017-04-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. > #include > void dostuff(const char *P) { > > if (strncmp(P+2,"xyz",3)==0) {} > > } > > Iam not super familiar with C, but the intend of the function is to check the following: P = "foxyz", P2 = "abxyz", P3 = "opxyz", ... And if P matches this kind of st

[PATCH] D32346: [clang-tidy] New readability check for strlen argument

2017-04-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: docs/clang-tidy/checks/readability-strlen-argument.rst:8 + +In the example code below the developer probably wanted to make room for an extra char in the allocation but misplaced the addition. + danielmarjamaki wrote:

[PATCH] D32690: [clang-tidy] modernize-use-emplace: Remove unnecessary make_tuple calls

2017-04-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Nothing to complain from my side. Would it make sense to add boost pairs/tuples support? I could imagine modernize checks that would transform boost structures into the stl ones, but that's another discussion probably. Something for a later check: the same logic shoul

[PATCH] D32743: [clang-tidy] Add new cert-dcl21-cpp check.

2017-05-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/cert/PostfixOperatorCheck.cpp:27 +hasOverloadedOperatorName("--"))) + .bind("decl"), + this); could the `,this);` be on thi

[PATCH] D32690: [clang-tidy] modernize-use-emplace: Remove unnecessary make_tuple calls

2017-05-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. i like the generalization. Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:115 unless(isInTemplateInstantiation())) .bind("call"), this); i t

[PATCH] D31370: [clang-tidy] Prototype to check for exception specification

2017-05-04 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. this check is somewhat duplicated to a check currently in review, which seemed to be abondened? https://reviews.llvm.org/D19201 I will read that one first and try to coordinate with the author. Repository: rL LLVM https://reviews.llvm.org/D31370 __

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

2022-01-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 404296. JonasToth added a comment. - use boolean for option parsing Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files: clang-tools-extra/clang-tidy/cppcoreguide

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

2022-01-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 404297. JonasToth added a comment. - use boolean for options - fix snafoo on `arc` usage Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files: clang-tools-extra/cl

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2022-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 400291. JonasToth marked an inline comment as done. JonasToth added a comment. - improve documentation a bit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

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

2022-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 400293. JonasToth added a comment. - fix release note ordering Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files: clang-tools-extra/clang-tidy/cppcoreguidelines

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

2022-01-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 400296. JonasToth added a comment. - fix: adjust unit test for new array-pointer condition in range-based for loops Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Fi

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

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

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

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

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

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

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

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

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

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

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

2021-09-05 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 370807. JonasToth marked 2 inline comments as done. JonasToth added a comment. - minor adjustments for comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54943/new/ https://reviews.llvm.org/D54943 Files:

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

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

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

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

<    9   10   11   12   13   14   15   >