summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* ArrayRef'ize some SemaOverload methodsDmitri Gribenko2013-05-091-1/+1
| | | | | | Patch by Robert Wilhelm. llvm-svn: 181544
* ArrayRef'ize Sema::CheckObjCMethodCallDmitri Gribenko2013-05-051-1/+2
| | | | | | Patch by Robert Wilhelm. llvm-svn: 181164
* Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef ↵Dmitri Gribenko2013-05-051-4/+4
| | | | | | | | constructor from None Patch by Robert Wilhelm. llvm-svn: 181139
* ArrayRef'ize InitializationSequence constructor and ↵Dmitri Gribenko2013-05-031-1/+1
| | | | | | | | InitializationSequence::Diagnose() Patch by Robert Wilhelm. llvm-svn: 181022
* Correctly emit certain implicit references to 'self' even withinJohn McCall2013-05-031-1/+1
| | | | | | | | | | | | | | | | | | a lambda. Bug #1 is that CGF's CurFuncDecl was "stuck" at lambda invocation functions. Fix that by generally improving getNonClosureContext to look through lambdas and captured statements but only report code contexts, which is generally what's wanted. Audit uses of CurFuncDecl and getNonClosureAncestor for correctness. Bug #2 is that lambdas weren't specially mapping 'self' when inside an ObjC method. Fix that by removing the requirement for that and using the normal EmitDeclRefLValue path in LoadObjCSelf. rdar://13800041 llvm-svn: 181000
* Point diagnostics that complain about a use of a selector in an objc ↵Argyrios Kyrtzidis2013-05-011-24/+41
| | | | | | | | | | | | message, to the selector location. Previously it would point to the left bracket or the receiver, which can be particularly problematic if the receiver is a block literal and we end up point the diagnostic far away for the selector that is complaining about. rdar://13620447 llvm-svn: 180833
* Objective-C: Issue deprecated warning when using a Fariborz Jahanian2013-04-041-2/+4
| | | | | | | deprecated typedef to subclass or invoke a class method. // rdar://13569424 llvm-svn: 178775
* Add 178663 back.Rafael Espindola2013-04-031-12/+7
| | | | | | | | | | | 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-7/+12
| | | | | | | | | | 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-12/+7
| | | | | | | | | | | 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
* Add a clarifying note when a return statement is rejected becauseJohn McCall2013-03-191-0/+67
| | | | | | | | we expect a related result type. rdar://12493140 llvm-svn: 177378
* Objective-C: When using super.prop, property should beFariborz Jahanian2013-03-111-2/+9
| | | | | | | looked up the current class's super class. // rdar://13349296 llvm-svn: 176832
* Centralize and refine the __unknown_anytype argument rulesJohn McCall2013-03-041-9/+18
| | | | | | | | | and be sure to apply them whether or not the debugger gave us a method declaration. rdar://12565338 llvm-svn: 176432
* Perform the receiver-expression transformations regardless ofJohn McCall2013-03-011-41/+42
| | | | | | | | | | | | | | whether we already have a method. Fixes a bug where we were failing to properly contextually convert a message receiver during template instantiation. As a side-effect, we now actually perform correct method lookup after adjusting a message-send to integral or non-ObjC pointer types (legal outside of ARC). rdar://13305374 llvm-svn: 176339
* objective-C arg: provide fixit support whenFariborz Jahanian2013-02-221-8/+36
| | | | | | | c++'s named cast need be replaced for bridge casting. // rdar://12788838 llvm-svn: 175923
* objective-C arc: Diagnostic can not say to use bridgeFariborz Jahanian2013-02-221-8/+21
| | | | | | | casts with c++ named casts. Change notes to say use bridge with c-style cast instead. // rdar://12788838 llvm-svn: 175850
* Include llvm::Optional in clang/Basic/LLVM.hDavid Blaikie2013-02-201-3/+3
| | | | | | Post-commit CR feedback from Jordan Rose regarding r175594. llvm-svn: 175679
* Fix crash-on-invalid where a ParenListExpr shows up as a message receiverArgyrios Kyrtzidis2013-02-151-0/+7
| | | | | | | | while trying to do error recovery. rdar://13207886 llvm-svn: 175282
* Small code change to improve performanceFariborz Jahanian2013-01-221-2/+6
| | | | | | in my last patch, suggested by Argyrios. llvm-svn: 173182
* objectiveC (take two): don't warn when in -Wselector mode andFariborz Jahanian2013-01-221-18/+30
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173179
* objectiveC: don't warn when in -Wselector mode andFariborz Jahanian2013-01-211-14/+17
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173097
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-8/+8
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* objective-C arc: Underline the selector when issuingFariborz Jahanian2012-11-281-1/+2
| | | | | | | arc specific diagnostic on the selector. This is objc-arc part of // rdar://11303469 llvm-svn: 168756
* Accept and pass arguments to __unknown_anytype in argumentJohn McCall2012-11-141-0/+13
| | | | | | | | | | | | | | | | | | | | | positions of Objective-C methods. It is possible to recover a lot of type information about Objective-C methods from the reflective metadata for their implementations. This information is not rich when it comes to struct types, however, and it is not possible to produce a type in the debugger's round-tripped AST which will really do anything useful during type-checking. Therefore we allow __unknown_anytype in these positions, which essentially disables type-checking for that argument. We infer the parameter type to be the unqualified type of the argument expression unless that expression is an explicit cast, in which case it becomes the type-as-written of that cast. rdar://problem/12565338 llvm-svn: 167896
* Allow objc_requires_super to be used to check class methods as well.Jordan Rose2012-10-191-13/+3
| | | | | | | | | | | | | Also, unify ObjCShouldCallSuperDealloc and ObjCShouldCallSuperFinalize. The two have identical behavior and will never be active at the same time. There's one last simplification now, which is that if we see a call to [super foo] and we are currently in a method named 'foo', we will /unconditionally/ clear the ObjCShouldCallSuper flag, rather than check first to see if we're in a method where calling super is required. There's no reason to pay the extra lookup price here. llvm-svn: 166285
* -Warc-repeated-use-of-weak: Check messages to property accessors as well.Jordan Rose2012-10-111-0/+18
| | | | | | | | | | | | | | | | | | | Previously, [foo weakProp] was not being treated the same as foo.weakProp. Now, for every explicit message send, we check if it's a property access, and if so, if the property is weak. Then for every assignment of a message, we have to do the same thing again. This is a potentially expensive increase because determining whether a method is a property accessor requires searching through the methods it overrides. However, without it -Warc-repeated-use-of-weak will miss cases from people who prefer not to use dot syntax. If this turns out to be too expensive, we can try caching the result somewhere, or even lose precision by not checking superclass methods. The warning is off-by-default, though. <rdar://problem/12407765> llvm-svn: 165718
* Move Sema::PropertyIfSetterOrGetter to ObjCMethodDecl::findPropertyDecl.Jordan Rose2012-10-101-10/+4
| | | | | | | | Then, switch users of PropertyIfSetterOrGetter and LookupPropertyDecl (the latter by name) over to findPropertyDecl. This actually makes -Wreceiver-is-weak a bit stronger than it was before. llvm-svn: 165628
* Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.Jordan Rose2012-10-101-5/+5
| | | | | | | | | | | | | This more accurately reflects its use: this flag is set when a method matches the getter or setter name for a property in the same class, and does not actually specify whether or not the definition of the method will be synthesized (either implicitly or explicitly with @synthesize). This renames the setter and backing field as well, and changes the (soon-to-be-obsolete?) XML dump format to use 'property_accessor' instead of 'synthesized'. llvm-svn: 165626
* -Wreceiver-is-weak: rephrase warning text and add a suggestion Note.Jordan Rose2012-09-281-13/+14
| | | | | | | | | | | | New output: warning: weak property may be unpredictably set to nil note: property declared here note: assign the value to a strong variable to keep the object alive during use <rdar://problem/12277204> llvm-svn: 164857
* objective-C: introduce __attribute((objc_requires_super)) on methodFariborz Jahanian2012-09-071-0/+8
| | | | | | | | in classes. Use it to flag those method implementations which don't contain call to 'super' if they have 'super' class and it has the method with this attribute set. This is wip. // rdar://6386358 llvm-svn: 163434
* objective-C: underline name of the missing methodFariborz Jahanian2012-08-311-4/+9
| | | | | | in the diagnbostic. // rdar://11303469 llvm-svn: 163003
* Push ArrayRef through the Expr hierarchy.Benjamin Kramer2012-08-241-2/+2
| | | | | | No functionality change. llvm-svn: 162552
* Now that ASTMultiPtr is nothing more than a array reference, make it a ↵Benjamin Kramer2012-08-231-10/+8
| | | | | | | | MutableArrayRef. This required changing all get() calls to data() and using the simpler constructors. llvm-svn: 162501
* Rip out remnants of move semantic emulation and smart pointers in Sema.Benjamin Kramer2012-08-231-9/+9
| | | | | | | These were nops for quite a while and only lead to confusion. ASTMultiPtr now behaves like a proper dumb array reference. llvm-svn: 162475
* Fix undefined behavior: member function calls where 'this' is a null pointer.Richard Smith2012-08-231-2/+2
| | | | llvm-svn: 162430
* Fix an assertion failure instantiating a constexpr function from within a ↵Eli Friedman2012-08-011-2/+2
| | | | | | -dealloc method. PR13401. llvm-svn: 161135
* Introduce new queries on ObjCRuntime for how to interpret subscriptsJohn McCall2012-07-311-7/+13
| | | | | | | | on object pointers and whether pointer arithmetic on object pointers is supported. Make ObjFW interpret subscripts as pseudo-objects. Based on a patch by Jonathan Schleifer. llvm-svn: 161028
* Explain why ACC_bottom should never occur in diagnosing ARC casts.Jordan Rose2012-07-311-3/+3
| | | | | | | This is just a clarification on Fariborz's original patch, per e-mail discussion. No functionality change. llvm-svn: 161016
* assert on ACC_bottom when checking for invalidFariborz Jahanian2012-07-281-2/+4
| | | | | | CF to ARC conversions. llvm-svn: 160923
* more objc-arc: With ACC_bottom, we just provideFariborz Jahanian2012-07-281-2/+2
| | | | | | | __bride fixit, as it doesn't matter which cast to use. // rdar://11923822 llvm-svn: 160906
* objc-arc: change per Jordy's comments.Fariborz Jahanian2012-07-271-13/+14
| | | | | | // rdar://11923822 llvm-svn: 160902
* objective-c arc: When function calls with known CFCreate naming conventionFariborz Jahanian2012-07-271-8/+18
| | | | | | | | are cast to retainable types, only suggest CFBridgingRelease/ CFBridgingRetain and not the __bridge casts. // rdar://11923822 llvm-svn: 160900
* revert r160839 for now.Fariborz Jahanian2012-07-271-12/+27
| | | | llvm-svn: 160895
* Consolidate ObjC lookupPrivateMethod methods from Sema and DeclObjC.Anna Zaks2012-07-271-67/+5
| | | | | | | | | | | | | Also, fix a subtle bug, which occurred due to lookupPrivateMethod defined in DeclObjC.h not looking up the method inside parent's categories. Note, the code assumes that Class's parent object has the same methods as what's in the Root class of a the hierarchy, which is a heuristic that might not hold for hierarchies which do not descend from NSObject. Would be great to fix this in the future. llvm-svn: 160885
* objc-arc: When objects with known CF semantics are assigned toFariborz Jahanian2012-07-261-27/+12
| | | | | | | | retainable types in arc, only suggest CFBridgingRelease/ CFBridgingRetain and not the confusing __bridge casts. // rdar://11923822 llvm-svn: 160839
* Warn on weak properties declared in protocols as well.Jordan Rose2012-06-281-2/+4
| | | | | | Previously this caused a crash, since protocols are not interfaces. llvm-svn: 159357
* objective-c: issue deprecation/unavailability warnings for methods called on Fariborz Jahanian2012-06-231-0/+3
| | | | | | id <Protocol>. // rdar://11618852 llvm-svn: 159084
* Documentation cleanup:James Dennett2012-06-221-4/+4
| | | | | | | | | | | | | | | * Primarily fixed \param commands with names not matching any actual parameters of the documented functions. In many cases this consists just of fixing up the parameter name in the \param to match the code, in some it means deleting obsolete documentation and occasionally it means documenting the parameter that has replaced the older one that was documented, which sometimes means some simple reverse-engineering of the docs from the implementation; * Fixed \param ParamName [out] to the correct format with [out] before the parameter name; * Fixed some \brief summaries. llvm-svn: 158980
* Restructure how the driver communicates information about theJohn McCall2012-06-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Attach fixits for CFBridgingRetain/Release outside any casts.Jordan Rose2012-06-071-2/+4
| | | | | | | | | Before, the note showed the location where you could insert __bridge variants, but the actual fixit edit came after the cast. No functionality change. llvm-svn: 158131
OpenPOWER on IntegriCloud