[PATCH] D80603: add isAtPosition narrowing matcher for parmVarDecl

Vy Nguyen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 27 14:46:42 PDT 2020


oontvoo added a comment.

In D80603#2058019 <https://reviews.llvm.org/D80603#2058019>, @aaron.ballman wrote:

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


Ah, I didn't mean to say it wasn't *already possible* to do any of this.

It would be *very* nice to have this (at least to some of us, that I know of). (make the logic a lot simpler in a few custom matchers).


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