[cfe-commits] r161884 - in /cfe/trunk/test/Analysis/inlining: DynDispatchBifurcate.m InlineObjCClassMethod.m

Anna Zaks ganna at apple.com
Tue Aug 14 11:35:07 PDT 2012


Author: zaks
Date: Tue Aug 14 13:35:06 2012
New Revision: 161884

URL: http://llvm.org/viewvc/llvm-project?rev=161884&view=rev
Log:
[analyzer] Address Jordan's comments for r161822, r161683.

Add a TODO test case for r161822 - calling self from a class method.

Remove a TODO comment for r161683 - value2 is not a property - we just
have method names that look like they are getters/setters for a
property.

Modified:
    cfe/trunk/test/Analysis/inlining/DynDispatchBifurcate.m
    cfe/trunk/test/Analysis/inlining/InlineObjCClassMethod.m

Modified: cfe/trunk/test/Analysis/inlining/DynDispatchBifurcate.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inlining/DynDispatchBifurcate.m?rev=161884&r1=161883&r2=161884&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inlining/DynDispatchBifurcate.m (original)
+++ cfe/trunk/test/Analysis/inlining/DynDispatchBifurcate.m Tue Aug 14 13:35:06 2012
@@ -170,7 +170,7 @@
   int x = 0;
   [p setValue2:0];
   if ([p value2] != 0)
-    return 5/x; // expected-warning {{Division by zero}} // TODO: no warning, we should always inline the property.
+    return 5/x; // expected-warning {{Division by zero}}
   return 5/[p value2]; // expected-warning {{Division by zero}}
 }
 

Modified: cfe/trunk/test/Analysis/inlining/InlineObjCClassMethod.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inlining/InlineObjCClassMethod.m?rev=161884&r1=161883&r2=161884&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inlining/InlineObjCClassMethod.m (original)
+++ cfe/trunk/test/Analysis/inlining/InlineObjCClassMethod.m Tue Aug 14 13:35:06 2012
@@ -179,3 +179,33 @@
   int y = [MyParentSelf testSelf];
   return 5/y; // Should warn here.
 }
+
+// TODO: We do not inline 'getNum' in the following case, where the value of 
+// 'self' in call '[self getNum]' is available and evaualtes to 
+// 'SelfUsedInParentChild' if it's called from fooA.
+// Self region should get created before we call foo and yje call to super 
+// should keep it live. 
+ at interface SelfUsedInParent : NSObject
++ (int)getNum;
++ (int)foo;
+ at end
+ at implementation SelfUsedInParent
++ (int)getNum {return 5;}
++ (int)foo {
+  return [self getNum];
+}
+ at end
+ at interface SelfUsedInParentChild : SelfUsedInParent
++ (int)getNum;
++ (int)fooA;
+ at end
+ at implementation SelfUsedInParentChild
++ (int)getNum {return 0;}
++ (int)fooA {
+  return [super foo];
+}
+ at end
+int checkSelfUsedInparentClassMethod() {
+    return 5/[SelfUsedInParentChild fooA];
+}
+





More information about the cfe-commits mailing list