This is an archive of the discontinued LLVM Phabricator instance.

[ASTMatchers] Changes to `CXXMemberExpr` matchers.
AbandonedPublic

Authored by ymandel on Jan 16 2019, 8:06 AM.

Details

Summary

This diff is no longer active. It has been split into three:
Comments: https://reviews.llvm.org/D56849
Tests: https://reviews.llvm.org/D56850
New matcher with tests: https://reviews.llvm.org/D56851

Assorted changes to matchers for CXXMemberExpr:

  • fixes the comments on hasObjectExpression,
  • clarifies comments on thisPointerType and on,
  • adds comments to onImplicitObjectArgument
  • adds new matcher invokedAtType, a variant of thisPointerType (like on is a variant of onImplicitObjectArgument).

Diff Detail

Event Timeline

ymandel created this revision.Jan 16 2019, 8:06 AM

Can you break this up into multiple commits?

Can you break this up into multiple commits?

Sure, but any suggestions on granularity? E.g. i can split into two: the fixes/clarifications in one and the new matcher in another; or i could split into four -- one for each bullet, etc.

lebedev.ri retitled this revision from Changes to `CXXMemberExpr` matchers. to [ASTMatchers] Changes to `CXXMemberExpr` matchers..Jan 16 2019, 8:33 AM
lebedev.ri added a reviewer: aaron.ballman.

Can you break this up into multiple commits?

Sure, but any suggestions on granularity? E.g. i can split into two: the fixes/clarifications in one and the new matcher in another; or i could split into four -- one for each bullet, etc.

Each matcher separately would be best, you then end up with 3x NFC doc-only changes, and 2x matchers.

include/clang/ASTMatchers/ASTMatchers.h
3346

How is this different from the other one?
Presumably it should have it's own docs.

3350–3353

I don't think these are needed.
You don't have them in the matcher above yet it presumably compiles.

It is always valuable to split changes which are independent. Usually you can extract NFC changes first and then look at what remains to split it.

ymandel marked 2 inline comments as done.Jan 16 2019, 10:35 AM

Can you break this up into multiple commits?

Sure, but any suggestions on granularity? E.g. i can split into two: the fixes/clarifications in one and the new matcher in another; or i could split into four -- one for each bullet, etc.

Each matcher separately would be best, you then end up with 3x NFC doc-only changes, and 2x matchers.

Once I'm splitting, I'd prefer to bundle the tests with the corresponding comment changes, but I see how that would break the NFC split (assuming tests count as "functional changes"). So, if the NFC changes are separate, should all the tests be bundled together, or split into separate patches? For example, I can put the tests for existing matchers into one patch, and the new matcher and its test into a separate patch. WDYT?

include/clang/ASTMatchers/ASTMatchers.h
3346

I was following what we've done elsewhere for overloads (e.g. line 3312 above), but am happy to expand this if you recommend. Personally, I think more documentation is better, but wanted to stick w/ the standard practice.

3350–3353

Right -- those are leftover from development (which took place in a different namespace originally). Will remove once I split this patch.

It seems that you update docs for existing matchers without changing those matchers. You could put all of that in one patch.

Then, you seem to add some tests for existing matches. You could put that in the second patch.

Then your third patch would add the new matcher with its tests and its docs.

That would be easy to review.

It seems that you update docs for existing matchers without changing those matchers. You could put all of that in one patch.

Then, you seem to add some tests for existing matches. You could put that in the second patch.

Then your third patch would add the new matcher with its tests and its docs.

That would be easy to review.

Done:
Comments: https://reviews.llvm.org/D56849
Tests: https://reviews.llvm.org/D56850
New matcher with tests: https://reviews.llvm.org/D56851

ymandel edited the summary of this revision. (Show Details)Jan 17 2019, 6:10 AM

Should this one now be closed? The 'Add Action...' dropdown has an action for that.

ymandel abandoned this revision.Jan 17 2019, 6:46 AM