[cfe-commits] [patch] new clang-analyzer checker that verifies ObjC API usage in UIViewController subclasses [v2]

Jordan Rose jordan_rose at apple.com
Wed Oct 24 09:13:44 PDT 2012


On Oct 23, 2012, at 14:24 , Julian Mayer <julian at corecode.at> wrote:

> 
> On 23.10.2012, at 18:58, wrote Jordan Rose:
> 
>> Hi, Julian. Sorry for not getting back to you right away. I had a few comments stashed away for your checker, but I got sidetracked by the fact that it will eventually be obsolete with the new 'objc_requires_super' attribute. I don't know if you've followed the list, but that attribute (for methods) will effectively do the same check, but as a compiler warning.
>> 
>> However, there hasn't been a release of the Cocoa and Cocoa Touch frameworks with this attribute in all the right places, so your checker is still useful. I'll put some comments for the actual patch on Phabricator (http://llvm-reviews.chandlerc.com/D68).
>> 
>> Thanks for working on this!
> 
> hello jordan
> 
> thanks for your review. i read cfe-dev but was not aware of the upcoming 'objc_requires_super' attribute (good idea ;).
> 
> i've addressed most of your concerns and am currently waiting for a rebuild and some testing before posting an updated version.
> 
> the one thing i did not address yet is a move to use RecursiveASTVisitor. i'm not sure if i can do it since i'm ignorant to the compiler internals in general and llvm internals in particular and was only able to create this checker because really it is just a simple modification of the dealloc checker. but if it in absolute requirement to get the patch in, i will have a shot at it.

I think you shouldn't have too much difficulty. The boilerplate part of RAV is described at http://clang.llvm.org/docs/RAVFrontendAction.html, if it helps, and then you can just visit ObjCMessageExprs as before but not worry about recursing to children. I'd say go for it.



More information about the cfe-commits mailing list