[cfe-commits] r160883 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h test/Analysis/inlining/InlineObjCClassMethod.m
Anna Zaks
ganna at apple.com
Fri Jul 27 12:07:32 PDT 2012
Author: zaks
Date: Fri Jul 27 14:07:32 2012
New Revision: 160883
URL: http://llvm.org/viewvc/llvm-project?rev=160883&view=rev
Log:
[analyzer] Address Jordan's and Fariborz's review of r160768.
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
cfe/trunk/test/Analysis/inlining/InlineObjCClassMethod.m
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h?rev=160883&r1=160882&r2=160883&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h Fri Jul 27 14:07:32 2012
@@ -652,17 +652,17 @@
// 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;
Modified: cfe/trunk/test/Analysis/inlining/InlineObjCClassMethod.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/inlining/InlineObjCClassMethod.m?rev=160883&r1=160882&r2=160883&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/inlining/InlineObjCClassMethod.m (original)
+++ cfe/trunk/test/Analysis/inlining/InlineObjCClassMethod.m Fri Jul 27 14:07:32 2012
@@ -114,6 +114,7 @@
// 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)
More information about the cfe-commits
mailing list