]> granicus.if.org Git - clang/commitdiff
[analyzer] Address Jordan's and Fariborz's review of r160768.
authorAnna Zaks <ganna@apple.com>
Fri, 27 Jul 2012 19:07:32 +0000 (19:07 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 27 Jul 2012 19:07:32 +0000 (19:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160883 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
test/Analysis/inlining/InlineObjCClassMethod.m

index a366c07481987521ba1f03433fd7e23e24d0df2b..2661e62403fd5c5a8652ae01ea63aa9ac50878e3 100644 (file)
@@ -652,17 +652,17 @@ public:
   // getting the parameters). Currently, this gets called 3 times during 
   // inlining.
   virtual const Decl *getRuntimeDefinition() const {
-
     const ObjCMessageExpr *E = getOriginExpr();
+    assert(E);
+
     if (E->isInstanceMessage()) {
       return 0;
     } else {
-      // This is a calss method.
+      // This is a class method.
       // If we have type info for the receiver class, we are calling via
       // class name.
-      if (ObjCInterfaceDecl *IDecl = E->getReceiverInterface()) {
+      if (ObjCInterfaceDecl *IDecl = E->getReceiverInterface())
         return LookupClassMethodDefinition(E->getSelector(), IDecl);
-      }
     }
 
     return 0;
index 07652515508eacd5e7da8260d5f34d0260625725..8c0e733fc5720ff2fb8797fec28ecf20527d9204 100644 (file)
@@ -114,6 +114,7 @@ int foo() {
 // False negative.
 // ObjC class method call through a decl with a known type.
 // We should be able to track the type of currentClass and inline this call.
+// Note, [self class] could be a subclass. Do we still want to inline here?
 @interface MyClassKT : NSObject
 @end
 @interface MyClassKT (MyCatKT)