summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaPseudoObject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Objective-C. Prevents a crash generating AST for aFariborz Jahanian2014-09-151-0/+4
| | | | | | | | | | a property assignment due to numerous user errors. Cannot come up with a reasonable test case due to array of user errors before the crash point. rdar://17813651. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217825 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Accept 'nil' as indexing argument toFariborz Jahanian2014-09-101-1/+2
| | | | | | | | dictionary literals since the API which implements them accepts it too. // rdar://18254621 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217543 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some cases where StringRef was being passed by const reference. Remove ↵Craig Topper2014-08-301-1/+1
| | | | | | const from some other StringRefs since its implicitly const already. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216825 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash when accessing a property of an invalid interfaceOlivier Goffart2014-08-041-12/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214735 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash when assiging to a property with an invalid typeOlivier Goffart2014-08-041-1/+6
| | | | | | | | | | This is a regression from clang 3.4 Set the result to ExprError and returns true, rather than simply returns false because errors have been reported already and returning false show a confusing error git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214734 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch over a few uses of param_begin() to parameters()Alp Toker2014-07-071-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212442 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C ARC. Do not warn about properties with bothFariborz Jahanian2014-06-171-7/+14
| | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211132 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Diagnose when property access is using declaredFariborz Jahanian2014-06-161-1/+4
| | | | | | | | property accessor methods which have become deprecated or available. // rdar://15951801 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211039 91177308-0d34-0410-b5e6-96231b3b80d8
* Hide the concept of diagnostic levels from lex, parse and semaAlp Toker2014-06-151-6/+3
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211005 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Don't ignore availability attribute whenFariborz Jahanian2014-06-101-1/+4
| | | | | | | | doing Objective-C subscript access. // rdar://16842487 PR19682. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210565 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid dubious IdentifierInfo::getNameStart() usesAlp Toker2014-06-071-4/+2
| | | | | | | | These cases in particular were incurring an extra strlen() when we already knew the length. They appear to be leftovers from when the interfaces worked with C strings that have continued to compile due to the implicit StringRef ctor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210403 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactoring. Remove release and take methods from ActionResult. Rename ↵Nikola Smiljanic2014-05-291-15/+15
| | | | | | takeAs to getAs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209800 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Diagnose use of properties in functions nested in, Fariborz Jahanian2014-05-281-0/+20
| | | | | | | | now deprecated, ObjC containers instead of crashing. // rdar://16859666 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209758 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-18/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209613 91177308-0d34-0410-b5e6-96231b3b80d8
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-101-0/+1
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208470 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C. Patch to allow use of dot syntax on classFariborz Jahanian2014-04-211-2/+4
| | | | | | | | objects to fund root class's instance methods. // rdar://16650575 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206781 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-12/+12
| | | | | | class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203640 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C properties. Fixes a crash in Sema where RHS ofFariborz Jahanian2014-03-061-4/+7
| | | | | | | | the property assignment is an lvalue for an incomplete type. // rdar://15118128. Reviewed offline by John McCall. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203043 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-14/+11
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200082 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing some more unnecessary manual quotes from diagnostics.Aaron Ballman2014-01-031-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198418 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing some more unnecessary manual quotes from attribute diagnostics.Aaron Ballman2014-01-031-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198387 91177308-0d34-0410-b5e6-96231b3b80d8
* s/getter_setter/accessor No functional changes intended.Aaron Ballman2013-12-261-4/+4
| | | | | | Thanks to Alp Toker for the naming suggestion! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198052 91177308-0d34-0410-b5e6-96231b3b80d8
* Parameterizing some MS property-related diagnostics. No functional changes ↵Aaron Ballman2013-12-261-6/+8
| | | | | | intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198049 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a whole lot of unused variablesAlp Toker2013-11-271-2/+0
| | | | | | | There are about 30 removed in this patch, generated by a new FixIt I haven't got round to submitting yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195814 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC++: support for passing C++11 style initialized temporaries to Fariborz Jahanian2013-10-161-0/+10
| | | | | | | | objc++ properties using property-dot syntax. // rdar://14654207 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192819 91177308-0d34-0410-b5e6-96231b3b80d8
* Make IgnoreParens() look through ChooseExprs.Eli Friedman2013-07-201-0/+19
| | | | | | | | | | | | | This is the same way GenericSelectionExpr works, and it's generally a more consistent approach. A large part of this patch is devoted to caching the value of the condition of a ChooseExpr; it's needed to avoid threading an ASTContext into IgnoreParens(). Fixes <rdar://problem/14438917>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186738 91177308-0d34-0410-b5e6-96231b3b80d8
* address some comments on r183474:Adrian Prantl2013-06-071-3/+3
| | | | | | | | | | - factor the name construction part out from constructSetterName - rename constructSetterName to the more appropriate constructSetterSelector no functionality change intended. rdar://problem/14035789 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183582 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C arc: don't count use of __weakFariborz Jahanian2013-05-211-2/+2
| | | | | | | | variables when they are used in such unevaluated contexts as __typeof, etc. // rdar://13942025 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182423 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace 'MultiExprArg()' with 'None'Dmitri Gribenko2013-05-051-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181166 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef ↵Dmitri Gribenko2013-05-051-3/+2
| | | | | | | | | constructor from None Patch by Robert Wilhelm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181139 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't put too much thought into whether or not to capture aJohn McCall2013-04-161-1/+2
| | | | | | | | | type-dependent intermediate result in a postfix ++ pseudo- object operation. Test case by Tong Shen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179637 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic support for Microsoft property declarations andJohn McCall2013-04-161-0/+116
| | | | | | | | references thereto. Patch by Tong Shen! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179585 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 178663 back.Rafael Espindola2013-04-031-3/+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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178682 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 178663.Rafael Espindola2013-04-031-0/+3
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178681 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-3/+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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178663 91177308-0d34-0410-b5e6-96231b3b80d8
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-081-1/+3
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174768 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-2/+2
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash-on-invalid. <rdar://problem/12765391>.Eli Friedman2012-11-291-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168851 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't return a pointer to an UnresolvedSetImpl in the CXXRecordDecl interface,Argyrios Kyrtzidis2012-11-281-5/+4
| | | | | | expose only the iterators instead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168770 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to save the assigned value in a Objective-C property assignmentEli Friedman2012-11-131-7/+15
| | | | | | | | | | | if the type of the value is a non-trivial class type. Fixes PR14318. (There's a minor ObjC++ language change here: given that we can't save the value, the type of the assignment expression is void in such cases.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167884 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.Jordan Rose2012-10-101-3/+3
| | | | | | | | | | | | | 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'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165626 91177308-0d34-0410-b5e6-96231b3b80d8
* Add FP_CONTRACT support for clang.Lang Hames2012-10-021-5/+5
| | | | | | | | | | Clang will now honor the FP_CONTRACT pragma and emit LLVM fmuladd intrinsics for expressions of the form A * B + C (when they occur in a single statement). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164989 91177308-0d34-0410-b5e6-96231b3b80d8
* -Warc-repeated-use-of-weak: check ivars and variables as well.Jordan Rose2012-09-281-1/+2
| | | | | | | | | | Like properties, loading from a weak ivar twice in the same function can give you inconsistent results if the object is deallocated between the two loads. It is safer to assign to a strong local variable and use that. Second half of <rdar://problem/12280249>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164855 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a warning (off by default) for repeated use of the same weak property.Jordan Rose2012-09-281-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivating example: if (self.weakProp) use(self.weakProp); As with any non-atomic test-then-use, it is possible a weak property to be non-nil at the 'if', but be deallocated by the time it is used. The correct way to write this example is as follows: id tmp = self.weakProp; if (tmp) use(tmp); The warning is controlled by -Warc-repeated-use-of-receiver, and uses the property name and base to determine if the same property on the same object is being accessed multiple times. In cases where the base is more complicated than just a single Decl (e.g. 'foo.bar.weakProp'), it picks a Decl for some degree of uniquing and reports the problem under a subflag, -Warc-maybe-repeated-use-of-receiver. This gives a way to tune the aggressiveness of the warning for a particular project. The warning is not on by default because it is not flow-sensitive and thus may have a higher-than-acceptable rate of false positives, though it is less noisy than -Wreceiver-is-weak. On the other hand, it will not warn about some cases that may be legitimate issues that -Wreceiver-is-weak will catch, and it does not attempt to reason about methods returning weak values. Even though this is not a real "analysis-based" check I've put the bug emission code in AnalysisBasedWarnings for two reasons: (1) to run on every kind of code body (function, method, block, or lambda), and (2) to suggest that it may be enhanced by flow-sensitive analysis in the future. The second (smaller) half of this work is to extend it to weak locals and weak ivars. This should use most of the same infrastructure. Part of <rdar://problem/12280249> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164854 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a couple of Doxygen issues pointed out by -Wdocumentation.Dmitri Gribenko2012-09-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163722 91177308-0d34-0410-b5e6-96231b3b80d8
* Push ArrayRef through the Expr hierarchy.Benjamin Kramer2012-08-241-3/+2
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162552 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of -Wdocumentation warnings.Dmitri Gribenko2012-08-231-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162452 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-c arc: Patch to suggest bridge casting of CFFariborz Jahanian2012-08-021-2/+31
| | | | | | | | objects used as dictionary subscript objects. // rdar://11913153 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161187 91177308-0d34-0410-b5e6-96231b3b80d8
* Change warning to error when property setter names conflict.Fariborz Jahanian2012-05-261-1/+1
| | | | | | | // rdar://11528439 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157517 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-c: warn on use of property settersFariborz Jahanian2012-05-241-3/+21
| | | | | | | | | backing two propeties because proprty names match except for first letter being of different case. // rdar://11528439, [PR12936]. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157435 91177308-0d34-0410-b5e6-96231b3b80d8