Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-13 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D19871#429466, @Prazek wrote: > +1 I will probably also use this. > > Does hasCastKind works for implicitCastExpr? Yes, there is a unittest with the code. http://reviews.llvm.org/D19871 ___ cfe

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-13 Thread Jonathan Roelofs via cfe-commits
jroelofs added a comment. In http://reviews.llvm.org/D19871#429153, @etienneb wrote: > In http://reviews.llvm.org/D19871#428997, @jroelofs wrote: > > > Drive-by thought: I think it would be useful to be able to match implicit > > casts separately from explicit casts when using this new matcher.

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-13 Thread Piotr Padlewski via cfe-commits
Prazek added a subscriber: Prazek. Prazek added a comment. +1 I will probably also use this. Does hasCastKind works for implicitCastExpr? http://reviews.llvm.org/D19871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/c

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-13 Thread Aaron Ballman via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Thank you for this! http://reviews.llvm.org/D19871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 57124. etienneb added a comment. nit: indentation http://reviews.llvm.org/D19871 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Marshallers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D19871#428997, @jroelofs wrote: > Drive-by thought: I think it would be useful to be able to match implicit > casts separately from explicit casts when using this new matcher. Jonathan, I think what you are asking for is already supported. I

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 57123. etienneb added a comment. add unittest http://reviews.llvm.org/D19871 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Marshallers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests/AST

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-12 Thread Jonathan Roelofs via cfe-commits
jroelofs added a subscriber: jroelofs. jroelofs added a comment. Drive-by thought: I think it would be useful to be able to match implicit casts separately from explicit casts when using this new matcher. http://reviews.llvm.org/D19871 ___ cfe-comm

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 57101. etienneb marked an inline comment as done. etienneb added a comment. regenerate doc http://reviews.llvm.org/D19871 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Marshallers.h lib/AST

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb marked 3 inline comments as done. etienneb added a comment. This patch has been modified to support dynamic matchers. It rely on : http://reviews.llvm.org/D20207 Comments? Comment at: lib/ASTMatchers/Dynamic/Marshallers.h:102 @@ +101,3 @@ + static clang::CastKind getC

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-12 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 57044. etienneb marked an inline comment as done. etienneb added a comment. rebase over AST modifications http://reviews.llvm.org/D19871 Files: include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Marshallers.h lib/ASTMatchers/Dynamic/Regi

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-10 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: lib/ASTMatchers/Dynamic/Registry.cpp:78 @@ -77,2 +77,3 @@ // Need Variant/Parser fixes: + // hasCastKind // ofKind Is it registered or not? You add this comment, but also add the matcher in the registry below. h

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-10 Thread Aaron Ballman via cfe-commits
On Wed, May 4, 2016 at 6:58 PM, Etienne Bergeron wrote: > etienneb added inline comments. > > > Comment at: lib/ASTMatchers/Dynamic/Marshallers.h:102 > @@ +101,3 @@ > + static clang::CastKind getCastKind(llvm::StringRef AttrKind) { > +return llvm::StringSwitch(AttrKind) > +

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-06 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. Get back to this solution. comments? http://reviews.llvm.org/D19871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-06 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 56428. etienneb added a comment. fix unittests http://reviews.llvm.org/D19871 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests/ASTMatchers/ASTMatchersTest.cpp Index: un

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-06 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 56427. etienneb added a comment. revert to previous solution http://reviews.llvm.org/D19871 Files: include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests/ASTMatchers/ASTMatchersTest.cpp Index: unittests/ASTMatchers/AS

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-05 Thread Samuel Benzaquen via cfe-commits
sbenza added inline comments. Comment at: lib/ASTMatchers/Dynamic/Marshallers.h:102 @@ +101,3 @@ + static clang::CastKind getCastKind(llvm::StringRef AttrKind) { +return llvm::StringSwitch(AttrKind) + .Case("CK_Dependent", CK_Dependent) etienneb wrote: >

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-04 Thread Etienne Bergeron via cfe-commits
etienneb added inline comments. Comment at: lib/ASTMatchers/Dynamic/Marshallers.h:102 @@ +101,3 @@ + static clang::CastKind getCastKind(llvm::StringRef AttrKind) { +return llvm::StringSwitch(AttrKind) + .Case("CK_Dependent", CK_Dependent) aaron.ballman w

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Aaron Ballman via cfe-commits
aaron.ballman added inline comments. Comment at: lib/ASTMatchers/Dynamic/Marshallers.h:102 @@ +101,3 @@ + static clang::CastKind getCastKind(llvm::StringRef AttrKind) { +return llvm::StringSwitch(AttrKind) + .Case("CK_Dependent", CK_Dependent) This might

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. > > So even if the above solution is working, we still need to call it that way > > (as a string): > > > clang-query> match castExpr(hasCastKind("CK_Dependent")) > > > Correct, that's expected behavior for clang-query (though I would love if > someday we could

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 56023. etienneb added a comment. nit http://reviews.llvm.org/D19871 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Marshallers.h lib/ASTMatchers/Dynamic/Registry.cpp unittests/ASTMatchers/

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 56022. etienneb added a comment. add dynamic parsing http://reviews.llvm.org/D19871 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Marshallers.h lib/ASTMatchers/Dynamic/Registry.cpp unitte

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. > though I would love if someday we could expose actual enumerations somehow > instead of string literals I would like too. Ditto for "equals" which is missing :) http://reviews.llvm.org/D19871 ___ cfe-commits mailing li

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Aaron Ballman via cfe-commits
aaron.ballman added a comment. In http://reviews.llvm.org/D19871#420095, @etienneb wrote: > > I agree that when possible, matchers should be available via the dynamic > > matchers API. It doesn't seem overly complicated to add this support here. > > As far as I understand, we just need to regis

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. > I agree that when possible, matchers should be available via the dynamic > matchers API. It doesn't seem overly complicated to add this support here. As > far as I understand, we just need to register the matcher in > lib/ASTMatchers/Dynamic/Registry.cpp and add su

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. In http://reviews.llvm.org/D19871#419947, @aaron.ballman wrote: > Is this required for some purpose? > > I'm not keen on adding new AST matchers that we cannot expose via the dynamic > API, so I would prefer to solve that problem if we want to add this matcher. I agree

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. > It's good to have that context in a review for functionality that isn't part > of the proposed patch. :-) Looking at the other patch, I would prefer to keep > this matcher narrowed to just clang-tidy unless you can also solve how to > expose it via the dynamic regist

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. In http://reviews.llvm.org/D19871#419985, @aaron.ballman wrote: > In http://reviews.llvm.org/D19871#419954, @etienneb wrote: > > > In http://reviews.llvm.org/D19871#419947, @aaron.ballman wrote: > > > > > Is this required for some purpose? > > > > > > It's used in clang-ti

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Aaron Ballman via cfe-commits
aaron.ballman added a comment. In http://reviews.llvm.org/D19871#419954, @etienneb wrote: > In http://reviews.llvm.org/D19871#419947, @aaron.ballman wrote: > > > Is this required for some purpose? > > > It's used in clang-tidy checkers. > > see http://reviews.llvm.org/D19841 It's good to have

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D19871#419947, @aaron.ballman wrote: > Is this required for some purpose? It's used in clang-tidy checkers. see http://reviews.llvm.org/D19841 > I'm not keen on adding new AST matchers that we cannot expose via the dynamic > API, so

Re: [PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Aaron Ballman via cfe-commits
aaron.ballman added a subscriber: aaron.ballman. aaron.ballman added a reviewer: aaron.ballman. aaron.ballman added a comment. Is this required for some purpose? I'm not keen on adding new AST matchers that we cannot expose via the dynamic API, so I would prefer to solve that problem if we want

[PATCH] D19871: Add an AST matcher for CastExpr kind

2016-05-03 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added reviewers: alexfh, sbenza, klimek. etienneb added a subscriber: cfe-commits. Herald added a subscriber: klimek. This AST matcher will match a given CastExpr kind. It's an narrowing matcher on CastExpr. http://reviews.llvm.org/D19871 Files: include