summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaObjCProperty.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix undefined behavior: member function calls where 'this' is a null pointer.Richard Smith2012-08-231-2/+4
| | | | llvm-svn: 162430
* Reduce duplicated hash map lookups.Benjamin Kramer2012-08-221-2/+2
| | | | llvm-svn: 162361
* change function name in my last patch.Fariborz Jahanian2012-08-211-3/+3
| | | | | | // rdar://12103400 llvm-svn: 162320
* objective-C: Change rules for overriding properties in Fariborz Jahanian2012-08-211-13/+25
| | | | | | | | | class extensions a little. clang now allows readonly property with no ownership rule (assign, unsafe_unretained, weak, retain, strong, or copy) with a readwrite property with an ownership rule. // rdar://12103400 llvm-svn: 162319
* Screw around with ObjCRuntime some more, changing theJohn McCall2012-08-211-1/+1
| | | | | | | | diagnostics for bad deployment targets and adding a few more predicates. Includes a patch by Jonathan Schleifer to enable ARC for ObjFW. llvm-svn: 162252
* Fix a pair of bugs relating to properties in ARC.John McCall2012-08-201-1/+18
| | | | | | | | | | | | | | | | | | | | First, when synthesizing an explicitly strong/retain/copy property of Class type, don't pretend during compatibility checking that the property is actually assign. Instead, resolve incompatibilities by secretly changing the type of *implicitly* __unsafe_unretained Class ivars to be strong. This is moderately evil but better than what we were doing. Second, when synthesizing the setter for a strong property of non-retainable type, be sure to use objc_setProperty. This is possible when the property is decorated with the NSObject attribute. This is an ugly, ugly corner of the language, and we probably ought to deprecate it. The first is rdar://problem/12039404; the second was noticed by inspection while fixing the first. llvm-svn: 162244
* Remove unused variables.Benjamin Kramer2012-08-081-2/+0
| | | | llvm-svn: 161483
* Attaching comments to declarations during parsing: handle more Objective-C ↵Dmitri Gribenko2012-07-131-0/+2
| | | | | | declarations. llvm-svn: 160156
* fix a typo in my last commit. I thought I recompiled,Fariborz Jahanian2012-06-291-1/+1
| | | | | | but apparently I did not. llvm-svn: 159452
* objc diagnostic: pass IdentifierInfo* to the diagnostic systemFariborz Jahanian2012-06-291-2/+2
| | | | | | to produce quotes instead of adding qoute to the test. llvm-svn: 159450
* objective-c mrc: Issue warning for mrc, as is done for arc, whenFariborz Jahanian2012-06-271-2/+1
| | | | | | | property retains a block object as it could be on the stack. // rdar://11761511 llvm-svn: 159293
* objc: tweak my last patch to warn if class extensionFariborz Jahanian2012-06-201-1/+1
| | | | | | has not overridden the property. // rdar://11656982 llvm-svn: 158871
* objective-c: Normally, a property cannot be both 'readonly' and having a Fariborz Jahanian2012-06-201-6/+80
| | | | | | | | | | "write" attribute (copy/retain/etc.). But, property declaration in primary class and protcols are tentative as they may be overridden into a 'readwrite' property in class extensions. Postpone diagnosing such warnings until the class implementation is seen. // rdar://11656982 llvm-svn: 158869
* objc: improved diagnostic when property autosynthesis may causeFariborz Jahanian2012-06-201-17/+19
| | | | | | change in behavior. // rdar://11671080 llvm-svn: 158828
* Restructure how the driver communicates information about theJohn McCall2012-06-201-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | target Objective-C runtime down to the frontend: break this down into a single target runtime kind and version, and compute all the relevant information from that. This makes it relatively painless to add support for new runtimes to the compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z, available at the driver level as a better and more general alternative to -fgnu-runtime and -fnext-runtime. This new concept of an Objective-C runtime also encompasses what we were previously separating out as the "Objective-C ABI", so fragile vs. non-fragile runtimes are now really modelled as different kinds of runtime, paving the way for better overall differentiation. As a sort of special case, continue to accept the -cc1 flag -fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak. I won't go so far as to say "no functionality change", even ignoring the new driver flag, but subtle changes in driver semantics are almost certainly not intended. llvm-svn: 158793
* objective-c: warn when autosynthesizing a property which has sameFariborz Jahanian2012-06-191-0/+16
| | | | | | | | name as an existing ivar since this is common source of error when people remove @synthesize to take advantage of autosynthesis. // rdar://11671080 llvm-svn: 158756
* Documentation cleanup:James Dennett2012-06-151-3/+3
| | | | | | | | | * Removed \param comments for parameters that no longer exist; * Fixed a "\para" typo to "\param"; * Escaped @, # and \ symbols as needed in Doxygen comments; * Added use of \brief to output short summaries. llvm-svn: 158498
* [libclang/AST]Argyrios Kyrtzidis2012-06-081-1/+1
| | | | | | | | | | | | | AST: For auto-synthesized ivars give them the location of the related property (previously they had no source location). This allows them to be indexed by libclang. libclang: Make sure synthesized ivars are indexed before the methods that may reference them. Fixes rdar://11607001. llvm-svn: 158189
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-061-15/+15
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* objective-c: fix a sema and IRGen crash when propertyFariborz Jahanian2012-05-291-3/+3
| | | | | | | | getter result type is safe but does not match with property type resulting in spurious warning followed by crash in IRGen. // rdar://11515196 llvm-svn: 157641
* Use the SelectorSet typedef more widely throughout Sema.Benjamin Kramer2012-05-271-1/+1
| | | | | | While there make it a SmallPtrSet. llvm-svn: 157532
* Remove unused argument in my last patch.Fariborz Jahanian2012-05-211-3/+2
| | | | llvm-svn: 157194
* objective-c: When default synthesizing readonly IBOutlet propertiesFariborz Jahanian2012-05-211-54/+42
| | | | | | provide a 'fixit' to change 'readonly' to 'readwrite'. // rdar://11448209 llvm-svn: 157193
* objective-c: Warn if default synthesizing readonly IBOutlet propertiesFariborz Jahanian2012-05-191-0/+67
| | | | | | | and provide a 'fixit' to change 'readonly' to 'readwrite'. 'fixit' part needs little more work. // rdar://11448209 llvm-svn: 157121
* objective-c: perform strict type checking on propertyFariborz Jahanian2012-05-151-13/+34
| | | | | | | | type and its accessor type and issue error if types are incompatible, instead of crashing in IRgen. // rdar://1105153 llvm-svn: 156871
* objc: avoid duplicate diagnostics on certain type mismatchesFariborz Jahanian2012-05-151-16/+18
| | | | | | between property and its backing ivar. llvm-svn: 156832
* [AST/libclang] Speed up clang_getOverriddenCursors() considerably by ↵Argyrios Kyrtzidis2012-05-091-0/+12
| | | | | | | | | | | | | reserving a bit in ObjCMethodDecl to indicate whether the method does not override any other method, which is the majority of cases. That way we can avoid unnecessary work doing lookups, especially when PCH is involved. rdar://11360082 llvm-svn: 156476
* Fixes a typo. note_xxx not not_xxx.Fariborz Jahanian2012-05-081-1/+1
| | | | llvm-svn: 156391
* Move Sema::RequireCompleteType() and Sema::RequireCompleteExprType()Douglas Gregor2012-05-041-2/+2
| | | | | | | | | | | off PartialDiagnostic. PartialDiagnostic is rather heavyweight for something that is in the critical path and is rarely used. So, switch over to an abstract-class-based callback mechanism that delays most of the work until a diagnostic is actually produced. Good for ~11k code size reduction in the compiler and 1% speedup in -fsyntax-only on the code in <rdar://problem/11004361>. llvm-svn: 156176
* objective-c: warn for properties being default synthesizedFariborz Jahanian2012-05-031-5/+10
| | | | | | | under -Wobjc-missing-property-synthesis which must be opted-in. // rdar://11295716 llvm-svn: 156078
* Add a missing RequireCompleteType call when synthesizing properties. ↵Eli Friedman2012-05-011-18/+36
| | | | | | | | <rdar://problem/11333367>. While I'm here, fix source locations for other diagnostics related to property synthesis. llvm-svn: 155953
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-18/+18
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* Fix PR10447: lazily building name lookup tables for DeclContexts was broken.Richard Smith2012-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The deferred lookup table building step couldn't accurately tell which Decls should be included in the lookup table, and consequently built different tables in some cases. Fix this by removing lazy building of DeclContext name lookup tables. In practice, the laziness was frequently not worthwhile in C++, because we performed lookup into most DeclContexts. In C, it had a bit more value, since there is no qualified lookup. In the place of lazy lookup table building, we simply don't build lookup tables for function DeclContexts at all. Such name lookup tables are not useful, since they don't capture the scoping information required to correctly perform name lookup in a function scope. The resulting performance delta is within the noise on my testing, but appears to be a very slight win for C++ and a very slight loss for C. The C performance can probably be recovered (if it is a measurable problem) by avoiding building the lookup table for the translation unit. llvm-svn: 152608
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-33/+33
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-101-3/+3
| | | | | | | | track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. llvm-svn: 152491
* objective-c: provide fixit hint when atomic property does notFariborz Jahanian2012-02-291-8/+39
| | | | | | | have matching user defined setter/getter and a warning is issued. In this case, a fixit note is displayed. // rdar://10267155 llvm-svn: 151766
* [AST] When we @synthesize a property with a user-defined ivar name,Argyrios Kyrtzidis2012-02-281-5/+5
| | | | | | | | | | make sure to record the source location of the ivar name. [libclang] When indexing @synthesized objc methods, report the @implementation as the lexical container. Fixes rdar://10905472 llvm-svn: 151635
* [AST] Associate the getter/setter methods to a property of a objc class ↵Argyrios Kyrtzidis2012-02-281-4/+8
| | | | | | | | | | extension. [libclang] Index the getter/setter methods of a property of a objc class extension. Fixes rdar://10907597 llvm-svn: 151633
* objective-c default synthesis. classes which adopt protocol propertiesFariborz Jahanian2012-02-231-1/+2
| | | | | | | must still auto synthesize those propeties which have been redeclared in the class. // rdar://10907410 llvm-svn: 151268
* Don't crash on attempts to synthesize an invalid property.John McCall2012-02-211-0/+1
| | | | | | rdar://problem/10904479 llvm-svn: 151089
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer2012-02-041-0/+1
| | | | | | | | include. Fix all the transitive include users. llvm-svn: 149783
* Further enhance comment for property in continuation class.Fariborz Jahanian2012-02-021-1/+4
| | | | llvm-svn: 149639
* objc: comment the code which allows narroing of property objectFariborz Jahanian2012-02-021-0/+3
| | | | | | type in continuation class. llvm-svn: 149625
* objective-c: When redeclaraing in continuation class a 'readonly'Fariborz Jahanian2012-02-021-5/+12
| | | | | | | | property to 'readwrite', also allow redeclaration of property type to a narrowring object type. // rdar://10790488 llvm-svn: 149614
* minor refactoring to improve compile-time performance.Fariborz Jahanian2012-01-111-2/+2
| | | | llvm-svn: 147963
* objc-arc: evaluate 'readonly' property with no knownFariborz Jahanian2012-01-111-6/+55
| | | | | | | life-time to that of its backing 'ivar's lifetime. // rdar://10558871 llvm-svn: 147956
* objc++: patch for IRgen for atomic properties ofFariborz Jahanian2012-01-101-2/+6
| | | | | | | c++ objects with non-trivial assignment/copy functions. Also, one additional sema check. // rdar://6137845 llvm-svn: 147817
* After further discussion, rename attribute ↵Ted Kremenek2012-01-051-4/+4
| | | | | | 'objc_disable_automatic_synthesis' to 'objc_requires_property_definitions'. llvm-svn: 147622
* objc: When issuing warning for missing synthesis forFariborz Jahanian2012-01-041-0/+9
| | | | | | | properties in classes declared with objc_suppress_autosynthesis attribute, pinpoint location of the said class in a note. llvm-svn: 147562
OpenPOWER on IntegriCloud