From 3a02b44e3948f7762dbfba94b7961281ca29d022 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 12 Aug 2011 20:47:08 +0000 Subject: [PATCH] metadata generated by the compiler does not include the weak 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 | 4 +++- lib/AST/ASTContext.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 520a3780c1..d7ce893113 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -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; } diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index cd7d5080e8..7acc22abcc 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -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; } } -- 2.40.0