ObjC: add getter/setter for class properties to global pool.
authorManman Ren <manman.ren@gmail.com>
Wed, 23 Mar 2016 21:39:31 +0000 (21:39 +0000)
committerManman Ren <manman.ren@gmail.com>
Wed, 23 Mar 2016 21:39:31 +0000 (21:39 +0000)
rdar://problem/25323072

llvm-svn: 264196

clang/lib/Sema/SemaObjCProperty.cpp
clang/test/SemaObjC/objc-class-property.m

index 3f8799a..3224694 100644 (file)
@@ -2308,6 +2308,11 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property) {
       AddInstanceMethodToGlobalPool(GetterMethod);
     if (SetterMethod)
       AddInstanceMethodToGlobalPool(SetterMethod);
+  } else {
+    if (GetterMethod)
+      AddFactoryMethodToGlobalPool(GetterMethod);
+    if (SetterMethod)
+      AddFactoryMethodToGlobalPool(SetterMethod);
   }
 
   ObjCInterfaceDecl *CurrentClass = dyn_cast<ObjCInterfaceDecl>(CD);
index 0058ee3..37a8178 100644 (file)
@@ -33,3 +33,11 @@ int test() {
   A *a = [[A alloc] init];
   return a.x + A.c;
 }
+
+void message_id(id me) {
+  [me y];
+}
+
+void message_class(Class me) {
+  [me c2];
+}