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

2016-04-14 Thread Samuel Benzaquen via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL266369: [clang-tidy] Add check misc-multiple-statement-macro (authored by sbenza). Changed prior to commit: http://reviews.llvm.org/D18766?vs=53398&id=53786#toc Repository: rL LLVM http://reviews.ll

Re: [PATCH] D19144: Handle TemplateArgument in DynTypedNode comparison operations.

2016-04-15 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. I think the bug is coming from `memoizedMatchesAncestorOfRecursively`. `memoizedMatchesRecursively` has a special case at the top to skip the cache if the node is not sortable. The other function should do that too. Although the check is stale also because it is only check

Re: [PATCH] D19144: Handle TemplateArgument in DynTypedNode comparison operations.

2016-04-15 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. To be more specific, the problem comes from the use of `hasAnscestor` (done by `isInTemplateInstantiation` ) while there is a `TemplateArgument` in the bound nodes. This tries to put the node into the cache. To trigger this easily you only need to have a hit in the cache.

[PATCH] D19231: [ASTMatchers] Do not try to memoize nodes we can't compare.

2016-04-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. Prevent hasAncestor from comparing nodes that are not supported. hasDescendant was fixed some time ago to avoid this problem. I'm applying the same fix to hasAn

Re: [PATCH] D19144: Handle TemplateArgument in DynTypedNode comparison operations.

2016-04-18 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. Sent http://reviews.llvm.org/D19231 to fix the underlying bug in `hasAncestor`. We can proceed with this change if you want, but it is not required anymore. I don't know whether we need the extra complexity of `TemplateArgumentLess`. http://reviews.llvm.org/D19144 ___

r266748 - [ASTMatchers] Do not try to memoize nodes we can't compare.

2016-04-19 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Tue Apr 19 10:52:56 2016 New Revision: 266748 URL: http://llvm.org/viewvc/llvm-project?rev=266748&view=rev Log: [ASTMatchers] Do not try to memoize nodes we can't compare. Summary: Prevent hasAncestor from comparing nodes that are not supported. hasDescendant was fixed some t

Re: [PATCH] D19231: [ASTMatchers] Do not try to memoize nodes we can't compare.

2016-04-19 Thread Samuel Benzaquen via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL266748: [ASTMatchers] Do not try to memoize nodes we can't compare. (authored by sbenza). Changed prior to commit: http://reviews.llvm.org/D19231?vs=54089&id=54207#toc Repository: rL LLVM http://rev

Re: [PATCH] D19144: Handle TemplateArgument in DynTypedNode comparison operations.

2016-04-19 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. > > We can proceed with this change if you want, but it is not required > > anymore. I don't know whether we need the extra complexity of > > `TemplateArgumentLess`. > > > If this patch is not going to help with performance, I'm happy to abandon it. It might help i

Re: [PATCH] D19357: [ASTMatchers] New matcher forFunction

2016-04-21 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. Thanks for doing this! I think we want the version that iterates all parents. Otherwise it will have problems with templates. That is, you won't know which `FunctionDecl` you will get: the template or the instantiation. And you might need one or the other specifically.

Re: [PATCH] D19324: [ASTMatchers] new forEachOverriden matcher

2016-04-21 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: lib/AST/ASTContext.cpp:1279 @@ -1282,1 +1278,3 @@ +const ASTContext::CXXMethodVector * +ASTContext::overridden_methods(const CXXMethodDecl *Method) const { llvm::DenseMap::const_iterator Pos It would be simpler to retur

Re: [PATCH] D18265: [clang-tidy] New: checker misc-unconventional-assign-operator replacing misc-assign-operator-signature

2016-04-26 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp:69 @@ +68,3 @@ +void UnconventionalAssignOperatorCheck::check(const MatchFinder::MatchResult &Result) { + if (const auto *RetStmt = Result.Nodes.getNodeAs("returnStmt")) { +diag(R

Re: [PATCH] D19324: [ASTMatchers] new forEachOverriden matcher

2016-04-26 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: include/clang/AST/DeclCXX.h:1830 @@ -1829,2 +1829,3 @@ unsigned size_overridden_methods() const; + const ArrayRef overridden_methods() const; Return type should have have toplevel `const`. Comment a

Re: [PATCH] D19324: [ASTMatchers] new forEachOverriden matcher

2016-05-23 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: include/clang/AST/ASTContext.h:824 @@ -823,1 +823,3 @@ unsigned overridden_methods_size(const CXXMethodDecl *Method) const; + typedef llvm::iterator_range + overridden_method_range; Sure. Sorry about that. The mai

[PATCH] D20597: Speed up check by using a recursive visitor.

2016-05-24 Thread Samuel Benzaquen via cfe-commits
sbenza created this revision. sbenza added a reviewer: alexfh. sbenza added a subscriber: cfe-commits. Use a recursive visitor instead of forEachDescendant() matcher. The latter requires several layers of virtual function calls for each node and it is more expensive than the visitor. Benchmark res

Re: [PATCH] D20597: Speed up check by using a recursive visitor.

2016-05-25 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 58438. sbenza marked an inline comment as done. sbenza added a comment. Reformat code http://reviews.llvm.org/D20597 Files: clang-tidy/readability/FunctionSizeCheck.cpp clang-tidy/readability/FunctionSizeCheck.h Index: clang-tidy/readability/FunctionSiz

[clang-tools-extra] r270714 - Speed up check by using a recursive visitor.

2016-05-25 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Wed May 25 11:19:23 2016 New Revision: 270714 URL: http://llvm.org/viewvc/llvm-project?rev=270714&view=rev Log: Speed up check by using a recursive visitor. Summary: Use a recursive visitor instead of forEachDescendant() matcher. The latter requires several layers of virtual

Re: [PATCH] D20597: Speed up check by using a recursive visitor.

2016-05-25 Thread Samuel Benzaquen via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL270714: Speed up check by using a recursive visitor. (authored by sbenza). Changed prior to commit: http://reviews.llvm.org/D20597?vs=58438&id=58440#toc Repository: rL LLVM http://reviews.llvm.org/D

Re: [PATCH] D20277: [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved.

2016-05-31 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:34 @@ -29,1 +33,3 @@ +template bool isSetDifferenceEmpty(const S &S1, const S &S2) { + for (const auto &E : S1) isSubset? Comment at: clang-tidy/u

[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&view=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] 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 http://lists.llvm.org/cg

[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&view=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 wil

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 GuessAlternateQualif

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

2016-06-07 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. In http://reviews.llvm.org/D21036#450935, @aaron.ballman wrote: > In http://reviews.llvm.org/D21036#450106, @sbenza wrote: > > > I think this would be more interesting with macros. > > Eg triggering in code like this: > > > > #define FOO(type, op) const type& X = op() >

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] 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] 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", +

r274015 - [ASTMatchers] Add isLambda() matcher.

2016-06-28 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Tue Jun 28 09:08:56 2016 New Revision: 274015 URL: http://llvm.org/viewvc/llvm-project?rev=274015&view=rev Log: [ASTMatchers] Add isLambda() matcher. Modified: cfe/trunk/docs/LibASTMatchersReference.html cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h cfe/trunk/

[clang-tools-extra] r274019 - [clang-tidy] Do not match on lambdas.

2016-06-28 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Tue Jun 28 09:19:41 2016 New Revision: 274019 URL: http://llvm.org/viewvc/llvm-project?rev=274019&view=rev Log: [clang-tidy] Do not match on lambdas. We match on the generated FunctionDecl of the lambda and try to fix it. This causes a crash. The right behavior is to ignore l

[PATCH] D21815: [clang-tidy] Add 'included from' details to warning message.

2016-06-28 Thread Samuel Benzaquen via cfe-commits
sbenza created this revision. sbenza added a reviewer: alexfh. sbenza added a subscriber: cfe-commits. Add 'included from' details to warning message to google-global-names-in-headers. It should make it clearer on those cases where a non-header is being mistakenly #included. http://reviews.llvm

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

2016-03-02 Thread Samuel Benzaquen via cfe-commits
sbenza created this revision. sbenza added a reviewer: alexfh. sbenza added a subscriber: cfe-commits. Add check misc-dangling-handle to detect dangling references in value handlers like std::experimental::string_view. It provides a configuration option to specify other handle types that should al

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

2016-03-03 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. In http://reviews.llvm.org/D17811#366482, @Eugene.Zelenko wrote: > Does it make http://reviews.llvm.org/D17772 obsolete? Yes. The other patch has already been abandoned. http://reviews.llvm.org/D17811 ___ cfe-commits maili

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

2016-03-07 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/misc/DanglingHandleCheck.cpp:24 @@ +23,3 @@ + +std::vector parseClasses(StringRef Option) { + SmallVector Classes; alexfh wrote: > A very similar code has been added recently to > clang-tidy/utils/HeaderFileEx

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

2016-03-07 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 49998. sbenza marked 3 inline comments as done. sbenza added a comment. Minor fixes http://reviews.llvm.org/D17811 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/DanglingHandleCheck.cpp clang-tidy/misc/DanglingHandleCheck.h clang-tidy/misc/Mis

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

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

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 http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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: include/clang/ASTMatche

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

[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&view=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 muc

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&view=rev Log: [clang-tidy] Fix check broken in rL263822. Add names missing from rL263822 and add tests to prevent future omissions. Modified: clang-tools-extra/trunk/clang-t

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

2016-03-21 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. In http://reviews.llvm.org/D17986#379271, @baloghadamsoftware wrote: > I can rerun the script, however it seems it was not executed before the last > commit on the master branch, thus if I rerun it then changes will appear in > my diff which are not related to my work. W

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

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

2016-03-23 Thread Samuel Benzaquen via cfe-commits
sbenza updated this revision to Diff 51447. sbenza added a comment. Minor fix http://reviews.llvm.org/D18275 Files: include/clang/ASTMatchers/ASTMatchers.h include/clang/ASTMatchers/ASTMatchersInternal.h lib/ASTMatchers/Dynamic/Marshallers.h unittests/ASTMatchers/ASTMatchersTest.cpp In

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 &Arg : Args) alexfh wrote: > It's unfortunate that we need to cre

r264417 - [ASTMatchers] Add own version of VariadicFunction.

2016-03-25 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Fri Mar 25 11:29:30 2016 New Revision: 264417 URL: http://llvm.org/viewvc/llvm-project?rev=264417&view=rev Log: [ASTMatchers] Add own version of VariadicFunction. Summary: llvm::VariadicFunction is only being used by ASTMatchers. Having our own copy here allows us to remove t

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&id=51645#toc Repository: rL LLVM http://reviews.llvm

r264428 - [ASTMatchers] Fix build for VariadicFunction.

2016-03-25 Thread Samuel Benzaquen via cfe-commits
Author: sbenza Date: Fri Mar 25 12:46:02 2016 New Revision: 264428 URL: http://llvm.org/viewvc/llvm-project?rev=264428&view=rev Log: [ASTMatchers] Fix build for VariadicFunction. Under some conditions the implicit conversion from array to ArrayRef<> is not working. Fix the build by making it expl

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' version of hasOverloaded

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

2016-03-25 Thread Samuel Benzaquen via cfe-commits
> > > 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: http://llvm.org/viewvc/llvm-projec

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

2016-03-25 Thread Samuel Benzaquen via cfe-commits
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.llvm.org> wrote: >> > >> > Author: sbenza >> > Date:

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&view=rev Log: [ASTMatchers] Don't use brace-init lists. They are not supported everywhere yet. This fixes the MSVC build. Modified: cfe/trunk/include/clang/ASTMatchers/ASTMa

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

2016-03-25 Thread Samuel Benzaquen via cfe-commits
25, 2016 at 2:18 PM, Mehdi Amini >> wrote: >> >>> Hi, >>> >>> I think this broke clang-tidy somehow: >>> http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/10881/steps/build%20stage%201/logs/stdio >>> >>> -- >>> M

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 do

Re: r264428 - [ASTMatchers] Fix build for VariadicFunction.

2016-03-28 Thread Samuel Benzaquen via cfe-commits
On Fri, Mar 25, 2016 at 7:01 PM, Richard Smith wrote: > On Fri, Mar 25, 2016 at 10:55 AM, David Blaikie via cfe-commits > wrote: > > > > > > On Fri, Mar 25, 2016 at 10:46 AM, Samuel Benzaquen via cfe-commits > > wrote: > >> > >> Author: sbe

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 T

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

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 44886. sbenza marked 4 inline comments as done. sbenza added a comment. Added template and macro tests. Fixed warning message. 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-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"), hasName("fi

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 clang-tidy/performa

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

2016-01-14 Thread Samuel Benzaquen via cfe-commits
sbenza marked 2 inline comments as done. sbenza added a comment. http://reviews.llvm.org/D16152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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 44901. sbenza marked an inline comment as done. sbenza added a comment. More checks in argument parsing. http://reviews.llvm.org/D16152 Files: clang-tidy/performance/CMakeLists.txt clang-tidy/performance/FasterStringFindCheck.cpp clang-tidy/performance

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

2016-01-14 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: clang-tidy/performance/FasterStringFindCheck.cpp:29 @@ +28,3 @@ +Class = Class.trim(); + return std::vector(Classes.begin(), Classes.end()); +} aaron.ballman wrote: > I think hasName() will assert if given an empty st

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 T

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: unittests/ASTMatchers/ASTMa

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 > aft

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

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 reduce

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 lib/ASTMatchers/AS

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 w

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&view=rev Log: [ASTMatchers] Add booleanType() matcher. Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h cfe/trunk/lib/ASTMatchers/Dynamic/Registry.cpp cfe/

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&view=rev Log: [ASTMatchers] Fix typo in booleanType() doc. Fix typo in booleanType() doc and recreate the LibASTMatchersReference.html reference document. Modified: cfe/trun

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 wrote: > On Tue, Dec 22, 2015 at 3:06 PM, Samuel Benzaquen via cfe-commits > wrote: > > Author: sbenza > > Date: Tue Dec 22 14:06:40 2015 > > New Revision: 256278 > > > > URL: http://llvm.org/viewvc/llvm

<    1   2