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

CoreCode julian at corecode.at
Wed Oct 24 15:06:37 PDT 2012


Hi jordan_rose,

attached is a new clang-analyzer checker that verifies ObjC API usage in UIViewController subclasses, more specifically if implemented methods correctly call the superclass implementations in methods where this is mandatory (and omitting these calls can lead to real and difficult-to-find bugs).

the code is largely based on the dealloc checker which includes the check for a missing super call as part its functions.

the code currently only checks UIViewController subclasses but should be extended to be more general in the future, there are a variety of classes in the iOS and Mac OS X APIs that require some methods in their subclass implementations to either call super or not call super. the ToDo list in this regard is at the bottom of the file.

this is the third revision of the patch, it addresses the points raised in the review from jordan rose. the most significant change is to use a RecursiveASTVisitor now.

http://llvm-reviews.chandlerc.com/D78

Files:
  test/Analysis/viewcontroller.m
  lib/StaticAnalyzer/Checkers/Checkers.td
  lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp
  lib/StaticAnalyzer/Checkers/CMakeLists.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78.1.patch
Type: text/x-patch
Size: 14410 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121024/0bd9a8e0/attachment.bin>


More information about the cfe-commits mailing list