[PATCH] D11842: [analyzer]Don't issue alarm in ObjCSuperCallChecker for the super class itself.

Devin Coughlin via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 7 18:32:33 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL244386: [analyzer] Don't issue alarm in ObjCSuperCallChecker for the super class itself. (authored by dcoughlin).

Changed prior to commit:
  http://reviews.llvm.org/D11842?vs=31535&id=31570#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11842

Files:
  cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp
  cfe/trunk/test/Analysis/superclass.m

Index: cfe/trunk/test/Analysis/superclass.m
===================================================================
--- cfe/trunk/test/Analysis/superclass.m
+++ cfe/trunk/test/Analysis/superclass.m
@@ -30,7 +30,7 @@
 - (void)didReceiveMemoryWarning;
 - (void)removeFromParentViewController;
 - (void)transitionFromViewController:(UIViewController *)fromViewController
-  toViewController:(UIViewController *)toViewController 
+  toViewController:(UIViewController *)toViewController
   duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options
   animations:(void (^)(void))animations
   completion:(void (^)(BOOL finished))completion;
@@ -69,6 +69,25 @@
 - (void)encodeRestorableStateWithCoder:(NSCoder *)coder {}
 @end
 
+// Do not warn for the implementation in the superclass itself.
+ at implementation UIViewController
+- (void)addChildViewController:(UIViewController *)childController {}
+- (void)viewDidAppear:(BOOL)animated {}
+- (void)viewDidDisappear:(BOOL)animated {}
+- (void)viewDidUnload {}
+- (void)viewDidLoad {}
+- (void)viewWillUnload {}
+- (void)viewWillAppear:(BOOL)animated {}
+- (void)viewWillDisappear:(BOOL)animated {}
+- (void)didReceiveMemoryWarning {}
+- (void)removeFromParentViewController {}
+- (void)transitionFromViewController:(UIViewController *)fromViewController
+  toViewController:(UIViewController *)toViewController
+  duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options
+  animations:(void (^)(void))animations
+  completion:(void (^)(BOOL finished))completion {}
+ at end
+
 // Warn if UIViewController is our superclass and we do not call super
 @interface TestB : UIViewController {}
 @end
Index: cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp
@@ -88,7 +88,7 @@
 /// \param[out] SuperclassName On return, the found superclass name.
 bool ObjCSuperCallChecker::isCheckableClass(const ObjCImplementationDecl *D,
                                             StringRef &SuperclassName) const {
-  const ObjCInterfaceDecl *ID = D->getClassInterface();
+  const ObjCInterfaceDecl *ID = D->getClassInterface()->getSuperClass();
   for ( ; ID ; ID = ID->getSuperClass())
   {
     SuperclassName = ID->getIdentifier()->getName();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11842.31570.patch
Type: text/x-patch
Size: 2435 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150808/817e8647/attachment.bin>


More information about the cfe-commits mailing list