[PATCH] D51297: [docs] Create a guide for Vim users on how to setup Clangd

2018-08-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Very nice! Switching to clangd means that YCM is not necessary anymore? https://reviews.llvm.org/D51297 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D51297: [docs] Create a guide for Vim users on how to setup Clangd

2018-08-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Very nice :) I will try to get it running for vim 8.0 on ubuntu 18.04 (hopefully this week!) and share if i had success :) Am 27.08.2018 um 16:57 schrieb Kirill Bobyrev via Phabricator: > kbobyrev added a comment. > > In https://reviews.llvm.org/D51297#1214321, @Jona

[PATCH] D51332: [clang-tidy] Replace deprecated std::ios_base aliases

2018-08-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Hi andobence, thank you for the contribution. The check looks very good! Please add it to the release notes and synchronize the first line of the doc with the short sentence in the release notes describing what this check does. Comment at: clang-tid

[PATCH] D51332: [clang-tidy] Replace deprecated std::ios_base aliases

2018-08-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/modernize/DeprecatedIosBaseAliasesCheck.cpp:34 + // provide any benefit to other languages, despite being benign. + if (!getLangOpts().CPlusPlus) +return; Which standard supplies the replacement functi

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

2018-08-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 162945. JonasToth added a comment. - [Misc] comment the matcher to better understand it - [Fix] adjust the test cases to properly function now Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48714 Files: clang-tidy/hicpp/ExceptionBasecla

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

2018-08-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a subscriber: lebedev.ri. JonasToth added a comment. I had to revert the `CHECK-NOTES` change that @lebedev.ri introduced with his revision. It fails the test, i think there is an inconsistency or so in the check-clang-tidy script. I will try to figure out whats the issue. ===

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

2018-08-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 162950. JonasToth added a comment. - [Test] use CHECK-NOTES again based on the fix in check_clang_tidy Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48714 Files: clang-tidy/hicpp/ExceptionBaseclassCheck.cpp test/clang-tidy/hicpp-exce

[PATCH] D51381: [clang-tidy] fix check_clang_tidy to properly mix CHECK-NOTES and CHECK-MESSAGES

2018-08-28 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman, lebedev.ri, hokein. Herald added subscribers: cfe-commits, xazax.hun. This patch adjusts the check_clang_tidy.py script to tolerate warnings in the codepath that checks for notes. Checking for warnings itself should

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

2018-08-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D48714#1216989, @lebedev.ri wrote: > In https://reviews.llvm.org/D48714#1216537, @JonasToth wrote: > > > I had to revert the `CHECK-NOTES` change that @lebedev.ri introduced with > > his revision. It fails the test, i think there is an incon

[PATCH] D51381: [clang-tidy] fix check_clang_tidy to properly mix CHECK-NOTES and CHECK-MESSAGES

2018-08-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @lebedev.ri lets do it in the the other patch, to not split discussions. But what do you mean by `You would still have to duplicate the check-lines for error: though.`? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51381 _

[PATCH] D50542: [clang-tidy] Add abseil-no-internal-deps check

2018-08-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D50542#1217511, @hugoeg wrote: > nit comment fixed DO you have commit rights or shall i commit for you? https://reviews.llvm.org/D50542 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D50542: [clang-tidy] Add abseil-no-internal-deps check

2018-08-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Committed r340928. Thanks very much! Will you (and your team) upstream even more abseil checks? I think it might be reasonable to ask for commit rights. https://reviews.llvm.org/D50542 ___ cfe-commits mailing list cfe-co

[PATCH] D50542: [clang-tidy] Add abseil-no-internal-deps check

2018-08-29 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL340928: [clang-tidy] Add abseil-no-internal-dependencies check (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D50542?v

[PATCH] D50542: [clang-tidy] Add abseil-no-internal-deps check

2018-08-29 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Ok. Then we can commit for you guys, no problem :) Am 29.08.2018 um 16:34 schrieb Hugo Gonzalez via Phabricator: > hugoeg added a comment. > > In https://reviews.llvm.org/D50542#1217517, @JonasToth wrote: > >> Committed r340928. Thanks very much! >> >> Will you (and

[PATCH] D51381: [clang-tidy] fix check_clang_tidy to properly mix CHECK-NOTES and CHECK-MESSAGES

2018-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Yes, you are write. I would ensure in the script that `CHECK-MESSAGES XOR CHECK-NOTES` is used, to avoid the mistake i made. I can do it in this diff as well. Am 29.08.2018 um 20:29 schrieb Roman Lebedev via Phabricator: > lebedev.ri added a comment. > > In https://r

[PATCH] D51381: [clang-tidy] fix check_clang_tidy to properly mix CHECK-NOTES and CHECK-MESSAGES

2018-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 163273. JonasToth added a comment. - adjust check_clang_tidy to use either CHECK-NOTES or CHECK-MESSAGES but not both Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51381 Files: test/clang-tidy/check_clang_tidy.py Index: test/clang-t

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

2018-08-30 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 163274. JonasToth added a comment. - [Misc] migrate to CHECK-NOTES - fix outcommented check messages as well Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48714 Files: clang-tidy/hicpp/ExceptionBaseclassCheck.cpp test/clang-tidy/hicp

[PATCH] D51381: [clang-tidy] fix check_clang_tidy to forbid mixing of CHECK-NOTES and CHECK-MESSAGES

2018-08-30 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341039: [clang-tidy] fix check_clang_tidy to forbid mixing of CHECK-NOTES and CHECK… (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews

[PATCH] D51294: Fix Bug 38713: clang-format mishandles a short block after "default:" in a switch statement

2018-09-02 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Commited for Owen in r341284. Repository: rC Clang https://reviews.llvm.org/D51294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D51294: Fix Bug 38713: clang-format mishandles a short block after "default:" in a switch statement

2018-09-02 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341284: Fix Bug 38713: clang-format mishandles a short block after "default:" in a… (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://revi

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-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. Ups, sorry i overlooked. I applied your changes to the current version of the const check, and everything seems fine. The false negative is gone. Repository: rCTE Clang Tools Extra

[PATCH] D51220: [clang-tidy] run-clang-tidy fails using python 3.7

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Unicode works both with python3 and python2 (but seemed to work before too). Otherwise LG Comment at: clang-tidy/tool/run-clang-tidy.py:169 failed_files.append(name) - -if is_py2: The patch does not apply clean to master b

[PATCH] D45679: [clang-tidy] Add ExprMutationAnalyzer, that analyzes whether an expression is mutated within a statement.

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @shuaiwang What are you working on next? Do you have an idea on how we will handle the pointee of a pointer? That would be very interesting for my const-correctness check. if you need help with anything, just say so. I would like to support Am 10.09.2018 um 18:49 schrie

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

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 164690. JonasToth added a comment. - Fix typedependant expressions are ignored This one took me way longer then it should have, but I discovered new templated code constructs and added test accordingly. Repository: rCTE Clang Tools Extra https://revie

[PATCH] D45679: [clang-tidy] Add ExprMutationAnalyzer, that analyzes whether an expression is mutated within a statement.

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D45679#1229176, @shuaiwang wrote: > I have a rough idea about how `findPointeeMutation` would look like, I'm > pretty sure I can use a lot of your help :) > My current plan: > > - Finish the few existing pending changes > - Move the analyze

[PATCH] D50953: [clang-tidy] Handle sugared reference types in ExprMutationAnalyzer

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. What happens to pointers in a typedef (in the sense of `*` instead of `&`)? Comment at: clang-tidy/utils/ExprMutationAnalyzer.cpp:51 const auto nonConstReferenceType = [] { - return referenceType(pointee(unless(isConstQualified(; + return hasUn

[PATCH] D50883: [clang-tidy] Handle unique owning smart pointers in ExprMutationAnalyzer

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a subscriber: aaron.ballman. JonasToth added a comment. > Different from std::vector::operator[] which has two overloads for const > and non-const access, std::unique_ptr only has one const version of > `operator->`. > > So for SmartPtr x; x->mf(); we only see a const operator

[PATCH] D51880: [ASTMatchers] add two matchers for dependent expressions

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: aaron.ballman, alexfh, klimek. Herald added a subscriber: cfe-commits. The new matchers can be used to check if an expression is type- or value-dependent in a templated context. These matchers are used in a clang-tidy check and generally

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

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 164721. JonasToth added a comment. - use the global ASTMatchers for dependent expressions Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48714 Files: clang-tidy/hicpp/ExceptionBaseclassCheck.cpp test/clang-tidy/hicpp-exception-basecla

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

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I added more testcases for templates and improved the diagnostics with notes. This includes newly discovered false positives related to uninstantiated templates. @alexfh, @hokein Would you like to see better diagnostics? Repository: rCTE Clang Tools Extra https:/

[PATCH] D51884: [clang-tidy] ExprMutationAnalyzer: construct from references. Fixes PR38888

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I am in favor of the change. I feel that the `findMutation...` functions that take raw pointers should get the assertions though, at least the ones in the public interface. Having them for the private ones won't hurt either. Repository: rCTE Clang Tools Extra htt

[PATCH] D51884: [clang-tidy] ExprMutationAnalyzer: construct from references. Fixes PR38888

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I think you dont need tests there. Its just life insurance :) I'd stick with pointers because working with the AST always results in pointers. It is more convenient to stay in pointerland there. >> I feel that the `findMutation...` functions that take raw pointers shou

[PATCH] D50883: [clang-tidy] Handle unique owning smart pointers in ExprMutationAnalyzer

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Ofc the current limitation with assuming always modification stays with my proposed tests. But these are the tests we need once implemented full analysis of pointers. Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:658 +

[PATCH] D51898: Revert "[clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer"

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. i had an issue with msvc before, where `-fno-delayed-template-parsing` had to be added to the compilation, because MSVC did not have uninstantiated templates. Maybe this could be similar? But i am not sure how to resolve the issue here, as you probably can't pass in f

[PATCH] D50953: [clang-tidy] Handle sugared reference types in ExprMutationAnalyzer

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D50953#1230003, @shuaiwang wrote: > In https://reviews.llvm.org/D50953#1229287, @JonasToth wrote: > > > What happens to pointers in a typedef (in the sense of `*` instead of `&`)? > > > I checked around and I believe reference type is the onl

[PATCH] D50883: [clang-tidy] Handle unique owning smart pointers in ExprMutationAnalyzer

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:658 + "void f() { UniquePtr x; x->mf(); }"); + Results = match(withEnclosingCompound(declRefTo("x")), AST->getASTContext()); + EXPECT_FALSE(isMutated(Results, AST.

[PATCH] D51880: [ASTMatchers] add two matchers for dependent expressions

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D51880#1229513, @aaron.ballman wrote: > Missing tests and changes to Registry.cpp for dynamic matchers. > > Also, do you want to add `isInstantiationDependent()` at the same time, given > the relationship with the other two matchers? Do yo

[PATCH] D51880: [ASTMatchers] add two matchers for dependent expressions

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 164863. JonasToth added a comment. - add isInstantiationDependent matcher as well - add unit tests for new matchers Repository: rC Clang https://reviews.llvm.org/D51880 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.

[PATCH] D51880: [ASTMatchers] add two matchers for dependent expressions

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 164873. JonasToth added a comment. - fix typos, include example in doc and adjust tests Repository: rC Clang https://reviews.llvm.org/D51880 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/

[PATCH] D51880: [ASTMatchers] add two matchers for dependent expressions

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 164876. JonasToth added a comment. rebase to master Repository: rC Clang https://reviews.llvm.org/D51880 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests/ASTMatchers

[PATCH] D45444: [clang-tidy] implement new check for const-correctness

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 164898. JonasToth added a comment. - ignore lambdas properly Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45444 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.cpp clang-tidy/c

[PATCH] D51880: [ASTMatchers] add three matchers for dependent expressions

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341958: [ASTMatchers] add three matchers for dependent expressions (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D51880

[PATCH] D51880: [ASTMatchers] add three matchers for dependent expressions

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC341958: [ASTMatchers] add three matchers for dependent expressions (authored by JonasToth, committed by ). Changed prior to commit: https://reviews.llvm.org/D51880?vs=164876&id=164907#toc Repository:

[PATCH] D50883: [clang-tidy] Handle unique owning smart pointers in ExprMutationAnalyzer

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Your point is valid, that the decision of what to analyze should be done outside. My const-correctness check does analyze all versions of the templated function, because it just matches on `functionDecl(compoundStmt())`. Maybe we just need some experience with real worl

[PATCH] D50883: [clang-tidy] Handle unique owning smart pointers in ExprMutationAnalyzer

2018-09-11 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 https://reviews.llvm.org/D50883 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://l

[PATCH] D50953: [clang-tidy] Handle sugared reference types in ExprMutationAnalyzer

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Could you please add a mutating test for the pointers as well? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mai

[PATCH] D50953: [clang-tidy] Handle sugared reference types in ExprMutationAnalyzer

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. > I feel constness doesn't matter much since we're treating them as values and > both const values & non-const values are just values. marking the pointer itself const is not very common as well, thats why i feel we should be especially exhaustive with our tests as re

[PATCH] D50953: [clang-tidy] Handle sugared reference types in ExprMutationAnalyzer

2018-09-11 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 https://reviews.llvm.org/D50953 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://l

[PATCH] D45444: [clang-tidy] implement new check for const-correctness

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. F7179032: llvm_lib_references.out F7179031: llvm_lib_pointer_values.out F7179030: llvm_lib_values.out Here are results for `llvm/lib` with the current version.

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

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 164948. JonasToth marked 7 inline comments as done. JonasToth added a comment. - Merge branch 'master' into check_macros_usage - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41648 Files: clang-tidy/cppcoreguide

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

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: rsmith, aaron.ballman, alexfh, hokein. Herald added subscribers: cfe-commits, xazax.hun, mgorny. The idea of this check is to enforce one decl per statement and to include an automated code transformation for all multi-decl statments. It

[PATCH] D51950: [clangtidy] Remove old copy of ExprMutationAnalyzer

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. LGTM (not owner, but alexfh was not involved in the ExprMutAnalyzer so far, i think he has no concerns with moving that around as it is fairly new as well) Am 11.09.2018 um 23:44 schrieb George Karpenkov via Phabricator: > george.karpenkov added a comment. > > Looks g

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

2018-09-11 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Ty for the initial review, I am currently rewriting the approach for it. I will probably make the business logic as standalone class/functions to utilize this functionality in multiple checks. I first try to evaluate my approach and as I had many unclear things i opened

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

2018-09-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I knew there was something already but I couldn't find it. Thank you for pointing me there :) I will inspect the code and then decide, maybe I will incorporate some of his stuff into mine or take his one over. Am 12.09.2018 um 08:04 schrieb Roman Lebedev via Phabricato

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

2018-09-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:35 + + std::string TypeAndName = + VarType.getAsString(TypePrinter) + " " + D->getNameAsString(); kbobyrev wrote: > `llvm::Twine` here? Seems like this one is used a lo

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

2018-09-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D51949#1232443, @kbobyrev wrote: > I've been thinking about corner-cases (e.g. don't split `DeclStmt`s within > init-statement declaration) a while and it seems that there might be many of > them. Yes, things I am currently thinnking of:

[PATCH] D52008: [analyzer] Handle forwarding reference better in ExprMutationAnalyzer.

2018-09-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. The new functionality looks very good. It can be used in a readability check that suggests `const` for parameters. Comment at: include/clang/Analysis/Analyses/ExprMutationAnalyzer.h:32 const Stmt *findMutation(const Expr *Exp); + const Stmt *find

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

2018-09-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 165321. JonasToth added a comment. This is the newer and better working code to slice and separate multiple vardecls in a multi-decl stmt. I want this version only for now, as the multiple variable definitions in one statement are by far the most common vari

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

2018-09-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:35 +namespace { +SourceLocation findNextTerminator(SourceLocation Start, const SourceManager &SM, + const LangOptions &LangOpts) { Remove du

[PATCH] D52008: [analyzer] Handle forwarding reference better in ExprMutationAnalyzer.

2018-09-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D52008#1233667, @shuaiwang wrote: > Just some quick comments, I'll take a deeper look into other comments later. > > This diff along unfortunately won't be able to handle `emplace_back` just > yet, the reason (I believe, haven't fully tested

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

2018-09-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Yes, do you think it should be included in the diag? Am 13.09.2018 um 22:09 schrieb Roman Lebedev via Phabricator: > lebedev.ri added inline comments. > > > Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:200 > + > + diag(WholeDecl->getBeg

[PATCH] D52008: [analyzer] Handle forwarding reference better in ExprMutationAnalyzer.

2018-09-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. The `std::move` as cast is a follow up patch? From my side only the nits are left. Comment at: lib/Analysis/ExprMutationAnalyzer.cpp:333 +const auto *Parm = Nodes.getNodeAs("parm"); +const auto AllParams = +Func->getPrimaryTemplate()-

[PATCH] D51332: [clang-tidy] Replace deprecated std::ios_base aliases

2018-09-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. LG from my side, please rebase that patch on top of master. Currently the Release Notes would conflict (and please sort the release note alphabetically). If the other reviewers do not say anything within a reasonable time it can be committed. Do you have commit rights

[PATCH] D51332: [clang-tidy] Replace deprecated std::ios_base aliases

2018-09-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. And i forgot: Could you please run this over a real code base, if you know one that actually uses these types? I assume not so many code bases actually use these. https://reviews.llvm.org/D51332 ___ cfe-commits mailing li

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

2018-09-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 9 inline comments as done. JonasToth added a comment. I do consider the diagnostic thing as resolved given the lack of further comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48714 ___ cfe-commits mailing

[PATCH] D45444: [clang-tidy] implement new check for const-correctness

2018-09-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 165497. JonasToth added a comment. - update to ExprMutAnalyzer living in clang now Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45444 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/ConstCorrectnessCh

[PATCH] D45444: [clang-tidy] implement new check for const-correctness

2018-09-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Soonish it might be able to do so ;) Am 14.09.2018 um 17:13 schrieb Dávid Bolvanský via Phabricator: > xbolva00 added a comment. > > Yeah, it would be super useful if Clang can add const to all places where > possible :) love this work, great! > > Repository: > >

[PATCH] D52008: [analyzer] Handle forwarding reference better in ExprMutationAnalyzer.

2018-09-14 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 Comment at: lib/Analysis/ExprMutationAnalyzer.cpp:381 +FunctionParmMutationAnalyzer::findMutation(const ParmVarDecl *Parm) { + const auto Memoized = Results.find(

[PATCH] D45444: [clang-tidy] implement new check for const-correctness

2018-09-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 165568. JonasToth added a comment. - fix actually use clang-analyses correctly Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45444 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/ConstCorrectnessCheck.

[PATCH] D45444: [clang-tidy] implement new check for const-correctness

2018-07-19 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Yes, but that is complicated. Functionality for that will first be implemented in the libTooling and then utilized here later. Am 19.07.2018 um 04:16 schrieb Florin Iucha via Phabricator: > 0x8000- added a comment. > > Any plans for fix-its that will add the sugge

[PATCH] D48759: [ASTMatchers] add matcher for decltypeType and its underlyingType

2018-07-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 156609. JonasToth marked an inline comment as done. JonasToth added a comment. - [Misc] add test and more doc - Merge branch 'master' into matcher_decltypetype Repository: rC Clang https://reviews.llvm.org/D48759 Files: include/clang/ASTMatchers/ASTM

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

2018-07-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: test/clang-tidy/hicpp-exception-baseclass.cpp:191 +void templated_thrower() { throw T{}(); } +// CHECK-MESSAGES: [[@LINE-1]]:34: warning: throwing an exception whose type 'int' is not derived from 'std::exception' + a

[PATCH] D48717: [clang-tidy] fix PR36489 - respect deduced pointer types from auto as well

2018-07-20 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. > I don't think we want to modify `hasType()` -- that would strip off too much > type information if it automatically reached through to the underlying type. > However, we may want to consider adding something like `hasUnderlyingType()` > that checks the matcher again

[PATCH] D49618: [clang-tidy] remove private decltypeType in TrailingReturnType

2018-07-20 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. This patch removes a private matcher in fuchsia/TrailingReturnType check because the matcher is now in ASTMatchers Repository: rCTE Clang Tools Extra ht

[PATCH] D48759: [ASTMatchers] add matcher for decltypeType and its underlyingType

2018-07-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 156800. JonasToth added a comment. - rebase to master Repository: rC Clang https://reviews.llvm.org/D48759 Files: include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/ASTMatchersInternal.cpp lib/ASTMatchers/Dynamic/Registry.cpp unittests/AST

[PATCH] D48759: [ASTMatchers] add matcher for decltypeType and its underlyingType

2018-07-23 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL337703: [ASTMatchers] add matcher for decltypeType and its underlyingType (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D

[PATCH] D49618: [clang-tidy] remove private decltypeType in TrailingReturnType

2018-07-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 156805. JonasToth added a comment. - rebase to master Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49618 Files: clang-tidy/fuchsia/TrailingReturnCheck.cpp Index: clang-tidy/fuchsia/TrailingReturnCheck.cpp ===

[PATCH] D49618: [clang-tidy] remove private decltypeType in TrailingReturnType

2018-07-23 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL337707: [clang-tidy] remove private decltypeType in TrailingReturnType (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D496

[PATCH] D48717: [clang-tidy] fix PR36489 - respect deduced pointer types from auto as well

2018-07-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 2 inline comments as done. JonasToth added a comment. The tests do run now with decltype too. Still ready to land? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48717 ___ cfe-commits mailing list cfe-commits@lists

[PATCH] D48717: [clang-tidy] fix PR36489 - respect deduced pointer types from auto as well

2018-07-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 156812. JonasToth added a comment. rebase to master Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48717 Files: test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arithmetic.cpp Index: test/clang-tidy/cppcoreguidelines-pro-bounds-po

[PATCH] D48717: [clang-tidy] fix PR36489 - respect deduced pointer types from auto as well

2018-07-23 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE337710: [clang-tidy] fix PR36489 - respect deduced pointer types from auto as well (authored by JonasToth, committed by ). Changed prior to commit: https://reviews.llvm.org/D48717?vs=156812&id=156813#

[PATCH] D49682: [clang-tidy] fix PR36489 - respect deduced pointer types from auto as well

2018-07-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. Herald added subscribers: cfe-commits, kbarton, xazax.hun, nemanjai. The cppcoreguidelines-pro-bounds-pointer-arithmetic warns on all occassion where pointer arithmetic is used, but does not check values where the pointer types is deduced via `auto`. This patch adj

[PATCH] D49682: [clang-tidy] fix PR36489 - respect deduced pointer types from auto as well

2018-07-23 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 156823. JonasToth added a comment. rebase to master Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49682 Files: clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp test/clang-tidy/cppcoreguidelines-pro-bounds-pointer-arit

[PATCH] D49682: [clang-tidy] fix PR36489 - respect deduced pointer types from auto as well

2018-07-23 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 rCTE337716: [clang-tidy] fix PR36489 - respect deduced pointer types from auto as well (authored by JonasToth, committed by

[PATCH] D49850: [ASTMatchers] fix the missing documentation for new decltypeType matcher

2018-07-26 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth created this revision. JonasToth added reviewers: alexfh, aaron.ballman. Herald added a subscriber: cfe-commits. Regenerate the Matchers documentation, forgotten in the original patch. Repository: rC Clang https://reviews.llvm.org/D49850 Files: docs/LibASTMatchersReference.html

[PATCH] D49850: [ASTMatchers] fix the missing documentation for new decltypeType matcher

2018-07-26 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC338022: [ASTMatchers] fix the missing documentation for new decltypeType matcher (authored by JonasToth, committed by ). Changed prior to commit: https://reviews.llvm.org/D49850?vs=157474&id=157475#toc

[PATCH] D49850: [ASTMatchers] fix the missing documentation for new decltypeType matcher

2018-07-26 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 157474. JonasToth added a comment. rebase Repository: rC Clang https://reviews.llvm.org/D49850 Files: docs/LibASTMatchersReference.html Index: docs/LibASTMatchersReference.html === ---

[PATCH] D49114: [clang-tidy] Add a check for "magic numbers"

2018-07-26 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I did not find any major issue :) Comment at: clang-tidy/readability/MagicNumbersCheck.cpp:20 +bool isUsedToInitializeAConstant( +const clang::ast_matchers::MatchFinder::MatchResult &Result, +const clang::ast_type_traits::DynTypedNode &Node) {

[PATCH] D45444: [clang-tidy] implement new check for const-correctness

2018-07-26 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @aaron.ballman Are you missing something in this check/tests? I think i will remove the big comment with my thoughts on what has to be done, or do you think it would help for reference? I would probably be able to finalize this week if there is no major issue, so it

[PATCH] D49890: Clang-Tidy Export Problem

2018-07-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: ClangTidy.cpp:612 + + FileManager *Files = new FileManager(FileSystemOptions()); + vfs::FileSystem &FileSystem = *Files->getVirtualFileSystem(); Eugene.Zelenko wrote: > You could use auto here, because type is in new

[PATCH] D49890: Clang-Tidy Export Problem

2018-07-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D49890#1178103, @lebedev.ri wrote: > I'm not sure what this differential *actually* does. This is a follow up from this discussion on the mailing list: http://clang-developers.42468.n3.nabble.com/Fwd-Running-Clang-Tidy-on-a-Large-Project-t

[PATCH] D49890: Clang-Tidy Export Problem

2018-07-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: ClangTidy.cpp:612 + + std::unique_ptr Files = + make_unique(FileSystemOptions()); in this case you can use `auto` again, because the type of the `unique_ptr` is clear from the `make_unique` call. Repository:

[PATCH] D49890: Clang-Tidy Export Problem

2018-07-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: ClangTidy.cpp:614 + vfs::FileSystem &FileSystem = *Files->getVirtualFileSystem(); + auto InitialWorkingDir = FileSystem.getCurrentWorkingDirectory(); + if (!InitialWorkingDir) TheAhmad wrote: > Eugene.Zelenko wrote:

[PATCH] D49890: Clang-Tidy Export Problem

2018-07-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Actually, maybe this patch is relevant for clang-tooling itself (where the compilation-database stuff actually is). @alexfh what is your opinion on that? `llvm/tools/clang/unittests/Tooling/CompilationDatabaseTest.cpp` This is the path for the unittests there. `llvm/t

[PATCH] D49114: [clang-tidy] Add a check for "magic numbers"

2018-07-31 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D49114#1182071, @0x8000- wrote: > The state of this patch: > > - user interface is as agreed-upon, giving end-users the capability to filter > out floats and ints as it makes sense for their code base > - code is clean > - documentation

[PATCH] D50060: [clang-tidy] add all clang-tidy modules to plugin

2018-07-31 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, mgorny, srhines. This patch addresses PR38359 and adds all existing clang-tidy modules to the plugin that can be used together with libclang. Repository:

[PATCH] D50060: [clang-tidy] add all clang-tidy modules to plugin

2018-07-31 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I reordered the anchoring list to be in alphabetical order as well! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

[PATCH] D50060: [clang-tidy] add all clang-tidy modules to plugin

2018-07-31 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 158278. JonasToth added a comment. - rebase Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50060 Files: clang-tidy/plugin/CMakeLists.txt clang-tidy/plugin/ClangTidyPlugin.cpp Index: clang-tidy/plugin/ClangTidyPlugin.cpp =

[PATCH] D50060: [clang-tidy] add all clang-tidy modules to plugin

2018-07-31 Thread Jonas Toth via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL338393: [clang-tidy] add all clang-tidy modules to plugin (authored by JonasToth, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D50060 Files:

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

2018-07-31 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 158282. JonasToth added a comment. rebase 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/hicpp-e

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