summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaObjCProperty.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* ObjectiveC. When introducing a new property declaration in Fariborz Jahanian2014-01-271-0/+12
| | | | | | | | parimary class and in mrr mode, assume property's default memory attribute (assign) and to prevent a bogus warning. // rdar://15859862 llvm-svn: 200238
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-10/+8
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* Distinguish between attributes explicitly written at the request of the ↵Aaron Ballman2014-01-161-7/+7
| | | | | | | | user, and attributes implicitly generated to assist in bookkeeping by the compiler. This is done so by table generating a CreateImplicit method for each attribute. Additionally, remove the optional nature of the spelling list index when creating attributes. This is supported by table generating a Spelling enumeration when the spellings for an attribute are distinct enough to warrant it. llvm-svn: 199378
* Use a proper lvalue-to-rvalue conversion in Objective-C++ property accessors.Jordan Rose2014-01-141-4/+10
| | | | | | | | | | | Previously, the synthesized AST contained an rvalue DeclRefExpr for 'self'. Now, it has an lvalue DeclRefExpr wrapped in an lvalue-to-rvalue ImplicitCastExpr, which is what's generated when an ivar access is written in the source. No (intended) functionality change. llvm-svn: 199225
* ObjectiveC. 1) Warn when @dynamic (as well as synthesize) Fariborz Jahanian2014-01-101-6/+2
| | | | | | | | | property has the naming convention that implies 'ownership'. 2) improve on diagnostic and make it property specific. 3) fix the line number in the case of default property synthesis. // rdar://15757510 llvm-svn: 198905
* Removing some more unnecessary manual quotes from diagnostics.Aaron Ballman2014-01-031-1/+1
| | | | llvm-svn: 198418
* Removing some more unnecessary manual quotes from diagnostics.Aaron Ballman2014-01-031-2/+2
| | | | llvm-svn: 198416
* Replacing calls to getAttr with calls to hasAttr for clarity. No functional ↵Aaron Ballman2013-12-191-2/+2
| | | | | | change intended -- this only replaces Boolean uses of getAttr. llvm-svn: 197648
* ObjectiveC. support "section" attribute on propertiesFariborz Jahanian2013-12-181-1/+7
| | | | | | and methods. rdar://15450637 llvm-svn: 197625
* Objective-C. Do not issue warning when 'readonly'Fariborz Jahanian2013-12-131-30/+7
| | | | | | | | | | | | | | property declaration has a memory management attribute (retain, copy, etc.). Sich properties are usually overridden to become 'readwrite' via a class extension (which require the memory management attribute specified). In the absence of class extension override, memory management attribute is needed to produce correct Code Gen. for the property getter in any case and this warning becomes confusing to user. // rdar://15641300 llvm-svn: 197251
* Enhance "auto synthesis will not synthesize property in protocol" to include ↵Ted Kremenek2013-12-121-2/+4
| | | | | | | | property and protocol name. Implements <rdar://problem/15617839>. llvm-svn: 197187
* [objc] Add a warning when a class that provides a designated initializer, ↵Argyrios Kyrtzidis2013-12-031-0/+28
| | | | | | | | does not override all of the designated initializers of its superclass. llvm-svn: 196319
* ObjectiveC ARC. Removes a bogus warning when a weak Fariborz Jahanian2013-11-191-1/+3
| | | | | | | property is redeclared as 'weak' in class extension. // rdar://15465916 llvm-svn: 195146
* ObjectiveC arc. Warn when an implicitly 'strong' property Fariborz Jahanian2013-10-261-0/+14
| | | | | | | is redeclared as 'weak' in class extension. // rdar://15304886 llvm-svn: 193453
* ObjectiveC: Warn when 'readonly' property has explicitFariborz Jahanian2013-10-071-118/+39
| | | | | | | ownership attribute (such as 'copy', 'assign' etc.) // rdar://15131088 llvm-svn: 192115
* ObjectiveC. Allow readonly properties without an explicit ownershipFariborz Jahanian2013-10-041-24/+34
| | | | | | | | (assign/unsafe_unretained/weak/retain/strong/copy) in super class to be overridden by a property with any explicit ownership in the subclass. // rdar://15014468 llvm-svn: 191971
* ObjectiveC: Allow NS_RETURNS_INNER_POINTER annotation Fariborz Jahanian2013-09-191-0/+4
| | | | | | | | | | of ObjectiveC properties to mean annotation of NS_RETURNS_INNER_POINTER on its synthesized getter. This also facilitates more migration to properties when methods are annotated with NS_RETURNS_INNER_POINTER. // rdar://14990439 llvm-svn: 191009
* Fix recovery for missing * in objc property.Eli Friedman2013-07-091-2/+10
| | | | | | <rdar://problem/14354144> llvm-svn: 185897
* Objective-C: diagnose when synthesizing an ivar ofFariborz Jahanian2013-07-051-1/+7
| | | | | | abstract class type. // rdar://14261999 llvm-svn: 185710
* Delete dead code.Eli Friedman2013-06-271-104/+0
| | | | llvm-svn: 185053
* Objective-C: Warn when IBOutletCollection propertyFariborz Jahanian2013-06-251-0/+2
| | | | | | | is declared to have 'assign' attribute. // rdar://14212998 llvm-svn: 184863
* Objective-C: Another case of issuing warning about misusingFariborz Jahanian2013-06-071-13/+13
| | | | | | | property auto-synthesis before knowingit it is to be auto-synthesized. // rdar://14094682 llvm-svn: 183556
* Objective-C: Removes a bogus warning about auto-synthesisFariborz Jahanian2013-06-071-10/+10
| | | | | | of properties. Fixes // rdar://14085456 llvm-svn: 183542
* Make helper functions static.Benjamin Kramer2013-05-231-2/+3
| | | | llvm-svn: 182589
* Objective-C [qoi]: When an class conforms to multipleFariborz Jahanian2013-05-201-0/+54
| | | | | | | | protocols that declare the same property of incompatible types, issue a warning when class implementation synthesizes the property. // rdar://13075400 llvm-svn: 182316
* Objective-C arc: Diagnose when user attempts toFariborz Jahanian2013-05-161-0/+12
| | | | | | | | synthesize a property getter method that overrides a method definition named 'retain' and the like. Fixes // rdar://13885083 llvm-svn: 182039
* Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef ↵Dmitri Gribenko2013-05-051-2/+1
| | | | | | | | constructor from None Patch by Robert Wilhelm. llvm-svn: 181139
* Objective-C: This is a small modification to myFariborz Jahanian2013-04-251-2/+2
| | | | | | | | | | patch -n r180198. When reporting on missing property accessor implementation in categories, do not report when they are declared in primary class, class's protocol, or one of it super classes or in of the other categories. // rdar://13713098 llvm-svn: 180580
* Objective-C arc: Improve disgnostics when 'weak'Fariborz Jahanian2013-04-241-2/+4
| | | | | | | | property cannot be synthesized because its backing ivar does not support weak references. // rdar://13676793 llvm-svn: 180211
* Objective-C: When reporting on missing property accessor implementation inFariborz Jahanian2013-04-241-5/+35
| | | | | | | | categories, do not report when they are declared in primary class, class's protocol, or one of it super classes. This is because, its class is going to implement them. // rdar://13713098 llvm-svn: 180198
* Revert r177948. We decided that we do not want ObjC property redeclarations ↵Ted Kremenek2013-04-041-2/+0
| | | | | | to inherit "deprecated". llvm-svn: 178743
* Be sure to check ARC conventions on the implicit method declarationsJohn McCall2013-04-041-0/+8
| | | | | | | | | of a property just in case the property's getter happens to be +1. We won't synthesize a getter for such a property, but we will allow the user to define a +1 method for it. rdar://13115896 llvm-svn: 178731
* Add 178663 back.Rafael Espindola2013-04-031-1/+0
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-031-0/+1
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-1/+0
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* Objective-C: Provide fixit hints when warningFariborz Jahanian2013-04-021-0/+2
| | | | | | | | about 'isa' ivar being explicitely accessed when base is a user class object reference. // rdar://13503456 llvm-svn: 178562
* Objective-C: Property declaration overiding one inFariborz Jahanian2013-03-251-0/+2
| | | | | | | its super class or protocols inherit their availability/deprecated attribute. // rdar://13467644 llvm-svn: 177948
* Objective-C: Tighten the rules when warningFariborz Jahanian2013-03-211-1/+2
| | | | | | | | | | is issused for on overriding 'readwrite' property which is not auto-synthesized. Buttom line is that if hueristics determine that there will be a user implemented setter, no warning will be issued. // rdar://13388503 llvm-svn: 177662
* Objective-C: In my last path, also checkFariborz Jahanian2013-03-121-1/+2
| | | | | | | | for existence of user setter before issuing the warning about non-synthesizable property. // rdar://13388503 llvm-svn: 176906
* Objective-C: Issue warning in couple of obscure casesFariborz Jahanian2013-03-121-3/+21
| | | | | | | | | | when property autosynthesis does not synthesize a property. When property is declared 'readonly' in a super class and is redeclared 'readwrite' in a subclass. When a property autosynthesis causes it to share 'ivar' with another property. // rdar://13388503 llvm-svn: 176889
* objective-C: synthesize properties in order of theirFariborz Jahanian2013-02-141-7/+10
| | | | | | | | declarations to synthesize their ivars in similar determinstic order so they are laid out in a determinstic order. // rdar://13192366 llvm-svn: 175214
* objective-C: When implementing custom accessor method forFariborz Jahanian2013-02-141-0/+27
| | | | | | | | a property, the -Wdirect-ivar-access should not warn when accessing the property's synthesized instance variable. // rdar://13142820 llvm-svn: 175195
* objective-C: Fixes a bogus warning due to not settingFariborz Jahanian2013-02-101-3/+13
| | | | | | | | the "nonatomic" attribute in property redeclaration in class extension. Also, improved on diagnostics in this area while at it. // rdar://13156292 llvm-svn: 174821
* QoI: -Wreadonly-iboutlet-property should have the warning's location on the ↵Ted Kremenek2013-02-091-2/+2
| | | | | | | | | | property. There's no need to refer to the @implementation at all. Fixes <rdar://problem/13186515> llvm-svn: 174802
* objective-C: don't issue bogus warning aboutFariborz Jahanian2013-02-081-12/+30
| | | | | | | | "auto-synthesized may not work correctly with 'nib' loader" when 'readonly' property is redeclared 'readwrite' in class extension. // rdar://13123861 llvm-svn: 174775
* Eliminate Sema::CompareProperties(), which was walking over a pile ofDouglas Gregor2013-01-211-56/+66
| | | | | | | | | lexical declarations looking for properties when we could more efficiently check for property mismatches at property declaration time. Good for ~1% of -fsyntax-only time when most of the properties we're checking against come from an AST file. llvm-svn: 173079
* Eliminate the oddly-named Sema::ComparePropertiesInBaseAndSuper, whichDouglas Gregor2013-01-211-45/+28
| | | | | | | | | | did a redundant traversal of the lexical declarations in the superclass. Instead, when we declare a new property, look into the superclass to see whether we're redeclaring the property. Goot for 1% of -fsyntax-only time on Cocoa.h and a little less than 3% on my modules test case. llvm-svn: 173073
* Replace some unnecessary O(N^2) lookups for properties withDouglas Gregor2013-01-211-40/+53
| | | | | | | DeclContext lookups. The performance win is negligible in my tests, but it's the Right Thing To Do (TM). llvm-svn: 173068
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-161-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider (sub)module visibility. The bulk of this change replaces myriad hand-rolled loops over the linked list of Objective-C categories/extensions attached to an interface declaration with loops using one of the four new category iterator kinds: visible_categories_iterator: Iterates over all visible categories and extensions, hiding any that have their "hidden" bit set. This is by far the most commonly used iterator. known_categories_iterator: Iterates over all categories and extensions, ignoring the "hidden" bit. This tends to be used for redeclaration-like traversals. visible_extensions_iterator: Iterates over all visible extensions, hiding any that have their "hidden" bit set. known_extensions_iterator: Iterates over all extensions, whether they are visible to normal name lookup or not. The effect of this change is that any uses of the visible_ iterators will respect module-import visibility. See the new tests for examples. Note that the old accessors for categories and extensions are gone; there are *Raw() forms for some of them, for those (few) areas of the compiler that have to manipulate the linked list of categories directly. This is generally discouraged. Part two of <rdar://problem/10634711>. llvm-svn: 172665
* Use Decl::getAvailability() rather than checking for the "unavailable"Douglas Gregor2013-01-081-1/+2
| | | | | | | attribute when determining whether we need to see an implementation of a property. Fixes <rdar://problem/12958191>. llvm-svn: 171877
OpenPOWER on IntegriCloud