AaronBallman wrote:

> > > > Are there any planned in-tree uses for this matcher?
> > > 
> > > 
> > > I had a downstream use planned. Does this mean I will have to reimplement 
> > > `internal::HasNameMatcher`?
> > 
> > 
> > Can you adapt the code to use `hasAnyName()` instead, as that can accept a 
> > variadic number of `StringRef` arguments stored in an `ArrayRef`?
> 
> The use is for a runtime list of names, so I don't think the variadic would 
> work?

I could be wrong on this, but I think it might actually work to just pass an 
ArrayRef that's constructed from the vector. `hasAnyName` 
(https://github.com/llvm/llvm-project/blob/b96c5df04e55396572a7c12cb6505f5a116072cb/clang/include/clang/ASTMatchers/ASTMatchers.h#L3143)
 uses `internal::hasAnyNameFunc` which has an overload taking an ArrayRef 
(https://github.com/llvm/llvm-project/blob/b96c5df04e55396572a7c12cb6505f5a116072cb/clang/include/clang/ASTMatchers/ASTMatchersInternal.h#L965).

https://github.com/llvm/llvm-project/pull/139594
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to