[PATCH] D80603: add isAtPosition narrowing matcher for parmVarDecl

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 27 12:29:43 PDT 2020


aaron.ballman added a comment.

In D80603#2057970 <https://reviews.llvm.org/D80603#2057970>, @oontvoo wrote:

> In D80603#2057014 <https://reviews.llvm.org/D80603#2057014>, @aaron.ballman wrote:
>
> > Does the `hasParameter()` matcher not already do this?
>
>
> Yes, it does. But we'd like it to be able to match on the parmVarDecl().


I'm sorry if I'm being dense, but `hasParameter`  traverses to the `ParmVarDecl`, so I'm not certain I understand why this new matcher is needed as a public matcher. It seems like you can already accomplish this without adding a second API to do effectively the same thing: `functionDecl(hasParameter(0, parmVarDecl().bind("param")))`, can't you?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80603





More information about the cfe-commits mailing list