]> granicus.if.org Git - clang/commitdiff
metadata generated by the compiler does not include the weak
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 12 Aug 2011 20:47:08 +0000 (20:47 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 12 Aug 2011 20:47:08 +0000 (20:47 +0000)
attribute of a property. patch by Remy Demarest fixes it.

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

include/clang/AST/DeclObjC.h
lib/AST/ASTContext.cpp

index 520a3780c1cfe16ae583b5ca99bc15cb855002c0..d7ce893113c3c91a6e3ed2148cac036b5fca6fd2 100644 (file)
@@ -1429,7 +1429,7 @@ public:
     NumPropertyAttrsBits = 12
   };
 
-  enum SetterKind { Assign, Retain, Copy };
+  enum SetterKind { Assign, Retain, Copy, Weak };
   enum PropertyControl { None, Required, Optional };
 private:
   SourceLocation AtLoc;   // location of @property
@@ -1509,6 +1509,8 @@ public:
       return Retain;
     if (PropertyAttributes & OBJC_PR_copy)
       return Copy;
+    if (PropertyAttributes & OBJC_PR_weak)
+      return Weak;
     return Assign;
   }
 
index cd7d5080e8f1b5e545e77c39affebd111c0d6133..7acc22abcc22d4099425f9318819989ab3701e13 100644 (file)
@@ -4078,6 +4078,7 @@ void ASTContext::getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD,
     case ObjCPropertyDecl::Assign: break;
     case ObjCPropertyDecl::Copy:   S += ",C"; break;
     case ObjCPropertyDecl::Retain: S += ",&"; break;
+    case ObjCPropertyDecl::Weak:   S += ",W"; break;
     }
   }