Page MenuHomePhabricator

Add a way to set traversal mode in clang-query
ClosedPublic

Authored by steveire on Jan 20 2020, 5:32 AM.

Diff Detail

Event Timeline

steveire created this revision.Jan 20 2020, 5:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2020, 5:32 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

There should also be a mention of this in the release notes (especially if the default behavior winds up changing).

clang-tools-extra/clang-query/Query.cpp
51

It took me a few tries to understand why there's a leading whitespace here. I'd prefer this to be a trailing whitespace on the previous line as in other cases unless there's some reason we need all the trailing quotes to line up vertically.

53

We should document explicitly that this is the default (or document AsIs as the default if we go that route for now).

clang-tools-extra/clang-query/QuerySession.h
29

While we want to get here eventually, I think it might make sense to have the default be AsIs until there's clear agreement that we want the default traversal mode in AST matchers to be this way. Basically, clang-query's default mode should be the same as the C++ AST matcher default mode.

clang-tools-extra/unittests/clang-query/QueryParserTest.cpp
114

Can you also add a test for set traversal ThisShouldNotWork or something along those lines?

There should also be a mention of this in the release notes (especially if the default behavior winds up changing).

It looks like none of the comments in the review have not been addressed yet. Are you planning to make those changes? (Some may no longer be necessary because we've made a decision that moots the comment.)

steveire marked 3 inline comments as done.May 23 2020, 5:33 AM
steveire marked an inline comment as done.
This revision is now accepted and ready to land.May 23 2020, 6:45 AM
This revision was automatically updated to reflect the committed changes.