[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-07-07 Thread Nathan James 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 rGb0d3ea171bd5: [ASTMatchers] Added hasDirectBase Matcher (authored by njames93). Changed prior to commit:

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-07-07 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 275991. njames93 added a comment. Removed all hasClass related changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81552/new/ https://reviews.llvm.org/D81552 Files:

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3553 +/// \endcode +AST_MATCHER_P(CXXBaseSpecifier, hasClass, internal::Matcher, + InnerMatcher) { sammccall wrote: > aaron.ballman wrote: > > jkorous

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-15 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3553 +/// \endcode +AST_MATCHER_P(CXXBaseSpecifier, hasClass, internal::Matcher, + InnerMatcher) { aaron.ballman wrote: > jkorous wrote: > > aaron.ballman

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-15 Thread Manuel Klimek via Phabricator via cfe-commits
klimek added a comment. We have some precedent for overloading has* matchers, but I'll defer to Sam's judgement whether that's a good idea here. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81552/new/ https://reviews.llvm.org/D81552

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: sammccall, dblaikie. aaron.ballman added subscribers: sammccall, dblaikie. aaron.ballman added a comment. Pinging @klimek , @sammccall , and @dblaikie to see if there are some opinions about overloading `hasName` (and possibly other naming related questions).

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-12 Thread Jan Korous via Phabricator via cfe-commits
jkorous added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3553 +/// \endcode +AST_MATCHER_P(CXXBaseSpecifier, hasClass, internal::Matcher, + InnerMatcher) { aaron.ballman wrote: > njames93 wrote: > > jkorous wrote: > >

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3553 +/// \endcode +AST_MATCHER_P(CXXBaseSpecifier, hasClass, internal::Matcher, + InnerMatcher) { njames93 wrote: > jkorous wrote: > > aaron.ballman

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-11 Thread Nathan James via Phabricator via cfe-commits
njames93 marked 2 inline comments as done. njames93 added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3537 AST_POLYMORPHIC_MATCHER_P_OVERLOAD( -hasType, -AST_POLYMORPHIC_SUPPORTED_TYPES(Expr, FriendDecl, ValueDecl, -

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-11 Thread Jan Korous via Phabricator via cfe-commits
jkorous added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3553 +/// \endcode +AST_MATCHER_P(CXXBaseSpecifier, hasClass, internal::Matcher, + InnerMatcher) { aaron.ballman wrote: > jkorous wrote: > > Nit: while "[base

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-11 Thread Jan Korous via Phabricator via cfe-commits
jkorous added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3621 +/// \endcode +AST_MATCHER_P(CXXBaseSpecifier, hasClassOrClassTemplate, + internal::Matcher, InnerMatcher) { I think we should just use `eachOf` matcher

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3537 AST_POLYMORPHIC_MATCHER_P_OVERLOAD( -hasType, -AST_POLYMORPHIC_SUPPORTED_TYPES(Expr, FriendDecl, ValueDecl, -CXXBaseSpecifier), +

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-10 Thread Nathan James via Phabricator via cfe-commits
njames93 marked 2 inline comments as done. njames93 added a comment. In D81552#2086420 , @jkorous wrote: > @njames93 `hasDirectBase` seems like a useful matcher to me! OTOH I am not > totally convinced about `hasType` -> `hasClass`. Anyway, don't you

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-10 Thread Nathan James via Phabricator via cfe-commits
njames93 updated this revision to Diff 27. njames93 added a comment. - Added back `hasType` overload for `CXXBaseSpecifier` - Added `hasClassTemplate` and `hasClassOrClassTemplate` matcher for `CXXBaseSpecifier` - Added `hasTemplatedDecl` for `ClassTemplateDecl` Repository: rG LLVM

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-10 Thread Jan Korous via Phabricator via cfe-commits
jkorous added a comment. @njames93 `hasDirectBase` seems like a useful matcher to me! OTOH I am not totally convinced about `hasType` -> `hasClass`. Anyway, don't you want to land `hasDirectBase` as a separate patch first and then discuss the rest? One more thing - I'm just thinking if there

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2888-2890 +/// class Foo; +/// class Bar : Foo {}; +/// class Baz : Bar {}; njames93 wrote: > aaron.ballman wrote: > > It seems like these aren't really part of

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-10 Thread Nathan James via Phabricator via cfe-commits
njames93 marked 2 inline comments as done. njames93 added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2888-2890 +/// class Foo; +/// class Bar : Foo {}; +/// class Baz : Bar {}; aaron.ballman wrote: > It seems like these

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2888-2890 +/// class Foo; +/// class Bar : Foo {}; +/// class Baz : Bar {}; It seems like these aren't really part of the example? Comment at:

[PATCH] D81552: [ASTMatchers] Added hasDirectBase and hasClass Matchers

2020-06-10 Thread Nathan James via Phabricator via cfe-commits
njames93 created this revision. njames93 added reviewers: klimek, aaron.ballman, jkorous. Herald added subscribers: cfe-commits, dexonsmith. Herald added a project: clang. Adds a matcher called `hasDirectBase` for matching the `CXXBaseSpecifier` of a class that directly derives from another