[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I like the new framework! Comment at: clang-tools-extra/clang-tidy/utils/TransformerTidy.cpp:43 + if (Rule.Explanation) { +if (Expected Explanation = Rule.Explanation(Result)) { + Message = *Explanation; these if-else are si

[PATCH] D61475: Update an information about ReSharper C++ and clang-tidy custom binary integration

2019-05-03 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: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61475/new/ https://reviews.llvm.org/D61475 __

[PATCH] D61508: [clang-tidy] misc-header-guard : a simple version of llvm-header-guard

2019-05-06 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Hi trixirt and thanks for the patch! I would rather like to generalize the llvm check to allow different styles and then alias the general version with different configurations. Introducing this code duplication does not sound like a good idea to me. The documentation

[PATCH] D61508: [clang-tidy] bugprone-header-guard : a simple version of llvm-header-guard

2019-05-07 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. > My understanding of the directory layout guidance in the docs is that > different styles get different directories. Yes, but for "the same check" we use aliases instead. When aliasing checks in different categories it is possible to change default configuration valu

[PATCH] D54757: [clang-tidy] new check: bugprone-branch-clone

2019-05-07 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. Did you run the new version over a big project like llvm again? If yes LGTM from my side, if not please do that before committing to ensure no new/other problems creeped in. CHANGES SIN

[PATCH] D52120: [analyzer] Treat std::{move, forward} as casts in ExprMutationAnalyzer.

2018-09-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Thank you very much for the good work from my side as well! Comment at: unittests/Analysis/ExprMutationAnalyzerTest.cpp:387 match(withEnclosingCompound(declRefTo("x")), AST->getASTContext()); - EXPECT_THAT(mutatedBy(Results, AST.get()), Elemen

[PATCH] D52120: [analyzer] Treat std::{move, forward} as casts in ExprMutationAnalyzer.

2018-09-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: unittests/Analysis/ExprMutationAnalyzerTest.cpp:387 match(withEnclosingCompound(declRefTo("x")), AST->getASTContext()); - EXPECT_THAT(mutatedBy(Results, AST.get()), ElementsAre("std::move(x)")); + EXPECT_FALSE(isMutated(Result

[PATCH] D52135: [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void

2018-09-16 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Could you please add a test, to show that non-templated function are still diagnosed correctly? The `isInstantiated` would only apply to templated functions. Why is the cast to void diagnosed anyway? It is not an argument nor is it used in a function context. Do you h

[PATCH] D52158: [clang-tidy] Remove duplicated logic in UnnecessaryValueParamCheck and use FunctionParmMutationAnalyzer instead.

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. LG from my side Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52158 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52120: [analyzer] Treat std::{move, forward} as casts in ExprMutationAnalyzer.

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth accepted this revision. JonasToth added a comment. The last testcase i mentioned, after that LGTM Comment at: unittests/Analysis/ExprMutationAnalyzerTest.cpp:441 + Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext()); + EXPECT_FALSE(isMutated

[PATCH] D52135: [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. > In https://reviews.llvm.org/D52135#1236220, @JonasToth wrote: > >> Why is the cast to void diagnosed anyway? It is not an argument nor is it >> used in a function context. Do you have an explaination for that? > > > Yes, this because when we find a function and the

[PATCH] D52135: [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/modernize-redundant-void-arg.cpp:495 + void g_1(void) const { + // CHECK-MESSAGES: :[[@LINE-1]]:11: warning: redundant void argument list in + // function definition [modernize-redunda

[PATCH] D52135: [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void

2018-09-17 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. LG from my side. I guess you found this in a real code base, if so could you please verify its fixed now. If @aaron.ballman, @alexfh or @hokein have no complaints it can be committed. D

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 165742. JonasToth added a comment. - [Feature] initial commit for extract decl experiment - [Feature] implement the last-element extraction version kinda ok - [Misc] work further on the experiment - do a full transformation of the multi decl stmt - [Misc] ad

[PATCH] D52135: [Clang-Tidy: modernize] Fix for modernize-redundant-void-arg: complains about variable cast to void

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Ok, if possible double check that it actually worked, otherwise not ;) Perfect! You can ofcourse commit yourself Am 17.09.2018 um 13:47 schrieb Idriss via Phabricator: > IdrissRio added a comment. > > In https://reviews.llvm.org/D52135#1236690, @JonasToth wrote: > >

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 7 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:51 + +return TypeAndName + " = " + Initializer + ";"; + } kbobyrev wrote: > JonasToth wrote: > > kbobyrev wrote: > > > This s

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 165749. JonasToth marked an inline comment as done. JonasToth added a comment. - improve diagnostic to include number of declared variables Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.tx

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 5 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:71 + auto Diag = + diag(WholeDecl->getBeginLoc(), "make only one declaration per statement"); + kbobyrev wrote: > Maybe it'

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 165752. JonasToth marked an inline comment as done. JonasToth added a comment. - use static functions instead anonymous namespace Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-

[PATCH] D48714: [clang-tidy] fix PR37913, templated exception factory diagnosed correctly

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 165756. JonasToth added a comment. get up to date to master Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48714 Files: clang-tidy/hicpp/ExceptionBaseclassCheck.cpp test/clang-tidy/hicpp-exception-baseclass.cpp Index: test/clang-tidy

[PATCH] D48714: [clang-tidy] fix PR37913, templated exception factory diagnosed correctly

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL342393: [clang-tidy] fix PR37913, templated exception factory diagnosed correctly (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.ll

[PATCH] D52178: [clang-tidy] use CHECK-NOTES in tests for bugprone-argument-comment

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, hokein. Herald added subscribers: cfe-commits, xazax.hun. This patch uses CHECK-NOTES for the tests. Its part of an effort to test *ALL* generated diagnostics in clang-tidy, as emitted notes were previously ignored.

[PATCH] D52179: [clang-tidy] Replace redundant checks with an assert().

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Is the condition for this assertion checked beforehand or could this create runtime failures? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[PATCH] D52185: [clang-tidy] use CHECK-NOTES in tests for bugprone-forward-declaration-namespace

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: aaron.ballman, alexfh, hokein. Herald added subscribers: cfe-commits, xazax.hun. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52185 Files: test/clang-tidy/bugprone-forward-declaration-namespace.cpp Index: test/clan

[PATCH] D52186: [clang-tidy] use CHECK-NOTES in bugprone-forwarding-reference-overload

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: aaron.ballman, alexfh, hokein. Herald added subscribers: cfe-commits, xazax.hun. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52186 Files: test/clang-tidy/bugprone-forwarding-reference-overload.cpp Index: test/clan

[PATCH] D52187: [clang-tidy] use CHECK-NOTES in bugprone-unused-return-value

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: aaron.ballman, alexfh, hokein. Herald added subscribers: cfe-commits, xazax.hun. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52187 Files: test/clang-tidy/bugprone-unused-return-value-custom.cpp test/clang-tidy/bug

[PATCH] D52178: [clang-tidy] use CHECK-NOTES in tests for bugprone-argument-comment

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE342458: [clang-tidy] use CHECK-NOTES in tests for bugprone-argument-comment (authored by JonasToth, committed by ). Changed prior to commit: https://reviews.llvm.org/D52178?vs=165784&id=165916#toc Re

[PATCH] D52178: [clang-tidy] use CHECK-NOTES in tests for bugprone-argument-comment

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL342458: [clang-tidy] use CHECK-NOTES in tests for bugprone-argument-comment (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org

[PATCH] D52186: [clang-tidy] use CHECK-NOTES in bugprone-forwarding-reference-overload

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL342459: [clang-tidy] use CHECK-NOTES in bugprone-forwarding-reference-overload (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.

[PATCH] D52186: [clang-tidy] use CHECK-NOTES in bugprone-forwarding-reference-overload

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE342459: [clang-tidy] use CHECK-NOTES in bugprone-forwarding-reference-overload (authored by JonasToth, committed by ). Changed prior to commit: https://reviews.llvm.org/D52186?vs=165806&id=165920#toc

[PATCH] D52187: [clang-tidy] use CHECK-NOTES in bugprone-unused-return-value

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 165926. JonasToth added a comment. - shorten warning checks Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52187 Files: test/clang-tidy/bugprone-unused-return-value-custom.cpp test/clang-tidy/bugprone-unused-return-value.cpp Index: t

[PATCH] D52228: [clang-tidy] use CHECK-NOTES in tests for bugprone-use-after-move

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, hokein. Herald added subscribers: cfe-commits, xazax.hun. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52228 Files: test/clang-tidy/bugprone-use-after-move.cpp Index: test/clang-tidy/bugprone-

[PATCH] D52187: [clang-tidy] use CHECK-NOTES in bugprone-unused-return-value

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL342468: [clang-tidy] use CHECK-NOTES in bugprone-unused-return-value (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D52187

[PATCH] D52229: [clang-tidy] use CHECK-NOTES in tests for bugprone suspicious-enum-usage

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, hokein. Herald added subscribers: cfe-commits, xazax.hun. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52229 Files: test/clang-tidy/bugprone-suspicious-enum-usage-strict.cpp test/clang-tidy/b

[PATCH] D52230: [clang-tidy] use CHECK-NOTES in tests for bugprone-macro-repeated-side-effects

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, hokein. Herald added subscribers: cfe-commits, xazax.hun. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52230 Files: test/clang-tidy/bugprone-macro-repeated-side-effects.c Index: test/clang-tid

[PATCH] D52219: [analyzer] (1/n) Support pointee mutation analysis in ExprMutationAnalyzer.

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Looks like a good start! I think getting the pointers right will be most difficult, because of the multiple levels of indirection they allow. Do you think it would be possible to the analysis for `>const?< int ***`-cases? (recursively checking through the pointer leve

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 166041. JonasToth added a comment. - Merge branch 'master' into experiment_isolate_decl - further work on isolate decl, fix tokenizing bug with templates - include big test-suite and make them run Repository: rCTE Clang Tools Extra https://reviews.llvm.

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 166044. JonasToth added a comment. - minor adjustments, add fixmes Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/IsolateDeclCheck.cpp clang-tidy/readability/

[PATCH] D52219: [analyzer] (1/n) Support pointee mutation analysis in ExprMutationAnalyzer.

2018-09-18 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: lib/Analysis/ExprMutationAnalyzer.cpp:481 + const auto AsArg = + anyOf(callExpr(hasAnyArgument(equalsNode(Exp))), +cxxConstructExpr(hasAnyArgument(equalsNode(Exp))), shuaiwang wrote: > JonasToth wrote

[PATCH] D52219: [analyzer] (1/n) Support pointee mutation analysis in ExprMutationAnalyzer.

2018-09-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: unittests/Analysis/ExprMutationAnalyzerTest.cpp:67 +if (const auto *DRE = dyn_cast(E)) { + if (DRE->getNameInfo().getAsString()[0] == 'p') +Finder = PointeeMutationFinder; shuaiwang wrote: > JonasToth

[PATCH] D52219: [analyzer] (1/n) Support pointee mutation analysis in ExprMutationAnalyzer.

2018-09-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: unittests/Analysis/ExprMutationAnalyzerTest.cpp:67 +if (const auto *DRE = dyn_cast(E)) { + if (DRE->getNameInfo().getAsString()[0] == 'p') +Finder = PointeeMutationFinder; shuaiwang wrote: > JonasToth

[PATCH] D52315: [clang-tidy] Fix for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy

2018-09-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/utils/TypeTraits.cpp:47 + + // Do not consider "expensive to copy" types not greater than a pointer + if (Context.getTypeSize(Type) <= Context.getTypeSize(Context.VoidPtrTy)) Please make that comment a sen

[PATCH] D52334: [clang-tidy] Build it even without static analyzer

2018-09-21 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Do builds even work properly if the CSA is not build right now? Comment at: clang-tidy/tool/CMakeLists.txt:32 clangTidyModernizeModule - clangTidyMPIModule clangTidyObjCModule Is the MPI module remove from the list of available

[PATCH] D52334: [clang-tidy] Build it even without static analyzer

2018-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D52334#1242811, @steveire wrote: > @JonasToth Sorry, I don't know what's unclear. I'm so surprised by your > question that I think maybe I'm missing something. I thought the commit > message and the patch itself are clear. Am I missing some

[PATCH] D52219: [analyzer] (1/n) Support pointee mutation analysis in ExprMutationAnalyzer.

2018-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: unittests/Analysis/ExprMutationAnalyzerTest.cpp:156 EXPECT_THAT(mutatedBy(Results, AST.get()), ElementsAre("x.mf()")); + + AST = tooling::buildASTFromCode( shuaiwang wrote: > JonasToth wrote: > > JonasToth wrote: >

[PATCH] D52334: [clang-tidy] Build it even without static analyzer

2018-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. >> Some of the clang-tidy stuff relies on Analysis/* from clang as well, e.g. >> the CFG class. Is this still included in builds with CSA off? > > The `Analysis` includes are ifdef'd out in the patch. Have you read the patch? Yes I did read the patch. `bugprone-use-af

[PATCH] D52334: [clang-tidy] Build it even without static analyzer

2018-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D52334#1242881, @steveire wrote: > Thanks, that at least makes it more obvious where you are getting confused. > > See `tools/clang/lib/CMakeLists.txt`. It contains: > > add_subdirectory(Analysis) > # ... > if(CLANG_ENABLE_STATIC_ANALYZ

[PATCH] D52219: [analyzer] (1/n) Support pointee mutation analysis in ExprMutationAnalyzer.

2018-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. TDD, thats ok ;) Am 22.09.2018 um 19:37 schrieb Shuai Wang via Phabricator: > shuaiwang added inline comments. > > > Comment at: unittests/Analysis/ExprMutationAnalyzerTest.cpp:156 > > EXPECT_THAT(mutatedBy(Results, AST.get()), ElementsAre("x.mf()

[PATCH] D52281: [clang-tidy] Add modernize check to use std::invoke in generic code

2018-09-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/modernize/ReplaceGenericFunctorCallCheck.cpp:70 + if (MFunctor && MFunctor->isTypeDependent()) { +const auto *Paren = static_cast(MFunctor->getCallee()); +const auto *BinOp = Eugene.Zelenko wrote: >

[PATCH] D52230: [clang-tidy] use CHECK-NOTES in tests for bugprone-macro-repeated-side-effects

2018-09-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Friendly ping :) Can i land all the test changes, or do you want to review them? The pattern will be the same, I just want them in different commits to revert better if something changes on different platforms. Repository: rCTE Clang Tools Extra https://reviews.ll

[PATCH] D52230: [clang-tidy] use CHECK-NOTES in tests for bugprone-macro-repeated-side-effects

2018-09-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. For the other patches and the following doing the same for other modules too? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52230 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.

[PATCH] D51041: [clang-tidy] Don't run misc-unused-using-decls check in C++17.

2018-09-24 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/misc-unused-using-decls-cxx17.cpp:1 +// RUN: %check_clang_tidy %s misc-unused-using-decls %t -- -- -fno-delayed-template-parsing -std=gnu++17 + why gnu++17 and not standard? Repository: rCTE Clang

[PATCH] D43500: [clang-tidy]: modernize-use-default-member-init: Remove trailing comma and colon.

2018-09-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. What is the status here? Will you continue to work on this patch @jdemeule (which would be great!) ? https://reviews.llvm.org/D43500 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/ma

[PATCH] D52219: [analyzer] (1/n) Support pointee mutation analysis in ExprMutationAnalyzer.

2018-09-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: unittests/Analysis/ExprMutationAnalyzerTest.cpp:156 EXPECT_THAT(mutatedBy(Results, AST.get()), ElementsAre("x.mf()")); + + AST = tooling::buildASTFromCode( shuaiwang wrote: > JonasToth wrote: > > shuaiwang wrote: >

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-25 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Commited for you. https://reviews.llvm.org/D52136 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-25 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL343000: [clang-tidy] Add modernize-concat-nested-namespaces check (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D5213

[PATCH] D52136: [clang-tidy] Add modernize-concat-nested-namespaces check

2018-09-25 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE343000: [clang-tidy] Add modernize-concat-nested-namespaces check (authored by JonasToth, committed by ). Repository: rL LLVM https://reviews.llvm.org/D52136 Files: clang-tidy/modernize/CMakeLists

[PATCH] D52230: [clang-tidy] use CHECK-NOTES in tests for bugprone-macro-repeated-side-effects

2018-09-25 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE343001: [clang-tidy] use CHECK-NOTES in tests for bugprone-macro-repeated-side-effects (authored by JonasToth, committed by ). Changed prior to commit: https://reviews.llvm.org/D52230?vs=165942&id=166

[PATCH] D45050: [clang-tidy] New checker for not null-terminated result caused by strlen(), size() or equal length

2018-09-26 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp:1038 + + SmallString<128> NewAddNullTermExprStr; + NewAddNullTermExprStr = "\n"; whisperity wrote: > aaron.ballman wrote: > > This should be done using a `Twine`.

[PATCH] D52334: [clang-tidy] Build it even without static analyzer

2018-09-26 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Please wait for explicit approval from @alexfh Am 26.09.2018 um 13:05 schrieb Stephen Kelly via Phabricator: > steveire added a comment. > > Can I go ahead and merge this now? > > Repository: > > rCTE Clang Tools Extra > > https://reviews.llvm.org/D52334 Reposi

[PATCH] D52334: [clang-tidy] Build it even without static analyzer

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. There has been a commit that seems related: https://reviews.llvm.org/rL343168 @steveire could you please take a look at how it affects this patch? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52334 ___ c

[PATCH] D52219: [analyzer] (1/n) Support pointee mutation analysis in ExprMutationAnalyzer.

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. LGTM, with a few nits and a question. Please wait a bit if @aaron.ballman or @george.karpenkov have any comments before committing. Comment at: lib/Analysis/ExprMutationAnalyzer.cpp:88 +bool isPointeeMutable(const Expr *Exp, const ASTContext &Context

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:21 + +#define PRINT_DEBUG 1 + kbobyrev wrote: > Do you plan to submit the patch with debugging messages or are you just using > these for better local debugging experience?

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167270. JonasToth marked 6 inline comments as done. JonasToth added a comment. - move lexer stuff into LexerUtils - remove custom string handling function - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 File

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167282. JonasToth marked 3 inline comments as done. JonasToth added a comment. - add space after clang-tidy in banner - refactor slightly, add better in-code comments to explain whats happening, add more TODOs and FIXMEs Repository: rCTE Clang Tools Ext

[PATCH] D52185: [clang-tidy] use CHECK-NOTES in tests for bugprone-forward-declaration-namespace

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL343198: [clang-tidy] use CHECK-NOTES in tests for bugprone-forward-declaration-namespace (authored by JonasToth, committed

[PATCH] D52228: [clang-tidy] use CHECK-NOTES in tests for bugprone-use-after-move

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL343199: [clang-tidy] use CHECK-NOTES in tests for bugprone-use-after-move (authored by JonasToth, committed by ). Herald a

[PATCH] D52229: [clang-tidy] use CHECK-NOTES in tests for bugprone suspicious-enum-usage

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL343201: [clang-tidy] use CHECK-NOTES in tests for bugprone suspicious-enum-usage (authored by JonasToth, committed by ). H

[PATCH] D52334: [clang-tidy] Build it even without static analyzer

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D52334#1247809, @steveire wrote: > @JonasToth Once again - `clangStaticAnalyzerCheckers` is not `clangAnalysis`. > Also, that commit changes the `mpi` plugin, which is excluded by this patch. I pinged because of the MPI thing, i did not lo

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. There are testcases with macro around line 100 in the default tests. I am not sure yet if `#define I_DECLS int i1, i2, i3;` should be diagnosed, but the other cases should. Am 27.09.2018 um 16:28 schrieb Kirill Bobyrev via Phabricator: > kbobyrev added a comment. > >

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:343 + auto Diag = + diag(WholeDecl->getBeginLoc(), "this statement declares %0 variables") + << static_cast( kbobyrev wrote: > aaron.ballman wrote: > > lebedev.ri

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 11 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:68 +if (Start.isInvalid() || Start.isMacroID()) + return SourceLocation(); + } kbobyrev wrote: > Also, I don't think th

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167377. JonasToth added a comment. - address review comments, most nits solved - fix typedefs and function pointers with comments as distraction - make memberpointer detection more accurate - move functioning member pointer test - clean debug output - clean

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:343 + auto Diag = + diag(WholeDecl->getBeginLoc(), "this statement declares %0 variables") + << static_cast( aaron.ballman wrote: > JonasToth wrote: > > kbobyrev w

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167381. JonasToth marked 9 inline comments as done. JonasToth added a comment. - simplification on FIXME:/TODO: Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/I

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 9 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:211 + std::vector Snippets; + Snippets.reserve(Ranges.size()); + kbobyrev wrote: > nit: It would be probably easier to have `Sni

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167389. JonasToth added a comment. - bail out in transformation if there are PP directives in the source range of the DeclStmt Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-ti

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167397. JonasToth added a comment. - fix doc typo Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/IsolateDeclCheck.cpp clang-tidy/readability/IsolateDeclCheck.

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167400. JonasToth added a comment. - last cleanup for today, testing on clang/lib looks good, but is already very clean Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/read

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167437. JonasToth added a comment. - write user-facing documentation Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/IsolateDeclCheck.cpp clang-tidy/readabilit

[PATCH] D27621: [clang-tidy] check to find declarations declaring more than one name

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Hi @firolino, I implemented a less general version of you check https://reviews.llvm.org/D51949 as I wanted to achieve a slightly different goal (and this revision seems to be abonded). My aim is to have general transformation capabilities to separate declarations (va

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D51949#1248850, @lebedev.ri wrote: > I have looked through tests, and it is possible that i just missed it, but > does it test/handle the cases like: > > struct S { > int X, Y, Z; // <- should be diagnosed. > } > Unfortunatly not

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:343 + auto Diag = + diag(WholeDecl->getBeginLoc(), "this statement declares %0 variables") + << static_cast( lebedev.ri wrote: > JonasToth wrote: > > aaron.ballman

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/readability-isolate-decl.cpp:184 + + int member1, member2; + // TODO: Transform FieldDecl's as well @lebedev.ri :P Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 __

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167445. JonasToth added a comment. - add tests for auto and decltype - rename check to 'readability-isolate-declaration' Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/read

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. LLVM works, Blender doesn't, the offending piece is `float (((*f_ptr2)))[42], *f_ptr3, f_value2 = 42.f;` (parens around the pointer). I am trying to fix that. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Blender looks better now, code compiles after full transformation F7327473: blender_isolated_decls.patch Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 ___ cfe-co

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. llvm and clang look fine as well. No miscompilation after fixing, tests run as well. (i do exclude all targets except x86 for build-speed) F7327680: cfe_isolated_decl.patch F7327681: llvm_isolated_decl.patch

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167491. JonasToth added a comment. Herald added subscribers: jsji, kbarton, nemanjai. - fix paren issue, introduced non-local changes i will extract and post in a separate patch - remove debug output for paren search Repository: rCTE Clang Tools Extra

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: docs/clang-tidy/checks/readability-isolate-declaration.rst:33 + for (int Begin = 0, End = 100; Begin < End; ++Begin); + it (int Begin = 42, Result = some_function(Begin); Begin == Result); + typo mention `if () int i

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167523. JonasToth added a comment. - simplify matcher slighty, as initStmt in if/switch don't have a compundstmt as parent, add suggested tests Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/bugprone/ArgumentCom

[PATCH] D52670: [clang-tidy] Add new 'readability-uppercase-literal-suffix' check (CERT DCL16-C, MISRA C:2012, 7.3, MISRA C++:2008, 2-13-4)

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Thanks for working on this! Related as well: http://www.codingstandard.com/rule/4-2-1-ensure-that-the-u-suffix-is-applied-to-a-literal-used-in-a-context-requiring-an-unsigned-integral-expression/ I think its wort a alias is hicpp as well Please add tests that use user

[PATCH] D52676: [clang-format] tweaked another case of lambda formatting

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Please upload the patch with full context (i belive `diff -c 999`) Comment at: lib/Format/TokenAnnotator.cpp:3054 + return true; +else if (!Style.BinPackArguments) + return true; please no `else` after return. You ca

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167588. JonasToth marked 2 inline comments as done. JonasToth added a comment. - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tidy/bugprone/Susp

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 15 inline comments as done. JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclarationCheck.cpp:52 + const LangOptions &LangOpts) { + assert(Indirections >= 0 && "Indirections must be non-ne

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167589. JonasToth added a comment. - fix spurious changes Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp clang-tidy/cppcoregu

[PATCH] D52684: [clang-tidy] NFC refactor lexer-utils slightly to be easier to use

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, hokein. Herald added subscribers: cfe-commits, kbarton, xazax.hun, nemanjai. JonasToth added a project: clang-tools-extra. This patch is a small refactoring necessary for 'readability-isolate-declaration' and does n

[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167591. JonasToth added a comment. - remove changes from lexerutils refactoring in other checks Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51949 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/IsolateDeclaratio

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

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Anything new here? Is there a LLVM foundation lawyer or something like that we can ask? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D36836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://

[PATCH] D52684: [clang-tidy] NFC refactor lexer-utils slightly to be easier to use

2018-09-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 167592. JonasToth added a comment. - fix missing file Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52684 Files: clang-tidy/bugprone/ArgumentCommentCheck.cpp clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp clang-tidy/cppcoreguidel

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