]> granicus.if.org Git - clang/commitdiff
Add setter/getter methods to the list of methods
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 28 Jan 2009 22:46:49 +0000 (22:46 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 28 Jan 2009 22:46:49 +0000 (22:46 +0000)
of class's meta-data (related to objc2 nonfragile abi).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63251 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCMac.cpp

index acd5315842f447b880d5ec56268a542c4305ccfb..8ffed61857f3b87b154a5c7292f3afba36b5e4f3 100644 (file)
@@ -3189,6 +3189,21 @@ llvm::GlobalVariable * CGObjCNonFragileABIMac::BuildClassRoTInitializer(
       // Instance methods should always be defined.
       Methods.push_back(GetMethodConstant(*i));
     }
+    for (ObjCImplementationDecl::propimpl_iterator i = ID->propimpl_begin(),
+         e = ID->propimpl_end(); i != e; ++i) {
+      ObjCPropertyImplDecl *PID = *i;
+      
+      if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize){
+        ObjCPropertyDecl *PD = PID->getPropertyDecl();
+        
+        if (ObjCMethodDecl *MD = PD->getGetterMethodDecl())
+          if (llvm::Constant *C = GetMethodConstant(MD))
+            Methods.push_back(C);
+        if (ObjCMethodDecl *MD = PD->getSetterMethodDecl())
+          if (llvm::Constant *C = GetMethodConstant(MD))
+            Methods.push_back(C);
+      }
+    }
   }
   // FIXME. Section may always be .data
   Values[ 5] = EmitMethodList(MethodListName,