summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Support for objc use of property-dot syntax as receiverFariborz Jahanian2011-02-081-0/+4
| | | | | | | in liu of a class method getter. objc++ uses a different code path and is more involved (TBD). llvm-svn: 125061
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-3/+10
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* Capture a few implicit references to 'self'.John McCall2011-02-031-3/+37
| | | | llvm-svn: 124786
* Tweak diagnostic:Ted Kremenek2011-01-231-1/+2
| | | | | | | | | | | | | error: no super class declared in @interface for 'XXX' to be: error: 'X' cannot use 'super' because it is a root class The latter explains what the user actually did wrong. Fixes: <rdar://problem/8904409> llvm-svn: 124074
* Remove unused store to variable 'Name'. Found by clang static analyzer.Ted Kremenek2011-01-141-1/+0
| | | | llvm-svn: 123482
* Ensure that the result type of an Objective-C class message send isDouglas Gregor2011-01-111-5/+9
| | | | | | | complete. However, if it returns a reference type, don't require the type it refers to to be complete. Fixes <rdar://problem/8807070>. llvm-svn: 123214
* Complain on missing property getter method onlyFariborz Jahanian2010-12-221-4/+11
| | | | | | | if property-dot expression is decidedly an rvalue. // rdar://8155806. llvm-svn: 122430
* Warn when message is sent to receiver ofFariborz Jahanian2010-12-211-3/+5
| | | | | | | | unknown type and there is a possibility that at runtime method is resolved to a deprecated or unavailable method. Addreses // rdar://8769853 llvm-svn: 122294
* Improve diagnostics when property being looked upFariborz Jahanian2010-12-161-0/+6
| | | | | | in a forward @class object. // rdar://8774513 llvm-svn: 121933
* Keep the source location of the selector in ObjCMessageExpr.Argyrios Kyrtzidis2010-12-101-24/+27
| | | | llvm-svn: 121516
* Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall2010-12-041-0/+3
| | | | | | | | | | | | | | | | | | | not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890
* Diagnose when accessing property in a class method andFariborz Jahanian2010-12-031-2/+2
| | | | | | | no property accessor class method to be found, instead of crashing in IRGen. // rdar://8703553 llvm-svn: 120855
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-021-8/+11
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* When unknown method is sent to a receiver ofFariborz Jahanian2010-12-011-1/+3
| | | | | | | 'Class' type, disgnostic should refere to a class method. Fixes // rdar://8592156 llvm-svn: 120517
* Add an assertion, fix a whole bunch of bugs, comment the assertionJohn McCall2010-11-181-10/+21
| | | | | | out because there are still bugs left. llvm-svn: 119722
* Calculate the value kind of an expression when it's created andJohn McCall2010-11-181-21/+36
| | | | | | | | | | | | | store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. llvm-svn: 119685
* Introduce a null-to-pointer implicit cast kind.John McCall2010-11-131-2/+6
| | | | llvm-svn: 118966
* No really, we don't have a retain/release system for statements/expressionsJohn McCall2010-10-261-3/+1
| | | | | | anymore. llvm-svn: 117357
* This patch implements Next's IRGen for -fconstant-string-class=class-name.Fariborz Jahanian2010-10-191-1/+8
| | | | | | PR6056, //rdar: //8564463 llvm-svn: 116819
* When performing typo correction, look through the set of knownDouglas Gregor2010-10-141-5/+7
| | | | | | | | | | | | | | | | | | | | identifiers to determine good typo-correction candidates. Once we've identified those candidates, we perform name lookup on each of them and the consider the results. This optimization makes typo correction > 2x faster on a benchmark example using a single typo (NSstring) in a tiny file that includes Cocoa.h from a precompiled header, since we are deserializing far less information now during typo correction. There is a semantic change here, which is interesting. The presence of a similarly-named entity that is not visible can now affect typo correction. This is both good (you won't get weird corrections if the thing you wanted isn't in scope) and bad (you won't get good corrections if there is a similarly-named-but-completely-unrelated thing). Time will tell whether it was a good choice or not. llvm-svn: 116528
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-11/+31
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Patch implements passing arrays to functions expectingFariborz Jahanian2010-09-241-1/+2
| | | | | | vla. Implements pr7827. llvm-svn: 114737
* Implement automatic bracket insertion for Objective-C class messageDouglas Gregor2010-09-161-1/+1
| | | | | | | | | | | | | | | | sends. These are far trickier than instance messages, because we typically have something like NSArray alloc] where it appears to be a declaration of a variable named "alloc" up until we see the ']' (or a ':'), and at that point we can't backtrace. So, we use a combination of syntactic and semantic disambiguation to treat this as a message send only when the type is an Objective-C type and it has the syntax of a class message send (which would otherwise be ill-formed). llvm-svn: 114057
* Handle bracket insertion for Objective-C class messages in a veryDouglas Gregor2010-09-151-6/+6
| | | | | | | | | | | narrow, almost useless case where we're inside a parenthesized expression, e.g., (NSArray alloc]) The solution to the general case still eludes me. llvm-svn: 114039
* Implement bracket insertion for Objective-C instance message sends asDouglas Gregor2010-09-151-19/+30
| | | | | | | | | | | | | | | | | | | | | | | part of parser recovery. For example, given: a method1:arg]; we detect after parsing the expression "a" that we have the start of a message send expression. We pretend we've seen a '[' prior to the a, then parse the remainder as a message send. We'll then give a diagnostic+fix-it such as: fixit-objc-message.m:17:3: error: missing '[' at start of message send expression a method1:arg]; ^ [ The algorithm here is very simple, and always assumes that the open bracket goes at the beginning of the message send. It also only works for non-super instance message sends at this time. llvm-svn: 113968
* One who seeks knowledge learns something new every day.John McCall2010-08-261-18/+18
| | | | | | | | | One who seeks the Tao unlearns something new every day. Less and less remains until you arrive at non-action. When you arrive at non-action, nothing will be left undone. llvm-svn: 112244
* Split out a header to hold APIs meant for the Sema implementation from Sema.h.John McCall2010-08-251-1/+1
| | | | | | | Clients of Sema don't need to know (for example) the list of diagnostics we support. llvm-svn: 112093
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-2/+2
| | | | | | to the new constants. llvm-svn: 112047
* More header elimination. The goal of all this is to allow Parser toJohn McCall2010-08-241-0/+1
| | | | | | | #include Sema.h while keeping all the AST declarations opaque. That may not be reasonably attainable, though. llvm-svn: 111907
* OwningExprResult -> ExprResult. This patch brought to you byJohn McCall2010-08-241-14/+14
| | | | | | | M-x query-replace-regexp \(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result llvm-svn: 111903
* Abstract out passing around types and kill off ActionBase.John McCall2010-08-241-6/+6
| | | | llvm-svn: 111901
* Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).John McCall2010-08-231-7/+5
| | | | llvm-svn: 111863
* Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()Benjamin Kramer2010-08-171-2/+2
| | | | | | and remove getStrData(). Patch by Peter Davies (with some tweaks). llvm-svn: 111229
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-121-3/+3
| | | | llvm-svn: 110945
* Fix a spurious warning when message sent to qualified-idFariborz Jahanian2010-08-101-2/+1
| | | | | | type receiver (pr7861). llvm-svn: 110696
* Implements gcc's -Wstrict-selector-match.Fariborz Jahanian2010-08-091-7/+13
| | | | | | (radar 8127244). llvm-svn: 110622
* Simplify global method pool implementation in Sema. No functionality change.Sebastian Redl2010-08-021-1/+1
| | | | llvm-svn: 110078
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-7/+1
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Vectors are not integer types, so the type system should not classifyDouglas Gregor2010-07-231-3/+2
| | | | | | | | | | | them as such. Type::is(Signed|Unsigned|)IntegerType() now return false for vector types, and new functions has(Signed|Unsigned|)IntegerRepresentation() cover integer types and vector-of-integer types. This fixes a bunch of latent bugs. Patch from Anton Yartsev! llvm-svn: 109229
* atch for implementation of objective-c's -WselectorFariborz Jahanian2010-07-221-0/+5
| | | | | | | warning flag in clang. Little more to do for a PCH issue. Radar 6507158. llvm-svn: 109129
* When forming a function call or message send expression, be sure toDouglas Gregor2010-07-131-4/+4
| | | | | | | | | | | | | | | | | strip cv-qualifiers from the expression's type when the language calls for it: in C, that's all the time, while C++ only does it for non-class types. Centralized the computation of the call expression type in QualType::getCallResultType() and some helper functions in other nodes (FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant callers of getResultType() to getCallResultType(). Fixes PR7598 and PR7463, along with a bunch of getResultType() call sites that weren't stripping references off the result type (nothing stripped cv-qualifiers properly before this change). llvm-svn: 108234
* C return types must be complete as well.Fariborz Jahanian2010-06-161-5/+6
| | | | | | | Moved check before we build the ObjCMessageExpr node. (PR7386 related). llvm-svn: 106139
* Make sure result type of objc++ message expression isFariborz Jahanian2010-06-161-0/+5
| | | | | | | complete before attempting to bind it to a temporary. Fixes PR7386. llvm-svn: 106130
* Improve our handling of reference binding for subobjects ofDouglas Gregor2010-05-221-15/+19
| | | | | | | | | | | | | | | | | | | | | | | | | temporaries. There are actually several interrelated fixes here: - When converting an object to a base class, it's only an lvalue cast when the original object was an lvalue and we aren't casting pointer-to-derived to pointer-to-base. Previously, we were misclassifying derived-to-base casts of class rvalues as lvalues, causing various oddities (including problems with reference binding not extending the lifetimes of some temporaries). - Teach the code for emitting a reference binding how to look through no-op casts and parentheses directly, since Expr::IgnoreParenNoOpCasts is just plain wrong for this. Also, make sure that we properly look through multiple levels of indirection from the temporary object, but destroy the actual temporary object; this fixes the reference-binding issue mentioned above. - Teach Objective-C message sends to bind the result as a temporary when needed. This is actually John's change, but it triggered the reference-binding problem above, so it's included here. Now John can actually test his return-slot improvements. llvm-svn: 104434
* Renamed misleading getSourceRange -> getLocalSourceRange and ↵Abramo Bagnara2010-05-201-1/+1
| | | | | | getFullSourceRange -> getSourceRange for TypeLoc. llvm-svn: 104220
* fix rdar://7985267 - Don't emit an error about a non-pod argumentChris Lattner2010-05-161-1/+1
| | | | | | passed to va_start, it doesn't actually pass it. llvm-svn: 103899
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-151-4/+2
| | | | | | | | | | | | | | | | | | | | | ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
* Objective-C++ Sema. Fix a bug in instantiation of receivers.Fariborz Jahanian2010-05-131-1/+6
| | | | | | Completes radar 7963410. llvm-svn: 103719
* Objective-C++ Sema. Support for conversion of a C++Fariborz Jahanian2010-05-121-0/+10
| | | | | | | class object used as a receiver to an objective-c pointer via a converwsion function. wip. llvm-svn: 103672
* With -fno-constant-cfstrrings, class NSConstantStringFariborz Jahanian2010-04-231-0/+15
| | | | | | must be there or it is error (Next runtime). llvm-svn: 102223
OpenPOWER on IntegriCloud