Objective-C [IRGen]. Add encoding for 'weak' attribute of a
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 2 Apr 2014 22:49:42 +0000 (22:49 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 2 Apr 2014 22:49:42 +0000 (22:49 +0000)
'readonly' property. // rdar://16136439

llvm-svn: 205477

clang/lib/AST/ASTContext.cpp
clang/test/CodeGenObjC/arc-ivar-layout.m

index edc7460..5aa4bee 100644 (file)
@@ -5018,6 +5018,8 @@ void ASTContext::getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD,
       S += ",C";
     if (PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_retain)
       S += ",&";
+    if (PD->getPropertyAttributes() & ObjCPropertyDecl::OBJC_PR_weak)
+      S += ",W";
   } else {
     switch (PD->getSetterKind()) {
     case ObjCPropertyDecl::Assign: break;
index 9128063..06e387c 100644 (file)
 @implementation UnsafePerson @end
 // CHECK-LP64: L_OBJC_CLASS_NAME_20:
 // CHECK-LP64-NEXT: .asciz      "!"
+
+// rdar://16136439
+@interface rdar16136439
+    @property (nonatomic, readonly, weak) id first;
+@end
+
+@implementation rdar16136439 @end
+// CHECK-LP64: L_OBJC_PROP_NAME_ATTR_29:
+// CHECK-LP64-NEXT: .asciz  "T@,R,W,N,V_first"