From: Fariborz Jahanian Date: Wed, 28 Jan 2009 22:46:49 +0000 (+0000) Subject: Add setter/getter methods to the list of methods X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=939abced90071beb750041ee9c2cf57f827e024a;p=clang Add setter/getter methods to the list of methods 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 --- diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index acd5315842..8ffed61857 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -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,