[cfe-commits] r97199 - /cfe/trunk/lib/CodeGen/CGObjCGNU.cpp

David Chisnall csdavec at swan.ac.uk
Thu Feb 25 17:11:38 PST 2010


Author: theraven
Date: Thu Feb 25 19:11:38 2010
New Revision: 97199

URL: http://llvm.org/viewvc/llvm-project?rev=97199&view=rev
Log:
Don't generate method metadata for @dynamic properties.  Fixes PR6354.


Modified:
    cfe/trunk/lib/CodeGen/CGObjCGNU.cpp

Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=97199&r1=97198&r2=97199&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Thu Feb 25 19:11:38 2010
@@ -1192,19 +1192,22 @@
        iter != endIter ; iter++) {
     std::vector<llvm::Constant*> Fields;
     ObjCPropertyDecl *property = (*iter)->getPropertyDecl();
+    ObjCPropertyImplDecl *propertyImpl = *iter;
+    bool isSynthesized = (propertyImpl->getPropertyImplementation() == 
+        ObjCPropertyImplDecl::Synthesize);
 
     Fields.push_back(MakeConstantString(property->getNameAsString()));
     Fields.push_back(llvm::ConstantInt::get(Int8Ty,
                 property->getPropertyAttributes()));
-    Fields.push_back(llvm::ConstantInt::get(Int8Ty,
-                (*iter)->getPropertyImplementation() ==
-                ObjCPropertyImplDecl::Synthesize));
+    Fields.push_back(llvm::ConstantInt::get(Int8Ty, isSynthesized));
     if (ObjCMethodDecl *getter = property->getGetterMethodDecl()) {
-      InstanceMethodSels.push_back(getter->getSelector());
       std::string TypeStr;
       Context.getObjCEncodingForMethodDecl(getter,TypeStr);
       llvm::Constant *TypeEncoding = MakeConstantString(TypeStr);
-      InstanceMethodTypes.push_back(TypeEncoding);
+      if (isSynthesized) {
+        InstanceMethodTypes.push_back(TypeEncoding);
+        InstanceMethodSels.push_back(getter->getSelector());
+      }
       Fields.push_back(MakeConstantString(getter->getSelector().getAsString()));
       Fields.push_back(TypeEncoding);
     } else {
@@ -1212,11 +1215,13 @@
       Fields.push_back(NULLPtr);
     }
     if (ObjCMethodDecl *setter = property->getSetterMethodDecl()) {
-      InstanceMethodSels.push_back(setter->getSelector());
       std::string TypeStr;
       Context.getObjCEncodingForMethodDecl(setter,TypeStr);
       llvm::Constant *TypeEncoding = MakeConstantString(TypeStr);
-      InstanceMethodTypes.push_back(TypeEncoding);
+      if (isSynthesized) {
+        InstanceMethodTypes.push_back(TypeEncoding);
+        InstanceMethodSels.push_back(setter->getSelector());
+      }
       Fields.push_back(MakeConstantString(setter->getSelector().getAsString()));
       Fields.push_back(TypeEncoding);
     } else {





More information about the cfe-commits mailing list