summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch over a few uses of param_begin() to parameters()Alp Toker2014-07-071-17/+17
| | | | llvm-svn: 212442
* Objective-C ARC. Provide diagnostic and fix-it Fariborz Jahanian2014-06-261-0/+23
| | | | | | | | | when casting a retainable object to a objc_bridge_related CF type with the suggestion of applying the method specified in the bridging attribute to the object. // rdar://15932435 llvm-svn: 211807
* Objective-C. When we use @selector(save:), etc. there may be more Fariborz Jahanian2014-06-241-9/+17
| | | | | | | | | | | | | than one method with mismatched type of same selector name. clang issues a warning to point this out since it may cause undefined behavior. There are cases though that some APIs don't care about user methods and such warnings are perceived as noise. This patch allows users to add paren delimiters around selector name to turn off such warnings. So, @selector((save:)) will turn off the warning. It also provides 'fixit' so user knows what to do. // rdar://16458579 llvm-svn: 211611
* Objective-C ARC. Allow conversion of (void*) pointers toFariborz Jahanian2014-06-181-3/+6
| | | | | | | | retainable ObjC pointers without requiring a bridge-cast in the context of pointer comparison as this is in effect a +0 context. // rdar://16627903 llvm-svn: 211243
* Objective-C. Revert my patch in r211234.Fariborz Jahanian2014-06-181-3/+1
| | | | llvm-svn: 211237
* Objective-C ARC. Allow conversion of (void*) pointers toFariborz Jahanian2014-06-181-1/+3
| | | | | | | retainable ObjC pointers without requiring a bridge-cast by recognizing this as a +0 context. // rdar://16627903 llvm-svn: 211234
* Objective-C. Check for integer overflow in Objective-C'sFariborz Jahanian2014-06-181-1/+1
| | | | | | boxed expression. // rdar://16417427 llvm-svn: 211215
* Objective-C ARC. Do not warn about properties with bothFariborz Jahanian2014-06-171-1/+8
| | | | | | | | | IBOutlet and weak attributes when accessed being unpredictably set to nil because usage of such properties are always single threaded and its ivar cannot be set to nil asynchronously. // rdar://15885642 llvm-svn: 211132
* Hide the concept of diagnostic levels from lex, parse and semaAlp Toker2014-06-151-13/+5
| | | | | | | | | | | | | | | | The compilation pipeline doesn't actually need to know about the high-level concept of diagnostic mappings, and hiding the final computed level presents several simplifications and other potential benefits. The only exceptions are opportunistic checks to see whether expensive code paths can be avoided for diagnostics that are guaranteed to be ignored at a certain SourceLocation. This commit formalizes that invariant by introducing and using DiagnosticsEngine::isIgnored() in place of individual level checks throughout lex, parse and sema. llvm-svn: 211005
* Objective-C. More tests for both bridging attributes andFariborz Jahanian2014-06-111-1/+1
| | | | | | | a fix to make it work when CFStructs have no definition. // rdar://17238954. llvm-svn: 210690
* Objective-C. Patch to handle bridge attribute warningsFariborz Jahanian2014-06-111-29/+80
| | | | | | | | correctly when both NSAttributedString and NSMutableAttributedString are specified on the same CFStruct via different typedefs. // rdar://17238954 llvm-svn: 210660
* Refactoring. Remove Owned method from Sema.Nikola Smiljanic2014-05-291-62/+42
| | | | llvm-svn: 209812
* Refactoring. Remove release and take methods from ActionResult. Rename ↵Nikola Smiljanic2014-05-291-13/+13
| | | | | | takeAs to getAs. llvm-svn: 209800
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-81/+90
| | | | llvm-svn: 209613
* Objective-C ARC. Add support for toll-free bridge Fariborz Jahanian2014-05-101-0/+16
| | | | | | | type ,and bridge attribute, checking with static_cast. // rdar://16756639 llvm-svn: 208474
* Objective-C. Reduce false positive warnings with -Wselector by issuing warning Fariborz Jahanian2014-05-091-2/+3
| | | | | | | only when named selector is declared in TU and it is not declared in a system header. rdar://16600230 llvm-svn: 208443
* Objective-C. Improve diagnosis of bridging types.Fariborz Jahanian2014-04-291-41/+20
| | | | | | // rdar://16737117 llvm-svn: 207542
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-231-2/+3
| | | | | | symbols in non-imported modules. llvm-svn: 206977
* Objective-C ARC. Under ARC, addition of 'bridge' attributeFariborz Jahanian2014-04-221-6/+14
| | | | | | | | on CF type is not sufficient and bridge casting is still required for proper ownership semantics. // rdar://16650445 llvm-svn: 206910
* Objective-C. Patch to allow use of dot syntax on classFariborz Jahanian2014-04-211-8/+2
| | | | | | | objects to fund root class's instance methods. // rdar://16650575 llvm-svn: 206781
* Objective-C. Make multiple selector warningFariborz Jahanian2014-03-271-2/+2
| | | | | | | an opt-in option under -Wselector-type-mismatch. // rdar://16445728 llvm-svn: 204965
* Objective-C. Consider blocks for designated initializerFariborz Jahanian2014-03-171-6/+10
| | | | | | | | warnings (warning or lack there of) as well since blocks are another pattern for envoking other designated initializers. // rdar://16323233 llvm-svn: 204081
* [C++11] Replacing ObjCObjectPointerType iterators qual_begin() and ↵Aaron Ballman2014-03-171-6/+3
| | | | | | qual_end() with iterator_range quals(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204048
* [C++11] Replacing ObjCObjectType iterators qual_begin() and qual_end() with ↵Aaron Ballman2014-03-171-3/+2
| | | | | | iterator_range quals(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 204047
* Objective-C. Issue diagnostics on mismatched methods when their selector is usedFariborz Jahanian2014-03-121-1/+54
| | | | | | in an @selector expression. // rdar://15794055 llvm-svn: 203693
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-1/+1
| | | | | | class. llvm-svn: 203640
* Sema: When merging objc string literals, give the result a constant array type.Benjamin Kramer2014-02-251-4/+8
| | | | | | | | Also assert that we never create non-array string literals again. PR18939. llvm-svn: 202147
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-51/+45
| | | | | | | | | | | | | | | 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
* [objc] Refactor and improve functionality for the -Wunused-property-ivar ↵Argyrios Kyrtzidis2014-01-031-5/+7
| | | | | | | | | | | | | | warning. - Remove the additions to ObjCMethodDecl & ObjCIVarDecl that were getting de/serialized and consolidate all functionality for the checking for this warning in Sema::DiagnoseUnusedBackingIvarInAccessor - Don't check immediately after the method body is finished, check when the @implementation is finished. This is so we can see if the ivar was referenced by any other method, even if the method was defined after the accessor. - Don't silence the warning if any method is called from the accessor silence it if the accessor delegates to another method via self. rdar://15727325 llvm-svn: 198432
* Removing some more unnecessary manual quotes from attribute diagnostics.Aaron Ballman2014-01-031-1/+1
| | | | llvm-svn: 198391
* ObjectiveC. Remove false positive warning for missing propertyFariborz Jahanian2014-01-021-1/+3
| | | | | | | backing ivar by not issuing this warning if ivar is referenced somewhere and accessor makes method calls. // rdar://15727325 llvm-svn: 198367
* Support and use token kinds as diagnostic argumentsAlp Toker2013-12-241-1/+2
| | | | | | | | | | | | | | | | | | | Introduce proper facilities to render token spellings using the diagnostic formatter. Replaces most of the hard-coded diagnostic messages related to expected tokens, which all shared the same semantics but had to be multiply defined due to variations in token order or quote marks. The associated parser changes are largely mechanical but they expose commonality in whole chunks of the parser that can now be factored away. This commit uses C++11 typed enums along with a speculative legacy fallback until the transition is complete. Requires corresponding changes in LLVM r197895. llvm-svn: 197972
* Switched code from using hasAttr followed by getAttr to simply call getAttr ↵Aaron Ballman2013-12-191-2/+1
| | | | | | | | directly. No functional changes intended. llvm-svn: 197676
* Objective-C. After providing a fix-it for aFariborz Jahanian2013-12-181-7/+3
| | | | | | | | cstring, converted to NSString, produce the matching AST for it. This also required some refactoring of the previous code. // rdar://14106083 llvm-svn: 197605
* Objective-C. Make diagnostics and fix-its consistent Fariborz Jahanian2013-12-171-0/+11
| | | | | | | | when diagnosing casting of a cstring literal to NSString in default and -fobjc-arc mode. // rdar://14106083 llvm-svn: 197515
* ObjectiveC. Further improvements of useFariborz Jahanian2013-12-161-13/+25
| | | | | | | | | | of objc_bridge_related attribute; eliminate unnecessary diagnostics which is issued elsewhere, fixit now produces a valid AST tree per convention. This results in some simplification in handling of this attribute as well. // rdar://15499111 llvm-svn: 197436
* [objc] If we don't know for sure what the designated initializers of the ↵Argyrios Kyrtzidis2013-12-131-1/+4
| | | | | | | | | superclass are, assume that a [super init..] inside a designated initializer also refers to a designated one and do not warn. llvm-svn: 197202
* ObjectiveC. Provide a property-dot syntax for fixitFariborz Jahanian2013-12-101-8/+20
| | | | | | | when selector in objc_bridge_related attribute names a property. // rdar://15517899 llvm-svn: 196984
* Objective-C. Minor change to a diagnostic.Fariborz Jahanian2013-12-101-2/+2
| | | | | | // rdar://15499111 llvm-svn: 196977
* Improve on an objc_bridge_related diagnostic.Fariborz Jahanian2013-12-101-6/+6
| | | | | | // rdar://15499111 llvm-svn: 196950
* Objective-C. Provide fixit's for objc_bride_relatedFariborz Jahanian2013-12-101-5/+24
| | | | | | | attributed CF to ObjC type conversions. // rdar://15499111 llvm-svn: 196935
* Objective-C: Improve on various diagnostics related toFariborz Jahanian2013-12-091-69/+83
| | | | | | use of objc_bridge_related attribute. // rdar://15499111 llvm-svn: 196828
* ObjectiveC. Continuing implementation of objc_bridge_relatedFariborz Jahanian2013-12-071-0/+114
| | | | | | | | | attribute in sema and issuing a variety of diagnostics lazily for misuse of this attribute (and what to do) when converting from CF types to ObjectiveC types (and vice versa). // rdar://15499111 llvm-svn: 196629
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-051-1/+1
| | | | llvm-svn: 196510
* [objc] Emit warning when the implementation of a secondary initializer calls onArgyrios Kyrtzidis2013-12-031-0/+10
| | | | | | | | | | | super another initializer and when the implementation does not delegate to another initializer via a call on 'self'. A secondary initializer is an initializer method not marked as a designated initializer within a class that has at least one initializer marked as a designated initializer. llvm-svn: 196318
* [objc] Emit warnings when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-031-6/+25
| | | | | | | | calls on super an initializer that is not a designated one or any initializer on self. llvm-svn: 196317
* [objc] Emit a warning when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-031-0/+10
| | | | | | | | does not chain to an init method that is a designated initializer for the superclass. llvm-svn: 196316
* ObjectiveC. Implement attribute 'objc_bridge_mutable'Fariborz Jahanian2013-11-211-11/+20
| | | | | | | | whose semantic is currently identical to objc_bridge, but their differences may manifest down the road with further enhancements. // rdar://15498044 llvm-svn: 195376
* ObjectiveC. Allow toll free bridge cast warnings outsideFariborz Jahanian2013-11-211-9/+12
| | | | | | | ARC and in objectiveC/ObjectiveC++ MRR mode as well. // rdar://15454846 llvm-svn: 195288
* ObjectiveC ARC. warn in presense of __bridge casting to Fariborz Jahanian2013-11-201-0/+9
| | | | | | or from a toll free bridge cast. // rdar://15454846 llvm-svn: 195278
OpenPOWER on IntegriCloud