This is an archive of the discontinued LLVM Phabricator instance.

Add isAnyPointer and isPointer matchers. Register missing matchers.
ClosedPublic

Authored by flx on Dec 29 2015, 3:45 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

flx updated this revision to Diff 43768.Dec 29 2015, 3:45 PM
flx retitled this revision from to Add isAnyPointer and isPointer matchers. Register missing matchers..
flx updated this object.
flx added reviewers: alexfh, klimek.
klimek added inline comments.Jan 13 2016, 8:26 AM
include/clang/ASTMatchers/ASTMatchers.h
3558 ↗(On Diff #43768)

Sorry for the delay in review. Would be interesting to get an example that is different between isAnyPointerType and isPointerType.

flx added inline comments.Jan 13 2016, 8:30 AM
include/clang/ASTMatchers/ASTMatchers.h
3558 ↗(On Diff #43768)

The definitions of Type::isAnyPointer() is:

return isPointerType() || isObjCObjectPointerType();

Is there a straightforward way to test objc code in these unit tests?

If not I can also remove the isAnyPointer() matcher.

klimek added inline comments.Jan 13 2016, 8:41 AM
include/clang/ASTMatchers/ASTMatchers.h
3558 ↗(On Diff #43768)

We already have some obj-c tests (see line 932 for example)

flx added inline comments.Jan 14 2016, 7:04 PM
include/clang/ASTMatchers/ASTMatchers.h
3558 ↗(On Diff #43768)

I don't know enough objectie c to create a class, instantiate an object and point a pointer to it. But looking at the definition of the pointsToMatcher it also simply uses isAnyPointer(). So I'm wondering if we should only define isPointer() here but use isAnyPointerType() to be consistent with it.

klimek added inline comments.Jan 15 2016, 1:28 AM
include/clang/ASTMatchers/ASTMatchers.h
3558 ↗(On Diff #43768)

Shouldn't we then not just define isAnyPointer?

flx updated this revision to Diff 45108.Jan 17 2016, 9:09 AM
flx marked an inline comment as done.
klimek accepted this revision.Jan 18 2016, 3:24 AM
klimek edited edge metadata.

LG.

I think it's time to get your commit access ;)

This revision is now accepted and ready to land.Jan 18 2016, 3:24 AM
This revision was automatically updated to reflect the committed changes.