Page MenuHomePhabricator

WIP: Make it possible to use the traverse() matcher in clang-query
Needs ReviewPublic

Authored by steveire on May 27 2020, 12:26 PM.



Diff Detail

Event Timeline

steveire created this revision.May 27 2020, 12:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2020, 12:26 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

This is not ready for review, but is it a direction we want to go, given that we can already use

set traversal <foo>

in clang-query?

Thanks, this looks quite useful. I should be able to look it over in full tomorrow.


I need this for my fix to Transformer. In fact, this is the only thing I need, rather than an overload of traverse for DynTypedMatcher. Do you want me to split this into its own patch and send to you? Or, vice versa?

Also, whay const DynTypedMatcher &InnerMatcher? Given that it is immediately copied, why not just DynTypedMatcher InnerMatcher, which at least allows the caller to move-construct the argument and avoid the copy?

steveire marked an inline comment as done.May 27 2020, 2:24 PM
steveire added inline comments.

Yes, if you could split what ever you need out and incorporate it into your work I think that would be useful.

I can rebase the rest of this once your fix is in.