This is an archive of the discontinued LLVM Phabricator instance.

Add support for a few Objective-C matchers.
ClosedPublic

Authored by dfsuther on Feb 17 2015, 4:23 PM.

Details

Summary

Added some matchers for objective c selectors and messages to ASTMatchers.h. Minor mods to ASTMatchersTest.h to allow test files with ".m" extension in addition to ".cpp". New tests added to ASTMatchersTest.c.

Diff Detail

Event Timeline

dfsuther updated this revision to Diff 20123.Feb 17 2015, 4:23 PM
dfsuther retitled this revision from to Add support for a few Objective-C matchers..
dfsuther updated this object.
dfsuther edited the test plan for this revision. (Show Details)
dfsuther added reviewers: klimek, djasper.
dfsuther added a subscriber: Unknown Object (MLST).

Adding a comment in an attempt to get Phab to actually send the email...

Attempting to fix subscribers, too.

klimek added inline comments.Feb 20 2015, 2:40 AM
include/clang/ASTMatchers/ASTMatchers.h
2030

Please always provide example code and an example matcher that matches.

Will do.  New patch soon.
Dean

dfsuther updated this revision to Diff 20775.Feb 26 2015, 9:47 AM

Now includes documentation for each of the matches. Also added the new matchers to the registry for dynamic use.

Changes to lib/Sema/SemaExprObjC.cpp and test/SemaObjC/objc-literal-nsnumber.m are unintentional, and shouldn't be part of this patch! I'll rebase (again) and fix that.

include/clang/ASTMatchers/ASTMatchers.h
2075

I was unable to tweak this matcher from source code, so no example at the moment. Does this represent an error condition? Should I leave it as a matcher, or just remove it? Guidance eagerly accepted.

dfsuther updated this revision to Diff 20778.Feb 26 2015, 10:33 AM

Finally, a diff with no extraneous changes. Sorry about the list churn, folks.

klimek accepted this revision.Mar 3 2015, 2:48 AM
klimek edited edge metadata.

Apart from the nits LG. Please fix those before submitting.

include/clang/ASTMatchers/ASTMatchers.h
2035–2039

Please indent the code sample by 2 (make it consistent).

2105

Can you make the comment-in-the-comment align with the start of the statement above?

This revision is now accepted and ready to land.Mar 3 2015, 2:48 AM
dfsuther updated this revision to Diff 21121.Mar 3 2015, 10:38 AM
dfsuther edited edge metadata.

Addressed nits as requested by fixing formatting of examples in comments.

Nits are now addressed. Can someone please commit this for me? I lack commit access.
Dean

Ping!

Patch was approved by klimek; all nits are now addressed. Could some kind soul please commit this for me? I cannot do so myself, as I lack commit access.

Dean

dfsuther updated this revision to Diff 21610.Mar 10 2015, 11:41 AM

Rebase to HEAD for smoother merge.

Ping! I'd really appreciate it if someone with commit privs could land these changes for me!

Dean

Argh, sorry, that completely fell through the cracks. Submitted as r232051.

djasper closed this revision.Apr 12 2015, 1:24 AM