ziqingluo-90 added inline comments.

================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3853
+/// objcMessageExpr(objcMessageCallee(objcMethodDecl(hasName("foo"))))
+AST_MATCHER_P(ObjCMessageExpr, objcMessageCallee,
+              internal::Matcher<ObjCMethodDecl>, InnerMatcher) {
----------------
ziqingluo-90 wrote:
> aaron.ballman wrote:
> > Is there a reason why we want a separate matcher here instead of 
> > overloading `callee()`?
> This is a good question!  
> 
> `callee` has already been overloaded to accept both `Matcher<Decl>` and 
> `Matcher<Stmt>` as the parameter.   In my case, I will need `callee` to be 
> polymorphic in returning both `Matcher<CallExpr>` and 
> `Matcher<ObjCMessageExpr>` types.   So that will end up in 4 definitions of 
> `callee`, one of which has different return type and parameter type from one 
> of the others.   
> 
> Is this achievable?  I know I can overload parameters or make return types 
> polymorphic, but can I mix them together? 
I figured it out.  I will soon update this patch to simply overload `callee`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129398/new/

https://reviews.llvm.org/D129398

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to