ObjCMethodDecl::findPropertyDecl: bail out early if not an instance method.
authorJordan Rose <jordan_rose@apple.com>
Thu, 11 Oct 2012 16:02:02 +0000 (16:02 +0000)
committerJordan Rose <jordan_rose@apple.com>
Thu, 11 Oct 2012 16:02:02 +0000 (16:02 +0000)
Currently, Objective-C does not support class properties, even though it
allows calling class methods with dot syntax.

No intended functionality change; purely optimization.

llvm-svn: 165716

clang/lib/AST/DeclObjC.cpp

index f4a0bdf..2dbb353 100644 (file)
@@ -904,7 +904,7 @@ ObjCMethodDecl::findPropertyDecl(bool CheckOverrides) const {
   if (NumArgs > 1)
     return 0;
 
-  if (getMethodFamily() != OMF_None)
+  if (!isInstanceMethod() || getMethodFamily() != OMF_None)
     return 0;
   
   if (isPropertyAccessor()) {