[cfe-commits] r66834 - in /cfe/trunk: lib/Parse/ParseObjc.cpp test/CodeGenObjC/property-setter-attr.m
Fariborz Jahanian
fjahanian at apple.com
Thu Mar 12 15:34:11 PDT 2009
Author: fjahanian
Date: Thu Mar 12 17:34:11 2009
New Revision: 66834
URL: http://llvm.org/viewvc/llvm-project?rev=66834&view=rev
Log:
Use paropery's setter attribute name as
the selector for the property setter.
Added:
cfe/trunk/test/CodeGenObjC/property-setter-attr.m
Modified:
cfe/trunk/lib/Parse/ParseObjc.cpp
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=66834&r1=66833&r2=66834&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Thu Mar 12 17:34:11 2009
@@ -327,13 +327,13 @@
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,
Added: cfe/trunk/test/CodeGenObjC/property-setter-attr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/property-setter-attr.m?rev=66834&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/property-setter-attr.m (added)
+++ cfe/trunk/test/CodeGenObjC/property-setter-attr.m Thu Mar 12 17:34:11 2009
@@ -0,0 +1,10 @@
+// RUN: clang -emit-llvm -triple=i686-apple-darwin8 -o %t %s
+// RUN: grep -e "SiSetOtherThings:" %t
+
+ at interface A
+ at property(setter=iSetOtherThings:) int otherThings;
+ at end
+
+ at implementation A
+ at dynamic otherThings;
+ at end
More information about the cfe-commits
mailing list