summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't ICE when messaging on 'super' receiver when classFariborz Jahanian2009-01-071-3/+6
| | | | | | of category implementation is undeclared. Issue error instead. llvm-svn: 61882
* Silence a couple more operator precedence warnings; this shouldn't Eli Friedman2008-12-161-2/+2
| | | | | | | change the semantics. Please correct this if the precedence was actually supposed to be something different. llvm-svn: 61099
* Change a whole lot of diagnostics to take QualType's directly Chris Lattner2008-11-241-1/+1
| | | | | | | | instead of converting them to strings first. This also fixes a bunch of minor inconsistencies in the diagnostics emitted by clang and adds a bunch of FIXME's to DiagnosticKinds.def. llvm-svn: 59948
* Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of Chris Lattner2008-11-241-1/+1
| | | | | | | | | | | uses of getName() with uses of getDeclName(). This upgrades a bunch of diags to take DeclNames instead of std::strings. This also tweaks a couple of diagnostics to be cleaner and changes CheckInitializerTypes/PerformInitializationByConstructor to pass around DeclarationNames instead of std::strings. llvm-svn: 59947
* Rename Selector::getName() to Selector::getAsString(), and addChris Lattner2008-11-241-12/+14
| | | | | | | | | | | | | a new NamedDecl::getAsString() method. Change uses of Selector::getName() to just pass in a Selector where possible (e.g. to diagnostics) instead of going through an std::string. This also adds new formatters for objcinstance and objcclass as described in the dox. llvm-svn: 59933
* Convert IdentifierInfo's to be printed the same as DeclarationNames Chris Lattner2008-11-231-2/+1
| | | | | | | | | | | | | | | | | | | | | with implicit quotes around them. This has a bunch of follow-on effects and requires tweaking to a whole lot of code. This causes a regression in two tests (xfailed) by causing it to emit things like: Line 10: duplicate interface declaration for category 'MyClass1' ('Category1') instead of: Line 10: duplicate interface declaration for category 'MyClass1(Category1)' I will fix this in a follow-up commit. As part of this, I had to start switching stuff to use ->getDeclName() instead of Decl::getName() for consistency. This is good, but I was planning to do this as an independent patch. There will be several follow-on patches to clean up some of the mess, but this patch is already too big. llvm-svn: 59917
* merge some simple call diagnostics.Chris Lattner2008-11-211-1/+1
| | | | llvm-svn: 59831
* remove the last old-fashioned Diag method. Transition complete!Chris Lattner2008-11-201-4/+4
| | | | llvm-svn: 59714
* instead of looking up super at startup time, Chris Lattner2008-11-201-1/+1
| | | | | | | just check for it when needed. It doesn't incur real cost in any hot paths. llvm-svn: 59708
* Fix <rdar://problem/6150376> [sema] crash on invalid message send.Steve Naroff2008-11-191-17/+34
| | | | | | The core fix in Sema::ActOnClassMessage(). All the other changes have to do with passing down the SourceLocation for the receiver (to properly position the cursor when producing an error diagnostic). llvm-svn: 59639
* stop calling II::getName() unnecesarily in semaChris Lattner2008-11-191-1/+1
| | | | llvm-svn: 59609
* Switch several more Sema Diag methods over. This simplifies theChris Lattner2008-11-191-17/+15
| | | | | | | | __builtin_prefetch code to only emit one diagnostic per builtin_prefetch. While this has nothing to do with the rest of the patch, the code seemed like overkill when I was updating it. llvm-svn: 59588
* Fix <rdar://problem/6333904> [sema] message lookup on super is incorrectSteve Naroff2008-11-171-1/+17
| | | | | | Missing special lookup rule in Sema::ActOnInstanceMessage(). llvm-svn: 59467
* Add a new expression class, ObjCSuperExpr, to handle the Objective-C ↵Douglas Gregor2008-11-041-2/+1
| | | | | | 'super'. Remove ObjCThis from PredefinedExpr llvm-svn: 58698
* Fix <rdar://problem/6191148> [sema] Objective-C method lookup (at global ↵Steve Naroff2008-09-301-6/+9
| | | | | | | | scope) fails to handle overloaded selectors properly. Long standing bug in Sema::ActOnInstanceMessage(). We now warn when messaging an "id" with multiple method signatures in scope. The diags are a little verbose, however they can be streamlined if necessary. llvm-svn: 56843
* Fix <rdar://problem/6251012> clang: Blocks are objects too.Steve Naroff2008-09-291-1/+2
| | | | llvm-svn: 56791
* Fix <rdar://problem/6252129> implementation of method in category doesn't ↵Steve Naroff2008-09-281-0/+8
| | | | | | effectively declare it for methods below. llvm-svn: 56771
* Fix two bugs exposed by array passing assert:Daniel Dunbar2008-09-111-8/+26
| | | | | | | | | (1) Additional arguments to variadic methods should have default promotions applied. (2) Additional arguments to non-variadic methods were allowed. llvm-svn: 56084
* Bug fix, apply default argument promotion in message sends for whichDaniel Dunbar2008-09-111-0/+4
| | | | | | | | | no method declaration was found. - This was allowing arrays to pass "by value" among other things. Add assert in CodeGen that arguments cannot have array type. llvm-svn: 56080
* Refactor common Obj-C message send checking code intoDaniel Dunbar2008-09-111-45/+27
| | | | | | | CheckMessageArgumentTypes. - No functionality change. llvm-svn: 56079
* Change Parser & Sema to use interned "super" for comparions.Daniel Dunbar2008-08-141-1/+1
| | | | | | | | | | | | | | - Added as private members for each because it is not clear where to put the common definition. Perhaps the IdentifierInfos all of these "pseudo-keywords" should be collected into one place (this would KnownFunctionIDs and Objective-C property IDs, for example). Remove Token::isNamedIdentifier. - There isn't a good reason to use strcmp when we have interned strings, and there isn't a good reason to encourage clients to do so. llvm-svn: 54794
* Minor #include cleaningDaniel Dunbar2008-08-111-0/+1
| | | | | | | - Drop TokenKinds.h from Action.h - Move DeclSpec.h from Sema.h into individual Sema .cpp files llvm-svn: 54625
* rename PreDefinedExpr -> PredefinedExprChris Lattner2008-08-101-2/+2
| | | | llvm-svn: 54605
* change more instances of QualType::getCanonicalType to callChris Lattner2008-07-261-9/+9
| | | | | | ASTContext::getCanonicalType instead (PR2189) llvm-svn: 54105
* Cleaunup Sema::ActOnClassMessage(). This commit:Steve Naroff2008-07-251-15/+24
| | | | | | | (a) removes a bogus warning. (b) removes an undesirable usage of the ObjCMessageExpr constructor that takes an IdentifierInfo * (which I will abolish). llvm-svn: 54042
* Fix Sema::ActOnClassMessage() to pass through the identifier for "super". Steve Naroff2008-07-241-3/+9
| | | | | | | | This fixes a critical rewriter bug (<rdar://problem/6096760> clang ObjC rewriter: 'self' not expected value in class method called with 'super'). Also added a couple FIXME's since I'm not happy with my fix to Sema. It would be nicer if the super handling for class/instance messages was the same (based on PreDefinedExpr). llvm-svn: 53994
* move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,Chris Lattner2008-07-211-7/+6
| | | | | | simplifying code along the way and fixing a problem and memory leak or two. llvm-svn: 53876
* introduce a new ObjCList templated class and start moving Chris Lattner2008-07-211-6/+8
| | | | | | | various objc lists over to it. First up, the protocol list on ObjCInterfaceDecl. llvm-svn: 53856
* when in the context of an @implementation, look for private methods in theChris Lattner2008-07-211-3/+2
| | | | | | @implementation to resolve nullary selector references. llvm-svn: 53845
* don't pass in null as the Name for GenerateClassStructure,Chris Lattner2008-07-211-2/+1
| | | | | | | it goes and makes std::strings out of them, which is not defined. llvm-svn: 53843
* improve diagnostics about problems with receivers to highlight the receiver.Chris Lattner2008-07-211-3/+3
| | | | llvm-svn: 53842
* continue cleaning up code, and disable sending a message directly to anChris Lattner2008-07-211-18/+14
| | | | | | | | | | | | interface. This fixes a bug where we used to accept: void test2(NSNumber x) { [x METH]; } which doesn't make sense and GCC rejects. llvm-svn: 53841
* simplify control flow a bit, reducing indentation. No functionality change.Chris Lattner2008-07-211-70/+79
| | | | llvm-svn: 53837
* tighten up some checks, don't allow sending a message to NSString****Chris Lattner2008-07-211-5/+6
| | | | llvm-svn: 53836
* merge a bunch of code that is now common between qual interfaces and interfaces.Chris Lattner2008-07-211-24/+22
| | | | llvm-svn: 53833
* rename getProtocols -> getProtocol, as it only returns a singleChris Lattner2008-07-211-1/+1
| | | | | | | protocol. Simplify some code to use unconditional form of the protocol access list. llvm-svn: 53832
* Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() ↵Argyrios Kyrtzidis2008-06-281-6/+6
| | | | | | and getCurMethodDecl() that return the appropriate Decl through CurContext. llvm-svn: 52852
* ObjCMessageExpr objects that represent messages to class methods now can ↵Ted Kremenek2008-06-241-2/+10
| | | | | | contain the ObjCInterfaceDecl* of the target class if it was available when the ObjCMessageExpr object was constructed. The original interfaces of the class has been preserved (requiring no functionality changes from clients), but now a "getClasSInfo" method returns both the ObjCInterfaceDecl* and IdentifierInfo* of the target class. llvm-svn: 52676
* "this patch adds code generation hooks for Objective-C constant strings. It ↵Chris Lattner2008-06-211-8/+12
| | | | | | | | also modifies Sema so that Objective-C constant strings are treated as untyped objects if the interface for the constant string class can not be found. This is consistent with Apple GCC. I thought it was consistent with GNU GCC, since this was causing failures when trying to compile GNUstep with (GNU) GCC, but it appears that this is not the case when attempting to produce a simple test case to demonstrate it. Possibly there is a way of making the error go away, but I haven't found out what it is yet." Patch by David Chisnall! llvm-svn: 52599
* Switch 'super' from being a weird cast thing to being a predefined expr node.Chris Lattner2008-06-211-6/+2
| | | | | | Patch by David Chisnall with objc rewriter and stmtdumper updates from me. llvm-svn: 52580
* Fix <rdar://problem/5986833> clang on xcode: incompatible type returning ↵Steve Naroff2008-06-051-2/+24
| | | | | | | | | 'void', expected 'int'. - Changed Sema::ObjCActOnStartOfMethodDef() to more accurately type "self" in factory methods. - Changed Sema::ActOnInstanceMessage() to use the new type to restrict the lookup. llvm-svn: 52005
* Fix crash identified by <rdar://problem/5986085>.Steve Naroff2008-06-041-11/+23
| | | | llvm-svn: 51969
* Added fixmes.Ted Kremenek2008-06-041-0/+2
| | | | llvm-svn: 51964
* Fix a gcc compatibility issue which allows more protocol-qualified id on RHS ↵Fariborz Jahanian2008-06-041-3/+12
| | | | | | | | to be assigned to less protocol qualified object on LHS. llvm-svn: 51956
* Sema::ActOnClassMessage() needs to look through it's local implementation ↵Steve Naroff2008-06-041-0/+6
| | | | | | for private class methods. llvm-svn: 51938
* Tweak Sema::ObjCQualifiedIdTypesAreCompatible() to handle qualified ↵Steve Naroff2008-06-011-5/+24
| | | | | | | | | | interface types on the RHS. This eliminates a bogus warning identified in the test below. This fixes <rdar://problem/5968256> clang on xcode: error: incompatible type initializing 'NSObject<XCSelectionSource> *', expected 'id<NSObject,XCSelectionSource>' llvm-svn: 51832
* Fix <rdar://problem/5965704> clang: bad receiver type 'id const'Steve Naroff2008-05-311-2/+3
| | | | llvm-svn: 51809
* - Move ObjC Expresssion AST's from Expr.h => ExprObjC.hSteve Naroff2008-05-291-1/+1
| | | | | | - #include ExprObjC.h in many places llvm-svn: 51703
* Restructure and simplify Sema::ObjCQualifiedIdTypesAreCompatible,Chris Lattner2008-04-201-65/+64
| | | | | | | | | | deleting dead code, making other code more obvious, and fixing a bug. This fixes these (bogus) warnings in release mode: SemaExprObjC.cpp:383: warning: 'RHSProtoE' may be used uninitialized in this function SemaExprObjC.cpp:383: warning: 'RHSProtoI' may be used uninitialized in this function llvm-svn: 49984
* move ObjCQualifiedIdTypesAreCompatible out of ASTContext into Sema.Chris Lattner2008-04-071-0/+167
| | | | | | | | | | While it is similar to the other compatibility predicates in ASTContext, it is not used by them and is different. In addition, greatly simplify ObjCQualifiedIdTypesAreCompatible and fix some canonical type bugs. Also, simplify my Type::getAsObjC* methods. llvm-svn: 49313
OpenPOWER on IntegriCloud