Re: [PATCH] D13946: Shrink DynTypedNode by one pointer from 40 to 32 bytes (on x86_64).

2015-10-21 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: include/clang/AST/ASTTypeTraits.h:250 @@ +249,3 @@ +return NodeKind.hasPointerIdentity() + ? *reinterpret_cast(Storage.buffer) + : nullptr; I'm not sure about this reinterpret_cast. We are

Re: [PATCH] D7639: Add readability-redundant-void-arg check to clang-tidy

2015-10-26 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. Just fyi, I am looking at this diff. It is very large with a lot of rounds of comments and I didn't have the context. I don't know if I should giving comments at this point of the change, but here it is. Have you considered matching on typeLoc() instead of having a large

Re: [PATCH] D14096: [clang-tidy] add new check cppcoreguidelines-pro-type-cstyle-cast

2015-10-26 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp:44 @@ +43,3 @@ + if (MatchedCast->getCastKind() == CK_BitCast || + MatchedCast->getCastKind() == CK_LValueBitCast || + MatchedCast->getCastKind() == CK_IntegralToPointer

Re: [PATCH] D14096: [clang-tidy] add new check cppcoreguidelines-pro-type-cstyle-cast

2015-10-27 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. In http://reviews.llvm.org/D14096#275902, @xazax.hun wrote: > There is already a similar check in the Google package. What are the > differences between those two checks? What is the reason we can not just > register that check into the core guidelines module? That

Re: [PATCH] D7639: Add readability-redundant-void-arg check to clang-tidy

2015-10-27 Thread Samuel Benzaquen via cfe-commits
sbenza accepted this revision. sbenza added a comment. This revision is now accepted and ready to land. Just wanted to know it was considered, and it was. It looks good to me then. http://reviews.llvm.org/D7639 ___ cfe-commits mailing list

Re: [PATCH] D13640: [clang-tidy] Add new check cppcoreguidelines-pro-bounds-array-to-pointer-decay

2015-10-26 Thread Samuel Benzaquen via cfe-commits
sbenza accepted this revision. sbenza added a comment. This revision is now accepted and ready to land. Just one formatting comment. Comment at: clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp:52 @@ +51,3 @@ + + diag(MatchedCast->getExprLoc(), "do not

Re: [PATCH] D7639: Add readability-redundant-void-arg check to clang-tidy

2015-10-23 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. I'm sorry. This change fell through the cracks. I'll take a look today. http://reviews.llvm.org/D7639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D13899: Fix bug in suggested fix that truncated variable names to 1 character.

2015-11-11 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/misc/UnusedParametersCheck.cpp:25 @@ +24,3 @@ +template +static CharSourceRange removeNode(const MatchFinder::MatchResult , + const T *PrevNode, const T *Node, aaron.ballman

Re: [PATCH] D13784: [clang-tidy] add check cppcoreguidelines-pro-type-union-access

2015-10-16 Thread Samuel Benzaquen via cfe-commits
sbenza accepted this revision. sbenza added a comment. This revision is now accepted and ready to land. Seems straightforward. http://reviews.llvm.org/D13784 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D13746: [clang-tidy] add check cppcoreguidelines-pro-bounds-constant-array-index

2015-10-16 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. Thanks for the patch. A few comments below. Comment at: clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp:23 @@ +22,3 @@ + + Finder->addMatcher(arraySubscriptExpr(hasBase(ignoringImpCasts(hasType(constantArrayType().bind("type", +

Re: [PATCH] D13787: [clang-tidy] add check cppcoreguidelines-pro-type-vararg-use

2015-10-16 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargUseCheck.cpp:20 @@ +19,3 @@ +void ProTypeVarargUseCheck::registerMatchers(MatchFinder *Finder) { + Finder->addMatcher(callExpr(callee(functionDecl(isVariadic(.bind("expr"), this); +}

Re: [PATCH] D13746: [clang-tidy] add check cppcoreguidelines-pro-bounds-constant-array-index

2015-10-16 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp:55 @@ +54,3 @@ + if (!IndexExpr->isIntegerConstantExpr(Index, *Result.Context, nullptr, true)) { +//Fixit would need gsl::at() +diag(Matched->getExprLoc(), "do

Re: [PATCH] D13510: [PATCH] Support C++ Core Guidelines copy assignment restrictions

2015-10-07 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. In http://reviews.llvm.org/D13510#261925, @aaron.ballman wrote: > In http://reviews.llvm.org/D13510#261825, @Eugene.Zelenko wrote: > > > I think it'll be fine to rename check without leaving traces of misc. Same > > thing happened with modernize-shrink-to-fit. > > > I

Re: [PATCH] D13787: [clang-tidy] add check cppcoreguidelines-pro-type-vararg-use

2015-10-19 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp:26 @@ +25,3 @@ + Finder->addMatcher( + varDecl(hasType(pointsTo(cxxRecordDecl(hasName("__va_list_tag") + .bind("va_list"), Is there a way to look for

Re: [PATCH] D13787: [clang-tidy] add check cppcoreguidelines-pro-type-vararg-use

2015-10-19 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-pro-type-vararg.cpp:27 @@ +26,3 @@ +template +void CallFooIfAvailableImpl(T& t, ...) { +} You would still warn on the callers of this. Maybe we should ignore any call if the variadic

[clang-tools-extra] r250742 - Added check uniqueptr-delete-release to replace "delete x.release()" with "x = nullptr"

2015-10-19 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Mon Oct 19 16:49:51 2015 New Revision: 250742 URL: http://llvm.org/viewvc/llvm-project?rev=250742=rev Log: Added check uniqueptr-delete-release to replace "delete x.release()" with "x = nullptr" Reviewers: alexfh Differential Revision: http://reviews.llvm.org/D13179

[PATCH] D13899: Fix bug in suggested fix that truncated variable names to 1 character.

2015-10-20 Thread Samuel Benzaquen via cfe-commits
sbenza created this revision. sbenza added reviewers: alexfh, aaron.ballman. sbenza added a subscriber: cfe-commits. Fix bug in suggested fix that truncated variable names to 1 character. Also, rework the suggested fix to try to remove unnecessary whitespace. http://reviews.llvm.org/D13899

Re: [PATCH] D13787: [clang-tidy] add check cppcoreguidelines-pro-type-vararg-use

2015-10-20 Thread Samuel Benzaquen via cfe-commits
sbenza accepted this revision. sbenza added a comment. This revision is now accepted and ready to land. Thanks for check. http://reviews.llvm.org/D13787 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D13787: [clang-tidy] add check cppcoreguidelines-pro-type-vararg-use

2015-10-20 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. Minor comments only. Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp:29 @@ +28,3 @@ + callExpr(callee(functionDecl(isVariadic(), + unless(hasName("__builtin_va_start") +

Re: [PATCH] D13784: [clang-tidy] add check cppcoreguidelines-pro-type-union-access

2015-10-16 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp:20 @@ +19,3 @@ +void ProTypeUnionAccessCheck::registerMatchers(MatchFinder *Finder) { +

Re: [PATCH] D13787: [clang-tidy] add check cppcoreguidelines-pro-type-vararg-use

2015-10-19 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargUseCheck.cpp:20 @@ +19,3 @@ +void ProTypeVarargUseCheck::registerMatchers(MatchFinder *Finder) { + Finder->addMatcher(callExpr(callee(functionDecl(isVariadic(.bind("expr"), this); +}

Re: [PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-07 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-pro-type-static-cast-downcast.cpp:28 @@ +27,3 @@ + + auto P0 = static_cast(new Base()); + // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: do not use static_cast to downcast from a base to a

Re: [PATCH] D13640: [clang-tidy] Add new check cppcoreguidelines-pro-bounds-array-to-pointer-decay

2015-10-12 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp:29 @@ +28,3 @@ + implicitCastExpr(unless(hasParent(arraySubscriptExpr())), +

Re: [PATCH] D13446: [PATCH] Add checker discouraging definition of variadic function definitions in C++

2015-10-05 Thread Samuel Benzaquen via cfe-commits
sbenza accepted this revision. sbenza added a comment. This revision is now accepted and ready to land. See comment regarding //CHECKs Comment at: test/clang-tidy/cert-variadic-function-def.cpp:4 @@ +3,3 @@ +// Variadic function definitions are diagnosed. +// CHECK-MESSAGES:

r246037 - [ASTMatchers] Add type matcher for SubstTemplateTypeParmType.

2015-08-26 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Wed Aug 26 11:15:59 2015 New Revision: 246037 URL: http://llvm.org/viewvc/llvm-project?rev=246037view=rev Log: [ASTMatchers] Add type matcher for SubstTemplateTypeParmType. Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h

Re: [PATCH] D13311: [clang-tidy] Add check cppcoreguidelines-pro-bounds-pointer-arithmetic

2015-10-02 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp:38 @@ +37,3 @@ + Finder->addMatcher( + arraySubscriptExpr(hasBase(implicitCastExpr(hasSourceExpression( +

Re: [PATCH] D13368: [clang-tidy] add check cppcoreguidelines-pro-type-static-cast-downcast

2015-10-02 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: test/clang-tidy/cppcoreguidelines-pro-type-static-cast-downcast.cpp:19 @@ +18,3 @@ + // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: do not use static_cast to cast from base to derived. Use dynamic_cast instead. (C++ Core Guidelines, rule

Re: [PATCH] D13311: [clang-tidy] Add check cppcoreguidelines-pro-bounds-pointer-arithmetic

2015-10-05 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp:35 @@ +34,3 @@ + + //Array subscript on a pointer (not an array) is also pointer arithmetic + Finder->addMatcher( Space after // Comment

Re: [PATCH] D15506: [ASTMatchers] Allow hasName() to look through inline namespaces

2015-12-15 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 42884. sbenza added a comment. Add a faster version of the qualified name matcher. It falls back to the previous version if it can't handle the name. http://reviews.llvm.org/D15506 Files: include/clang/ASTMatchers/ASTMatchersInternal.h

Re: [PATCH] D15506: [ASTMatchers] Allow hasName() to look through inline namespaces

2015-12-15 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:322 @@ +321,3 @@ + for (bool SkipUnwritten : SkipUnwrittenCases) { +llvm::SmallString<128> NodeName = StringRef("::"); +llvm::raw_svector_ostream OS(NodeName); yaron.keren

Re: [PATCH] D15506: [ASTMatchers] Allow hasName() to look through inline namespaces

2015-12-14 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 42767. sbenza added a comment. Minor fixes http://reviews.llvm.org/D15506 Files: lib/ASTMatchers/ASTMatchersInternal.cpp unittests/ASTMatchers/ASTMatchersTest.cpp Index: unittests/ASTMatchers/ASTMatchersTest.cpp

Re: [PATCH] D15506: [ASTMatchers] Allow hasName() to look through inline namespaces

2015-12-14 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. I am thinking on doing this some other way. Copying the PrintingPolicy object is very expensive, as it contains quite a few strings and vectors of strings. In the past I changed this matcher to make no allocations in the common path (ie using SmallString<>, etc) to

[PATCH] D15506: [ASTMatchers] Allow hasName() to look through inline namespaces

2015-12-14 Thread Samuel Benzaquen via cfe-commits
sbenza created this revision. sbenza added a reviewer: klimek. sbenza added a subscriber: cfe-commits. Herald added a subscriber: klimek. Allow hasName() to look through inline namespaces. This will fix the interaction between some clang-tidy checks and libc++. libc++ defines names in an inline

r256278 - [ASTMatchers] Add booleanType() matcher.

2015-12-22 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Tue Dec 22 14:06:40 2015 New Revision: 256278 URL: http://llvm.org/viewvc/llvm-project?rev=256278=rev Log: [ASTMatchers] Add booleanType() matcher. Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h cfe/trunk/lib/ASTMatchers/Dynamic/Registry.cpp

r256284 - [ASTMatchers] Fix typo in booleanType() doc.

2015-12-22 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Tue Dec 22 15:06:36 2015 New Revision: 256284 URL: http://llvm.org/viewvc/llvm-project?rev=256284=rev Log: [ASTMatchers] Fix typo in booleanType() doc. Fix typo in booleanType() doc and recreate the LibASTMatchersReference.html reference document. Modified:

Re: r256278 - [ASTMatchers] Add booleanType() matcher.

2015-12-22 Thread Samuel Benzaquen via cfe-commits
On Tue, Dec 22, 2015 at 3:16 PM, Aaron Ballman <aa...@aaronballman.com> wrote: > On Tue, Dec 22, 2015 at 3:06 PM, Samuel Benzaquen via cfe-commits > <cfe-commits@lists.llvm.org> wrote: > > Author: sbenza > > Date: Tue Dec 22 14:06:40 2015 > > New Revision:

Re: [PATCH] D8149: Add hasUnderlyingType narrowing matcher for TypedefDecls, functionProtoType matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes

2016-01-12 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:4994 @@ +4993,3 @@ + EXPECT_TRUE(matches("typedef int hasUnderlyingTypeTest;", + typedefDecl(hasUnderlyingType(asString("int"); + EXPECT_TRUE(matches("typedef const int

[clang-tools-extra] r271896 - [clang-tidy] Do not try to suggest a fix if the parameter is partially in a macro.

2016-06-06 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Mon Jun 6 09:21:11 2016 New Revision: 271896 URL: http://llvm.org/viewvc/llvm-project?rev=271896=rev Log: [clang-tidy] Do not try to suggest a fix if the parameter is partially in a macro. It is not easy to tell where to do the suggestion and whether the suggestion will be

Re: [PATCH] D21036: Misplaced const-qualification with typedef types

2016-06-06 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. I think this would be more interesting with macros. Eg triggering in code like this: #define FOO(type, op) const type& X = op() FOO(int*, bar); Comment at: clang-tidy/misc/MisplacedConstCheck.cpp:32 @@ +31,3 @@ + +static QualType

Re: [PATCH] D21036: Misplaced const-qualification with typedef types

2016-06-07 Thread Samuel Benzaquen via cfe-commits
sbenza accepted this revision. This revision is now accepted and ready to land. Comment at: clang-tidy/misc/MisplacedConstCheck.cpp:22 @@ +21,3 @@ + Finder->addMatcher( + valueDecl(allOf(hasType(isConstQualified()), + hasType(typedefType(hasDeclaration(

Re: [PATCH] D21036: Misplaced const-qualification with typedef types

2016-06-07 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/misc/MisplacedConstCheck.cpp:22 @@ +21,3 @@ + Finder->addMatcher( + valueDecl(allOf(hasType(isConstQualified()), + hasType(typedefType(hasDeclaration( allOf() is unnecessary

Re: [PATCH] D20917: [clang-tidy] Add RemoveStars option to the modernize-use-auto check

2016-06-02 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. Is it a typo in the description when it says that when RemoveStar is on we will write 'auto*' instead if 'auto'? http://reviews.llvm.org/D20917 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] r271426 - Fix uninitialized memory access when the token 'const' is not present in

2016-06-01 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Wed Jun 1 15:37:23 2016 New Revision: 271426 URL: http://llvm.org/viewvc/llvm-project?rev=271426=rev Log: Fix uninitialized memory access when the token 'const' is not present in the program. If the token is not there, we still warn but we don't try to give a fixit hint.

Re: [PATCH] D21185: [clang-tidy] Add performance-emplace-into-containers

2016-06-17 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. Missing the .rst file. Did you use the check_clang_tidy.py script to create the template? Comment at: clang-tidy/performance/EmplaceCheck.cpp:25 @@ +24,3 @@ + cxxMemberCallExpr( + on(expr(hasType(cxxRecordDecl(hasName("std::vector"), +

Re: [PATCH] D20964: [clang-tidy] Add modernize-use-emplace

2016-06-21 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tools-extra/trunk/clang-tidy/modernize/UseEmplaceCheck.cpp:34 @@ +33,3 @@ + hasDeclaration(functionDecl(hasName("push_back"))), + on(hasType(cxxRecordDecl(hasAnyName("std::vector", "llvm::SmallVector", +

[PATCH] D16152: [clang-tidy] Add check performance-faster-string-find

2016-01-13 Thread Samuel Benzaquen via cfe-commits
sbenza created this revision. sbenza added a reviewer: alexfh. sbenza added a subscriber: cfe-commits. Add check performance-faster-string-find. It replaces single character string literals to character literals in calls to string::find and friends. http://reviews.llvm.org/D16152 Files:

Re: [PATCH] D16152: [clang-tidy] Add check performance-faster-string-find

2016-01-14 Thread Samuel Benzaquen via cfe-commits
sbenza marked an inline comment as done. Comment at: clang-tidy/performance/FasterStringFindCheck.cpp:51 @@ +50,3 @@ + const auto StringFindFunctions = + anyOf(hasName("find"), hasName("rfind"), hasName("find_first_of"), +hasName("find_first_not_of"),

Re: [PATCH] D16152: [clang-tidy] Add check performance-faster-string-find

2016-01-14 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 44889. sbenza marked 2 inline comments as done. sbenza added a comment. Added support for non 'char' chars. http://reviews.llvm.org/D16152 Files: clang-tidy/performance/CMakeLists.txt clang-tidy/performance/FasterStringFindCheck.cpp

Re: [PATCH] D17034: Add an AST matcher for null pointers

2016-02-09 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchers.h:4821 @@ +4820,3 @@ +/// initializer for i. +AST_MATCHER(Expr, nullPointerConstant) { + return Matcher( aaron.ballman wrote: > aaron.ballman wrote: > > sbenza wrote: > > > sbenza

Re: [PATCH] D17034: Add an AST matcher for null pointers

2016-02-09 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchers.h:4821 @@ +4820,3 @@ +/// initializer for i. +AST_MATCHER(Expr, nullPointerConstant) { + return Matcher( Use AST_MATCHER_FUNCTION instead, where the return value is the matcher

Re: [clang-tools-extra] r260217 - [clang-tidy] Make readability-container-size-empty work with inline namespaces. Fix PR25812.

2016-02-09 Thread Samuel Benzaquen via cfe-commits
Now that I submitted the fix to hasName(), I'll work on adding hasAnyName. On Tue, Feb 9, 2016 at 6:54 AM, Alexander Kornienko wrote: > I think, we need to add a `hasAnyName()` matcher that would take a list of > names. > > On Tue, Feb 9, 2016 at 11:20 AM, Gabor Horvath via

r259898 - [ASTMatchers] Allow hasName() to look through inline namespaces

2016-02-05 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Fri Feb 5 12:29:24 2016 New Revision: 259898 URL: http://llvm.org/viewvc/llvm-project?rev=259898=rev Log: [ASTMatchers] Allow hasName() to look through inline namespaces Summary: Allow hasName() to look through inline namespaces. This will fix the interaction between some

Re: [PATCH] D15506: [ASTMatchers] Allow hasName() to look through inline namespaces

2016-02-05 Thread Samuel Benzaquen via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL259898: [ASTMatchers] Allow hasName() to look through inline namespaces (authored by sbenza). Changed prior to commit: http://reviews.llvm.org/D15506?vs=45438=47029#toc Repository: rL LLVM

Re: [PATCH] D17163: [ASTMatchers] Add matcher hasAnyName.

2016-02-12 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:644 @@ -643,2 +643,3 @@ explicit HasNameMatcher(StringRef Name); + explicit HasNameMatcher(ArrayRef Names); alexfh wrote: > bkramer wrote: > > alexfh wrote: > > > Why

Re: [PATCH] D16152: [clang-tidy] Add check performance-faster-string-find

2016-02-12 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 47808. sbenza marked an inline comment as done. sbenza added a comment. Minor fix on comment http://reviews.llvm.org/D16152 Files: clang-tidy/performance/CMakeLists.txt clang-tidy/performance/FasterStringFindCheck.cpp

[clang-tools-extra] r260712 - [clang-tidy] Add check performance-faster-string-find

2016-02-12 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Fri Feb 12 13:28:14 2016 New Revision: 260712 URL: http://llvm.org/viewvc/llvm-project?rev=260712=rev Log: [clang-tidy] Add check performance-faster-string-find Summary: Add check performance-faster-string-find. It replaces single character string literals to character

Re: [PATCH] D16152: [clang-tidy] Add check performance-faster-string-find

2016-02-12 Thread Samuel Benzaquen via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL260712: [clang-tidy] Add check performance-faster-string-find (authored by sbenza). Changed prior to commit: http://reviews.llvm.org/D16152?vs=47808=47825#toc Repository: rL LLVM

[PATCH] D17163: [ASTMatchers] Add matcher hasAnyName.

2016-02-11 Thread Samuel Benzaquen via cfe-commits
sbenza created this revision. sbenza added a reviewer: alexfh. sbenza added a subscriber: cfe-commits. Herald added a subscriber: klimek. Add matcher hasAnyName as an optimization over anyOf(hasName(),...) http://reviews.llvm.org/D17163 Files: docs/LibASTMatchersReference.html

Re: [PATCH] D16152: [clang-tidy] Add check performance-faster-string-find

2016-02-03 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 46798. sbenza added a comment. Make the delimiter a constant and fix mismatch between parse/serialize of the option. http://reviews.llvm.org/D16152 Files: clang-tidy/performance/CMakeLists.txt clang-tidy/performance/FasterStringFindCheck.cpp

Re: [PATCH] D16152: [clang-tidy] Add check performance-faster-string-find

2016-02-03 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 46796. sbenza added a comment. Added comment about StringLikeClasses http://reviews.llvm.org/D16152 Files: clang-tidy/performance/CMakeLists.txt clang-tidy/performance/FasterStringFindCheck.cpp clang-tidy/performance/FasterStringFindCheck.h

r261574 - [ASTMatchers] Add matcher hasAnyName.

2016-02-22 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Mon Feb 22 15:13:02 2016 New Revision: 261574 URL: http://llvm.org/viewvc/llvm-project?rev=261574=rev Log: [ASTMatchers] Add matcher hasAnyName. Summary: Add matcher hasAnyName as an optimization over anyOf(hasName(),...) Reviewers: alexfh Subscribers: klimek, cfe-commits

Re: [PATCH] D17163: [ASTMatchers] Add matcher hasAnyName.

2016-02-22 Thread Samuel Benzaquen via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL261574: [ASTMatchers] Add matcher hasAnyName. (authored by sbenza). Changed prior to commit: http://reviews.llvm.org/D17163?vs=47802=48720#toc Repository: rL LLVM http://reviews.llvm.org/D17163

Re: [PATCH] D17575: Determine if there's a getDecl member function using less hacks

2016-02-24 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. I assume you checked that the new trait works on MSVC. Aren't both the same type of expression SFINAE? Is somehow one supported but not the other? http://reviews.llvm.org/D17575 ___ cfe-commits mailing list

Re: r261574 - [ASTMatchers] Add matcher hasAnyName.

2016-02-22 Thread Samuel Benzaquen via cfe-commits
> >> > >> On Mon, Feb 22, 2016 at 4:13 PM, Samuel Benzaquen via cfe-commits > >> <cfe-commits@lists.llvm.org> wrote: > >> > Author: sbenza > >> > Date: Mon Feb 22 15:13:02 2016 > >> > New Revision: 261574 > >>

Re: r261574 - [ASTMatchers] Add matcher hasAnyName.

2016-02-22 Thread Samuel Benzaquen via cfe-commits
On Mon, Feb 22, 2016 at 4:19 PM, Aaron Ballman <aa...@aaronballman.com> wrote: > On Mon, Feb 22, 2016 at 4:13 PM, Samuel Benzaquen via cfe-commits > <cfe-commits@lists.llvm.org> wrote: > > Author: sbenza > > Date: Mon Feb 22 15:13:02 2016 > > New Revision:

Re: r261574 - [ASTMatchers] Add matcher hasAnyName.

2016-02-22 Thread Samuel Benzaquen via cfe-commits
On Mon, Feb 22, 2016 at 5:27 PM, Hans Wennborg <h...@chromium.org> wrote: > On Mon, Feb 22, 2016 at 1:13 PM, Samuel Benzaquen via cfe-commits > <cfe-commits@lists.llvm.org> wrote: > > Author: sbenza > > Date: Mon Feb 22 15:13:02 2016 > > New Revision: 261574

Re: [PATCH] D15506: [ASTMatchers] Allow hasName() to look through inline namespaces

2016-01-20 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:351 @@ +350,3 @@ + + // First, match the name. + if (!MatchNodeName(Pattern, Node)) klimek wrote: > Perhaps comment that Pattern will be changed to the prefix, so it's clear >

Re: [PATCH] D15506: [ASTMatchers] Allow hasName() to look through inline namespaces

2016-01-20 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 45438. sbenza added a comment. Rename functions. http://reviews.llvm.org/D15506 Files: include/clang/ASTMatchers/ASTMatchersInternal.h lib/ASTMatchers/ASTMatchersInternal.cpp unittests/ASTMatchers/ASTMatchersTest.cpp Index:

Re: [PATCH] D8149: Add hasUnderlyingType narrowing matcher for TypedefDecls, functionProtoType matcher for FunctionProtoType nodes, extend parameterCountIs to FunctionProtoType nodes

2016-01-19 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:4994 @@ +4993,3 @@ + EXPECT_TRUE(matches("typedef int hasUnderlyingTypeTest;", + typedefDecl(hasUnderlyingType(asString("int"); + EXPECT_TRUE(matches("typedef const int

Re: [PATCH] D17034: Add an AST matcher for null pointers

2016-02-16 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchers.h:4838 @@ +4837,3 @@ + gnuNullExpr(), cxxNullPtrLiteralExpr(), + expr(integerLiteral(equals(0), hasParent(expr(hasType(pointerType())); +} is this expr() necessary?

Re: [PATCH] D17034: Add an AST matcher for null pointers

2016-02-16 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchers.h:4838 @@ +4837,3 @@ + gnuNullExpr(), cxxNullPtrLiteralExpr(), + expr(integerLiteral(equals(0), hasParent(expr(hasType(pointerType())); +} aaron.ballman wrote: > sbenza

[clang-tools-extra] r261102 - [clang-tidy] Match the type against the get() method we are calling,

2016-02-17 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Wed Feb 17 10:13:14 2016 New Revision: 261102 URL: http://llvm.org/viewvc/llvm-project?rev=261102=rev Log: [clang-tidy] Match the type against the get() method we are calling, instead of a get() method we find in the class. The duck typed smart pointer class could have

Re: [PATCH] D17447: Add check for CERT ENV33-C

2016-02-19 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/cert/CommandProcessorCheck.cpp:22 @@ +21,3 @@ + Finder->addMatcher( + callExpr(callee(functionDecl(anyOf(hasName("system"), hasName("popen"), + hasName("_popen")))

Re: [PATCH] D17447: Add check for CERT ENV33-C

2016-02-19 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/cert/CommandProcessorCheck.cpp:36 @@ +35,3 @@ + // is not a security risk by itself. + if (Fn->getName() == "system" && E->getNumArgs() == 1 && + E->getArg(0)->isNullPointerConstant(*Result.Context, You

[PATCH] D18275: [ASTMatchers] Add own version of VariadicFunction.

2016-03-18 Thread Samuel Benzaquen via cfe-commits
sbenza created this revision. sbenza added a reviewer: alexfh. sbenza added a subscriber: cfe-commits. Herald added a subscriber: klimek. llvm::VariadicFunction is only being used by ASTMatchers. Having own copy here allows us to remove the other one from llvm/ADT. Also, we can extend the API to

Re: [PATCH] D18275: [ASTMatchers] Add own version of VariadicFunction.

2016-03-18 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. Alex, this is what we discussed to make `hasAnyName` take a `vector` directly. http://reviews.llvm.org/D18275 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D17986: [ASTMatchers] Existing matcher hasAnyArgument fixed and new matcher hasReturnValue added

2016-03-11 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. The reason we haven't fixed hasAnyArgument is that it can potentially break its users. I'd prefer if you separated the fix from the addition. That way we can revert the fix if needed. Comment at: include/clang/ASTMatchers/ASTMatchers.h:4796 @@ +4795,3

Re: [PATCH] D17986: [ASTMatchers] New matcher hasReturnValue added

2016-03-19 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchers.h:4848 @@ +4847,3 @@ +/// \code +/// return a+b; +/// \endcode `a + b` (with spaces) A few in this comment, and one in the test. Comment at:

Re: [PATCH] D17986: [ASTMatchers] Existing matcher hasAnyArgument fixed and new matcher hasReturnValue added

2016-03-11 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. > I will separate it, OK. In the Clang there is one use case that I fixed, > although it did not break the tests. Neither of the other "has..." checkers > (except the general ones) ignore implicit casts and parenthesized expressions > so this one should not do it either

Re: [PATCH] D17811: [clang-tidy] Add check to detect dangling references in value handlers.

2016-03-30 Thread Samuel Benzaquen via cfe-commits
This is already being done in http://reviews.llvm.org/D18582 On Wed, Mar 30, 2016 at 12:44 PM, Richard wrote: > LegalizeAdulthood added a subscriber: LegalizeAdulthood. > LegalizeAdulthood added a comment. > > Can you add a synopsis of this new check to

Re: [PATCH] D18265: [clang-tidy] New: checker misc-assign-operator-return

2016-04-05 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:63 @@ +62,3 @@ + + Finder->addMatcher(returnStmt(IsBadReturnStatement, hasAncestor(IsGoodAssign)) + .bind("returnStmt"), baloghadamsoftware wrote: > sbenza

Re: [PATCH] D18265: [clang-tidy] New: checker misc-assign-operator-return

2016-04-07 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:63 @@ +62,3 @@ + + Finder->addMatcher(returnStmt(IsBadReturnStatement, hasAncestor(IsGoodAssign)) + .bind("returnStmt"), baloghadamsoftware wrote: > sbenza

Re: [PATCH] D18766: [clang-tidy] Add check misc-multiple-statement-macro

2016-04-05 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: docs/clang-tidy/checks/misc-multiple-statement-macro.rst:15 @@ +14,3 @@ + if (do_increment) +INCREMENT_TWO(a, b); + hokein wrote: > Would be better to add a comment to explain the sample. The sentence just before the

Re: [PATCH] D18766: [clang-tidy] Add check misc-multiple-statement-macro

2016-04-05 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 52702. sbenza marked 2 inline comments as done and an inline comment as not done. sbenza added a comment. Minor fixes http://reviews.llvm.org/D18766 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp

Re: [PATCH] D18914: [clang-tidy] new readability-redundant-inline

2016-04-12 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/readability/RedundantInlineCheck.cpp:68 @@ +67,3 @@ + } + llvm_unreachable("InlineTok() did not encounter the 'inline' token"); +} This is still reachable. The token might be hidden through macros, for

Re: [PATCH] D18766: [clang-tidy] Add check misc-multiple-statement-macro

2016-04-12 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 53398. sbenza marked an inline comment as done. sbenza added a comment. Change warning message. http://reviews.llvm.org/D18766 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/MultipleStatementMacroCheck.cpp

Re: [PATCH] D18766: [clang-tidy] Add check misc-multiple-statement-macro

2016-04-12 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/misc/MultipleStatementMacroCheck.cpp:99 @@ +98,3 @@ + + diag(InnerRanges.back().first, "multiple statement macro spans unbraced " + "conditional and the following statement");

[clang-tools-extra] r263822 - [clang-tidy] Use hasAnyName() instead of matchesName().

2016-03-19 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Fri Mar 18 15:14:35 2016 New Revision: 263822 URL: http://llvm.org/viewvc/llvm-project?rev=263822=rev Log: [clang-tidy] Use hasAnyName() instead of matchesName(). matchesName() uses regular expressions and it is very slow. hasAnyName() gives the same result and it is much

Re: [PATCH] D17811: [clang-tidy] Add check to detect dangling references in value handlers.

2016-03-22 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. In http://reviews.llvm.org/D17811#380124, @jbcoe wrote: > Do you have commit access? I can apply this patch for you if not. I do. I am waiting on http://reviews.llvm.org/D18275 to fix the problem with using internal::HasNameMatcher directly.

Re: [PATCH] D18275: [ASTMatchers] Add own version of VariadicFunction.

2016-03-23 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:80 @@ +79,3 @@ + ResultT operator()(ArrayRef Args) const { +std::vector InnerArgs; +for (const ArgT : Args) alexfh wrote: > It's unfortunate that we need to create

Re: [PATCH] D18275: [ASTMatchers] Add own version of VariadicFunction.

2016-03-25 Thread Samuel Benzaquen via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL264417: [ASTMatchers] Add own version of VariadicFunction. (authored by sbenza). Changed prior to commit: http://reviews.llvm.org/D18275?vs=51447=51645#toc Repository: rL LLVM

Re: [PATCH] D18275: [ASTMatchers] Add own version of VariadicFunction.

2016-03-25 Thread Samuel Benzaquen via cfe-commits
On Fri, Mar 25, 2016 at 1:55 PM, Etienne Bergeron wrote: > etienneb added a subscriber: etienneb. > etienneb added a comment. > > Any plan for doing the same for : hasOverloadedOperatorName ? > hasAnyName() was added mostly for performance reasons. We could add the 'Any'

Re: [PATCH] D17986: [ASTMatchers] New matcher hasReturnValue added

2016-03-21 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. Can you rerun the doc script (dump_ast_matchers.py)? http://reviews.llvm.org/D17986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] r263963 - [clang-tidy] Fix check broken in rL263822.

2016-03-21 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Mon Mar 21 13:00:43 2016 New Revision: 263963 URL: http://llvm.org/viewvc/llvm-project?rev=263963=rev Log: [clang-tidy] Fix check broken in rL263822. Add names missing from rL263822 and add tests to prevent future omissions. Modified:

Re: r264417 - [ASTMatchers] Add own version of VariadicFunction.

2016-03-25 Thread Samuel Benzaquen via cfe-commits
dio > > -- > Mehdi > > > > > > On Mar 25, 2016, at 9:29 AM, Samuel Benzaquen via cfe-commits < > cfe-commits@lists.llvm.org> wrote: > > > > Author: sbenza > > Date: Fri Mar 25 11:29:30 2016 > > New Revision: 264417 > > > > URL: htt

Re: r264417 - [ASTMatchers] Add own version of VariadicFunction.

2016-03-25 Thread Samuel Benzaquen via cfe-commits
> I believe r264428 fixes this problem. >> >> On Fri, Mar 25, 2016 at 2:18 PM, Mehdi Amini <mehdi.am...@apple.com> >> wrote: >> >>> Hi, >>> >>> I think this broke clang-tidy somehow: >>> http://lab.llvm.org:8011/builders/clang-

Re: r264417 - [ASTMatchers] Add own version of VariadicFunction.

2016-03-25 Thread Samuel Benzaquen via cfe-commits
: >> http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/10881/steps/build%20stage%201/logs/stdio >> >> -- >> Mehdi >> >> >> >> >> > On Mar 25, 2016, at 9:29 AM, Samuel Benzaquen via cfe-commits < >> cfe-commits@lists.llv

Re: [PATCH] D17811: [clang-tidy] Add check to detect dangling references in value handlers.

2016-03-25 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 51684. sbenza added a comment. Using new public hasAnyName API. http://reviews.llvm.org/D17811 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/DanglingHandleCheck.cpp clang-tidy/misc/DanglingHandleCheck.h clang-tidy/misc/MiscTidyModule.cpp

r264453 - [ASTMatchers] Don't use brace-init lists.

2016-03-25 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Fri Mar 25 14:41:32 2016 New Revision: 264453 URL: http://llvm.org/viewvc/llvm-project?rev=264453=rev Log: [ASTMatchers] Don't use brace-init lists. They are not supported everywhere yet. This fixes the MSVC build. Modified:

Re: [PATCH] D18243: [ASTMatchers] Existing matcher hasAnyArgument fixed

2016-03-19 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. Please add a test for this. http://reviews.llvm.org/D18243 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   >