[cfe-users] Fwd: [cfe-dev] matcher for obj-c variable declarations.
Alfred Zien via cfe-users
cfe-users at lists.llvm.org
Fri Sep 16 10:52:48 PDT 2016
cfe-dev was wrong list may be?
> Hi to everyone!
> I'm new to clang and libtooling, and I'm making some cheker tool that emits a error if any obj-c variable declaration doesn't have nullability specifier.
> I have code like this
> A* a = [[A alloc] init];
> B* _Null_unspecified b = [[B alloc] init];
> C* _Nullable c = [[C alloc] init];
> D* _Nonnull d = [[D alloc] init];
> Now, I want to create a matcher to match variables declaration.
> Currently I have something like this:
> StatementMatcher NullUnspecifiedMatcher =
> There is objcObjectPointerType() but it matches only a (is it a bug?). There are some pointers/references matchers, but they don't work on those variable declarations at all. Also, I tried isAnyPointer() but it works on any pointer, obj-c or not.
> I tried type() to ensure, that I'm doing everything correctly, and it works.
> So, how can I match only obj-c variable declarations, with or without nullability specifier?
> Thanks for any help!
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-users