]> granicus.if.org Git - clang/commitdiff
Fixed a bug showed up the meta-data for protocol
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 22 Dec 2008 20:41:58 +0000 (20:41 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 22 Dec 2008 20:41:58 +0000 (20:41 +0000)
instance methods by building print-class-info.m,
whose output is now identical to what gcc puts out.

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

lib/AST/DeclObjC.cpp

index 6045fa20c13a80b916695a518c0f00b68162e5be..a14e3ba068ca37603887f01db7817cfcb0596509 100644 (file)
@@ -468,7 +468,11 @@ addPropertyMethods(Decl *D,
                              property->getGetterName(), 
                              property->getType(),
                              D,
-                             true, false, true, ObjCMethodDecl::Required);
+                             true, false, true, 
+                             (property->getPropertyImplementation() == 
+                              ObjCPropertyDecl::Optional) ? 
+                             ObjCMethodDecl::Optional : 
+                             ObjCMethodDecl::Required);
     insMethods.push_back(GetterDecl);
     InsMap[property->getGetterName()] = GetterDecl;
   }
@@ -493,7 +497,11 @@ addPropertyMethods(Decl *D,
                              property->getSetterName(), 
                              Context.VoidTy,
                              D,
-                             true, false, true, ObjCMethodDecl::Required);
+                             true, false, true,
+                             (property->getPropertyImplementation() == 
+                              ObjCPropertyDecl::Optional) ? 
+                             ObjCMethodDecl::Optional : 
+                             ObjCMethodDecl::Required);
     insMethods.push_back(SetterDecl);
     InsMap[property->getSetterName()] = SetterDecl;
     // Invent the arguments for the setter. We don't bother making a