]> granicus.if.org Git - clang/commitdiff
Use paropery's setter attribute name as
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 12 Mar 2009 22:34:11 +0000 (22:34 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 12 Mar 2009 22:34:11 +0000 (22:34 +0000)
the selector for the property setter.

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

lib/Parse/ParseObjc.cpp
test/CodeGenObjC/property-setter-attr.m [new file with mode: 0644]

index 293fe257cc8bc4bdd8abd8c339828bc8eefb8018..bb85536cd4372dba2a2d05ef13873c8b09f57cab 100644 (file)
@@ -327,13 +327,13 @@ void Parser::ParseObjCInterfaceDeclList(DeclTy *interfaceDecl,
         Selector GetterSel = 
           PP.getSelectorTable().getNullarySelector(SelName);
         IdentifierInfo *SetterName = OCDS.getSetterName();
-        if (!SetterName)
-          SetterName = FD.D.getIdentifier();
-          
-        Selector SetterSel = 
-            SelectorTable::constructSetterName(PP.getIdentifierTable(),
-                                               PP.getSelectorTable(),
-                                               SetterName);
+        Selector SetterSel;
+        if (SetterName)
+          SetterSel = PP.getSelectorTable().getSelector(1, &SetterName);
+        else
+          SetterSel = SelectorTable::constructSetterName(PP.getIdentifierTable(),
+                                                         PP.getSelectorTable(),
+                                                         FD.D.getIdentifier());
         bool isOverridingProperty = false;
         DeclTy *Property = Actions.ActOnProperty(CurScope, AtLoc, FD, OCDS,
                                                  GetterSel, SetterSel,
diff --git a/test/CodeGenObjC/property-setter-attr.m b/test/CodeGenObjC/property-setter-attr.m
new file mode 100644 (file)
index 0000000..edc8055
--- /dev/null
@@ -0,0 +1,10 @@
+// RUN: clang -emit-llvm -triple=i686-apple-darwin8 -o %t %s
+// RUN: grep -e "SiSetOtherThings:" %t
+
+@interface A 
+@property(setter=iSetOtherThings:) int otherThings;
+@end
+
+@implementation A
+@dynamic otherThings;
+@end