summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaObjCProperty.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Set the objc "property attributes as written" for extension properties as well.Argyrios Kyrtzidis2011-10-181-28/+34
| | | | llvm-svn: 142406
* obj-c++: allow the getter/setter to return/take parametersFariborz Jahanian2011-10-151-2/+4
| | | | | | by reference. // rdar://10188258 llvm-svn: 142075
* objc-arc: 'Class' property is implicitly __unsafe_unretained.Fariborz Jahanian2011-10-131-1/+1
| | | | | | // rdar://10239594 llvm-svn: 141915
* Fix typo in name of diagnostic.Ted Kremenek2011-10-121-1/+1
| | | | llvm-svn: 141793
* objc: note location of the previously declaredFariborz Jahanian2011-10-121-1/+3
| | | | | | property in the diagnostic. llvm-svn: 141745
* objc: err on a property designated both atomic andFariborz Jahanian2011-10-101-0/+7
| | | | | | nonatomic. // rdar://10260017 llvm-svn: 141580
* objc: Do not warn about mismatch on Super's readonly property attribute, Fariborz Jahanian2011-10-081-1/+1
| | | | | | | related to a readwrite property, and Sub's readwrite property. // rdar://9396329 llvm-svn: 141497
* objc++: some minor cleanup and a test caseFariborz Jahanian2011-10-071-5/+2
| | | | | | for atomic setters which requires assignment operator. llvm-svn: 141415
* objc: Improve on diagnostic when atomic proeprty is synthesizedFariborz Jahanian2011-10-061-1/+3
| | | | | | on one accessor and user-provide with another. llvm-svn: 141343
* objc++: For atomic properties of c++ class objec typet, appropriateFariborz Jahanian2011-10-061-0/+15
| | | | | | | operator= is called. Issue a warning for non-trivial case until runtime support is provided. // rdar://6137845 llvm-svn: 141302
* objc: Turn diagnostic on property type mismatch inFariborz Jahanian2011-10-041-1/+1
| | | | | | continuation class into warning. // rdar://10231514 llvm-svn: 141100
* Allow getting all source locations of selector identifiers in a ObjCMethodDecl.Argyrios Kyrtzidis2011-10-031-3/+3
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. llvm-svn: 140989
* Pass from the parser the locations of selector identifiers when creatingArgyrios Kyrtzidis2011-10-031-1/+2
| | | | | | | | objc method decls. They are not stored in the AST yet. llvm-svn: 140984
* Don't keep NumSelectorArgs in the ObjCMethodDecl, the number can be derived ↵Argyrios Kyrtzidis2011-10-031-1/+1
| | | | | | from the selector. llvm-svn: 140983
* Include prefix with default synthesized ivars.Ted Kremenek2011-09-271-3/+14
| | | | llvm-svn: 140657
* objc - don't complain about unimplemented property when conformingFariborz Jahanian2011-09-271-1/+2
| | | | | | | protocol declares the property, as well as one of its superclasses. Property will be implemented in the super class. // rdar://10120691 llvm-svn: 140586
* objc - compare setter/property types usingFariborz Jahanian2011-09-261-2/+2
| | | | | | hasSameUnqualifiedType in //rdar://10156674 llvm-svn: 140576
* objc - in matching setter argument type to its property type,Fariborz Jahanian2011-09-261-1/+2
| | | | | | ingore the type qualifiers. // rdar://10156674 llvm-svn: 140571
* objc - redeclaration of property in extension classFariborz Jahanian2011-09-241-1/+7
| | | | | | | must match property type declaration in its primary class. // rdar://10142679 llvm-svn: 140438
* CurContext cannot be null ever.Fariborz Jahanian2011-09-191-1/+1
| | | | llvm-svn: 140022
* objc: Don't crash with decl context for property impl.Fariborz Jahanian2011-09-171-1/+1
| | | | | | is missing. // rdar//10127639 llvm-svn: 139988
* objc-arc: warn when a 'retain' block property isFariborz Jahanian2011-09-141-1/+7
| | | | | | | declared which does not force a 'copy' of the block literal object. // rdar://9829425 llvm-svn: 139706
* Refactoring, mostly to give ObjCPropertyDecls stronger invariants forJohn McCall2011-09-131-135/+120
| | | | | | their semantic attributes and then to take advantage of that. llvm-svn: 139615
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-11/+11
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* objc-gc: More sema work for properties declared 'weak'Fariborz Jahanian2011-09-071-6/+13
| | | | | | in GC mode. // rdar://10073896 llvm-svn: 139235
* objc-gc: Don't force a __strong type'd propertyFariborz Jahanian2011-09-071-1/+1
| | | | | | | to be 'weak'. This prevents a crash and should probably be flagged as error - later to come. llvm-svn: 139211
* objc-gc: Adds support for "weak" property attribute under GC.Fariborz Jahanian2011-09-061-0/+6
| | | | | | // rdar://10073896 llvm-svn: 139203
* objective-c: this patch (re)introduces objective-c's default propertyFariborz Jahanian2011-08-311-0/+10
| | | | | | | | | | synthesis. This new feature is currently placed under -fobjc-default-synthesize-properties option and is off by default pending further testing. It will become the default feature soon. // rdar://8843851 llvm-svn: 138913
* objective-c - Make warning on unimplemented protocols pointFariborz Jahanian2011-08-271-6/+6
| | | | | | | to class implementation where it is supposed to be implemented. // rdar://10009982. llvm-svn: 138714
* objc-arc: Mention property's attribute by name whenFariborz Jahanian2011-08-261-1/+3
| | | | | | | finding life-time conflict with its declared ivar. // rdar://10007230 llvm-svn: 138659
* objc - use existing API for temporary switch ofFariborz Jahanian2011-08-221-5/+2
| | | | | | objc's decl context. llvm-svn: 138267
* objc - minor comment fix up and cleanup.Fariborz Jahanian2011-08-221-1/+1
| | | | llvm-svn: 138253
* Restore patch I reversed in r138040. Known buildbotFariborz Jahanian2011-08-221-12/+15
| | | | | | failures are resolved. llvm-svn: 138234
* objc-arc: @property definitions should default to (strong) when notFariborz Jahanian2011-08-191-7/+14
| | | | | | specified. // rdar://9971982 llvm-svn: 138062
* Revers r138040. Need to look at a few buildbot failures.Fariborz Jahanian2011-08-191-15/+12
| | | | llvm-svn: 138049
* objective-c: Bring objective-c handling of decl contextFariborz Jahanian2011-08-191-12/+15
| | | | | | | | | | to modernity. Instead of passing down individual context objects from parser to sema, establish decl context in parser and have sema access current context as needed. I still need to take of Doug's comment for minor cleanups. llvm-svn: 138040
* Mark objc methods that are implicitly declared for properties (not ↵Argyrios Kyrtzidis2011-08-171-3/+7
| | | | | | | | user-declared) as implicit. This results in libclang ignoring such methods. llvm-svn: 137852
* objective-c: reverse patch for // rdar://9818354Fariborz Jahanian2011-08-011-8/+0
| | | | llvm-svn: 136658
* In ARC we emit an error when compiling:Argyrios Kyrtzidis2011-07-261-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @interface Foo : NSObject @property (readonly) id myProp; @end @implementation Foo @synthesize myProp; @end t.m:9:13: error: ARC forbids synthesizing a property of an Objective-C object with unspecified storage attribute @synthesize myProp; ^ which is fine, we want the ownership of the synthesized ivar to be explicit. But we should _not_ emit an error for the following cases, because we can get the ownership either from the declared ivar or from the property type: @interface Foo : NSObject { __weak id _myProp1; id myProp2; } @property (readonly) id myProp1; @property (readonly) id myProp2; @property (readonly) __strong id myProp3; @end @implementation Foo @synthesize myProp1 = _myProp1; @synthesize myProp2; @synthesize myProp3; @end  rdar://9844006. llvm-svn: 136155
* objective-c: Any use of @synthesize or @dynamic lexically after a method (or ↵Fariborz Jahanian2011-07-221-0/+8
| | | | | | | | | | C function) implementation will be rejected with a compilation error in ARC mode, and a compiler warning otherwise. This may cause breakage in non-arc (and arc) tests which don't expect warning/error. Feel free to fix the tests, or reverse the patch, if I am unavailable. // rdar://9818354 - WIP llvm-svn: 135740
* When creating a property in a class extension, make sure to check itsDouglas Gregor2011-07-151-0/+1
| | | | | | attributes. Fixes <rdar://problem/9561076>. llvm-svn: 135273
* objc++: Some level of covariance is allowed in ObjC properties.Fariborz Jahanian2011-07-131-6/+9
| | | | | | | Make it also available in ObjC++ propeties. Use common code for objc and objc++ so they don't diverge. // rdar://9740328 llvm-svn: 135050
* objc++: Some level of covariance is allowed in ObjC properties.Fariborz Jahanian2011-07-121-1/+1
| | | | | | Make it also available in ObjC++ propeties. // rdar://9740328 llvm-svn: 135001
* [ARC] Complain about property without storage attribute when @synthesizing ↵Argyrios Kyrtzidis2011-07-121-20/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it, not at its declaration. For this sample: @interface Foo @property id x; @end we get: t.m:2:1: error: ARC forbids properties of Objective-C objects with unspecified storage attribute @property id x; ^ 1 error generated. The error should be imposed on the implementor of the interface, not the user. If the user uses a header of a non-ARC library whose source code he does not have, we are basically asking him to go change the header of the library (bad in general), possible overriding how the property is implemented if he gets confused and says "Oh I'll just add 'copy' then" (even worse). Second issue is that we don't emit any error for 'readonly' properties, e.g: @interface Foo @property (readonly) id x; // no error here @end @implementation Foo @synthesize x; // no error here too @end We should give an error when the implementor is @synthesizing a property which doesn't have any storage specifier; this is when the explicit specifier is important, because we are going to create an ivar and we want its ownership to be explicit. Related improvements: -OBJC_PR_unsafe_unretained turned out to not fit in ObjCPropertyDecl's bitfields, fix it. -For properties of extension classes don't drop PropertyAttributesAsWritten values. -Have PropertyAttributesAsWritten actually only reflect what the user wrote rdar://9756610. llvm-svn: 134960
* Change the driver's logic about Objective-C runtimes: abstract out aJohn McCall2011-07-061-1/+1
| | | | | | | | | | | | structure to hold inferred information, then propagate each invididual bit down to -cc1. Separate the bits of "supports weak" and "has a native ARC runtime"; make the latter a CodeGenOption. The tool chain is still driving this decision, because it's the place that has the required deployment target information on Darwin, but at least it's better-factored now. llvm-svn: 134453
* objc-arc/mrc: Allow ns_returns_not_retained attribute on propertiesFariborz Jahanian2011-06-251-1/+11
| | | | | | | | | to turn off warning on those properties which follow Cocoa naming convention for retaining objects and yet they were not meant for such purposes. Also, perform consistancy checking for declared getters of such methods. // rdar://9636091 llvm-svn: 133849
* No need to warn if 'unavailable' method/property Fariborz Jahanian2011-06-241-1/+1
| | | | | | is not implemented. // rdar://9651605 llvm-svn: 133819
* Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about ↵Argyrios Kyrtzidis2011-06-241-3/+3
| | | | | | | | 'ownership', not 'lifetime'. rdar://9477613. llvm-svn: 133779
* Automatic Reference Counting.John McCall2011-06-151-33/+350
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Restore 'atomic' as an attribute of objcFariborz Jahanian2011-06-111-2/+6
| | | | | | properties. llvm-svn: 132866
OpenPOWER on IntegriCloud