[cfe-commits] r153261 - in /cfe/trunk: lib/Rewrite/RewriteModernObjC.cpp test/Rewriter/objc-modern-property-attributes.mm

Fariborz Jahanian fjahanian at apple.com
Thu Mar 22 10:39:36 PDT 2012


Author: fjahanian
Date: Thu Mar 22 12:39:35 2012
New Revision: 153261

URL: http://llvm.org/viewvc/llvm-project?rev=153261&view=rev
Log:
modern objective-c rewriter: Fix up translation of
property attributes. // rdar://11095151


Added:
    cfe/trunk/test/Rewriter/objc-modern-property-attributes.mm
Modified:
    cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp

Modified: cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp?rev=153261&r1=153260&r2=153261&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp Thu Mar 22 12:39:35 2012
@@ -6246,7 +6246,7 @@
     ClassProperties.push_back(*I);
   
   Write_prop_list_t_initializer(*this, Context, Result, ClassProperties,
-                                 /* Container */0,
+                                 /* Container */IDecl,
                                  "_OBJC_$_PROP_LIST_",
                                  CDecl->getNameAsString());
 

Added: cfe/trunk/test/Rewriter/objc-modern-property-attributes.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/objc-modern-property-attributes.mm?rev=153261&view=auto
==============================================================================
--- cfe/trunk/test/Rewriter/objc-modern-property-attributes.mm (added)
+++ cfe/trunk/test/Rewriter/objc-modern-property-attributes.mm Thu Mar 22 12:39:35 2012
@@ -0,0 +1,35 @@
+// RUN: %clang_cc1 -E %s -o %t.mm
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o - | FileCheck %s
+
+// rdar://11095151
+
+typedef void (^void_block_t)(void);
+
+ at interface PropertyClass {
+    int q;
+    void_block_t __completion;
+    PropertyClass* YVAR;
+    id ID;
+}
+ at property int q;
+ at property int r;
+
+ at property (copy) void_block_t completionBlock;
+ at property (retain) PropertyClass* Yblock;
+ at property (copy) id ID;
+
+ at end
+
+ at implementation PropertyClass
+ at synthesize q;  // attributes should be "Ti,Vq"
+ at dynamic r;     // attributes should be "Ti,D"
+ at synthesize completionBlock=__completion; // "T@?,C,V__completion"
+ at synthesize Yblock = YVAR; // "T@\"PropertyClass\",&,VYVAR"
+ at synthesize  ID; // "T@,C,VID"
+ at end
+
+// CHECK: Ti,Vq
+// CHECK: Ti,D
+// CHECK: T@?,C,V__completion
+// CHECK: T@\"PropertyClass\",&,VYVAR
+





More information about the cfe-commits mailing list