This is an archive of the discontinued LLVM Phabricator instance.

[ASTMatchers] Introduce hasAnyNameIn matcher: like hasAnyName, but accepts a vector
AbandonedPublic

Authored by george.karpenkov on Mar 23 2018, 7:02 PM.

Details

Summary

For callers, supplying a vector is often more convenient than working with a variadic function

Diff Detail

Event Timeline

alexfh requested changes to this revision.Mar 26 2018, 9:00 AM

The existing matcher works with a std::vector<StringRef>. If you need to pass a std::vector<std::string>, there's a way to convert it:

hasAnyName(std::vector<llvm::StringRef>(v.begin(), v.end()))
This revision now requires changes to proceed.Mar 26 2018, 9:00 AM
george.karpenkov abandoned this revision.Mar 26 2018, 1:32 PM

OK, abandoning.
I'm still confused as to why all matchers insist on accepting non-owning containers, just to convert them to owning ones later on.