summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve the 'cannot pass objc interface by value' diagnostic:Chris Lattner2009-04-111-18/+17
| | | | | | | | | | | | | | | | | | 1) improve localizability by not passing english strings in. 2) improve location for arguments. 3) print the objc type being passed. Before: method-bad-param.m:15:1: error: Objective-C type cannot be passed by value -(void) my_method:(foo) my_param ^ after: method-bad-param.m:15:25: error: Objective-C interface type 'foo' cannot be passed by value -(void) my_method:(foo) my_param ^ llvm-svn: 68872
* change the interface to ActOnMethodDeclaration to pass down argumentChris Lattner2009-04-111-11/+15
| | | | | | | information in a little struct instead of individually. While we're at it, add per-argument loc info and attribute info. llvm-svn: 68871
* simplify this code to not bother stripping to canonical types, andChris Lattner2009-04-111-15/+12
| | | | | | indent code properly llvm-svn: 68866
* Fix another fallout from defining __weak unconditionally.Fariborz Jahanian2009-04-101-1/+2
| | | | llvm-svn: 68834
* Use getDeclName() instead of getIdentifier() (safe against null pointers)Ted Kremenek2009-04-101-1/+1
| | | | llvm-svn: 68804
* Propagate the ASTContext to various AST traversal and lookup functions.Douglas Gregor2009-04-091-58/+66
| | | | | | No functionality change (really). llvm-svn: 68726
* Now that we have __weak defined as attribute in all modes,Fariborz Jahanian2009-04-071-1/+2
| | | | | | we must not issue gc-specific errors in non-gc mode. llvm-svn: 68551
* Warn instead of error on duplicate protocol definitions.Fariborz Jahanian2009-04-061-2/+1
| | | | | | | Be kind to so many projects which are doing this (and be like gcc). llvm-svn: 68474
* Fixed visibility issues related to objc2's synthesizedFariborz Jahanian2009-04-061-1/+1
| | | | | | ivars. llvm-svn: 68453
* writable property in a category of class's superclassFariborz Jahanian2009-04-061-0/+3
| | | | | | | makes the property writable in the current class. llvm-svn: 68446
* Real corener case of a method declared in a protocolFariborz Jahanian2009-04-031-2/+9
| | | | | | | | used in a class which declares a property of the same name. This should not result in an unimplemented method warning. llvm-svn: 68409
* Fix up lookup rules for properties declared inFariborz Jahanian2009-04-021-24/+37
| | | | | | objc's continuation class. llvm-svn: 68339
* Fix a bug in declaration of property in continuationFariborz Jahanian2009-04-011-14/+14
| | | | | | | class which was exposed by implementation of objc2's nonfragile abi code gen. llvm-svn: 68259
* fe support for objc2's nonfragile-abi synthesized ivars.Fariborz Jahanian2009-03-311-6/+11
| | | | llvm-svn: 68077
* Push DeclGroup much farther throughout the compiler. Now the variousChris Lattner2009-03-291-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | productions (except the already broken ObjC cases like @class X,Y;) in the parser that can produce more than one Decl return a DeclGroup instead of a Decl, etc. This allows elimination of the Decl::NextDeclarator field, and exposes various clients that should look at all decls in a group, but which were only looking at one (such as the dumper, printer, etc). These have been fixed. Still TODO: 1) there are some FIXME's in the code about potentially using DeclGroup for better location info. 2) ParseObjCAtDirectives should return a DeclGroup due to @class etc. 3) I'm not sure what is going on with StmtIterator.cpp, or if it can be radically simplified now. 4) I put a truly horrible hack in ParseTemplate.cpp. I plan to bring up #3/4 on the mailing list, but don't plan to tackle #1/2 in the short term. llvm-svn: 68002
* tighten this up, the decl *must* be a declcontext, no need for the dynamic ↵Chris Lattner2009-03-291-1/+1
| | | | | | check. llvm-svn: 67978
* Introduce a new OpaquePtr<N> struct type, which is a simple POD wrapper for aChris Lattner2009-03-281-134/+128
| | | | | | | | | | | | | | | | | | | | pointer. Its purpose in life is to be a glorified void*, but which does not implicitly convert to void* or other OpaquePtr's with a different UID. Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>. Change the entire parser/sema interface to use DeclPtrTy instead of DeclTy*. This makes the C++ compiler enforce that these aren't convertible to other opaque types. We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc, but I don't plan to do that in the short term. The one outstanding known problem with this patch is that we lose the bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to bitmangle the success bit into the low bit of DeclPtrTy. I will rectify this with a subsequent patch. llvm-svn: 67952
* Issue error if variables are defined inside an objc class,Fariborz Jahanian2009-03-211-8/+10
| | | | | | category or protocol. llvm-svn: 67450
* objc: Implemented variables declared in class interface Fariborz Jahanian2009-03-181-1/+12
| | | | | | whose sema decl is at the translation unit. llvm-svn: 67249
* Make Selector::getIdentifierInfo() private. I took a first attempt at this lastTed Kremenek2009-03-141-2/+2
| | | | | | | | | | | | | week in: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090302/013580.html That patch caused the output of the diagnostics to change. Since 'DeclarationName' can already reason about Selectors and the Diagnostics logic reasons about DeclarationName, there is no additional code needed to get the diagnostics working by making Selector::getIdentifierInfo() private. llvm-svn: 66992
* Remove ActiveScope (revert ↵Steve Naroff2009-03-131-2/+0
| | | | | | | | http://llvm.org/viewvc/llvm-project?view=rev&revision=65694 and http://llvm.org/viewvc/llvm-project?view=rev&revision=66741). Will replace with something better today... llvm-svn: 66893
* Revert my last couple patches until I can get them to not make the tests fail.Ted Kremenek2009-03-071-2/+2
| | | | llvm-svn: 66317
* Teach Diagnostic about Selector.Ted Kremenek2009-03-071-2/+2
| | | | llvm-svn: 66314
* Selector: (changes made after discussing this more with Steve Naroff)Ted Kremenek2009-03-071-2/+2
| | | | | | | | | | | - Make Selector::getAsIdentifierInfo() private. Using IdentifierInfo* in Selector is an implementation detail that clients shouldn't think about. - Modify diagnostic emission in Sema::ProcessPropertyDecl to not use Selector::getAsIdentifierInfo() (which could crash when IdentifierInfo* is null) and instead use Selector::getAsString(). - Tidy up Selector::getAsString() implementation. llvm-svn: 66313
* Tweak diag for <rdar://problem/5982579> [clang on xcode] (using ↵Steve Naroff2009-03-051-1/+4
| | | | | | arch=x86_64): synthesized property 'sdkPath' must either be named the same as a compatible ivar or must explicitly name an ivar. llvm-svn: 66162
* Fix <rdar://problem/6144382> [sema] gcc inconsistency w.r.t. forward ↵Steve Naroff2009-03-051-0/+25
| | | | | | protocol declarations. llvm-svn: 66161
* simplify Sema::AddInstanceMethodToGlobalPool, no functionality change.Chris Lattner2009-03-041-17/+15
| | | | llvm-svn: 66016
* Fix <rdar://problem/5982579> [clang on xcode] (using arch=x86_64): ↵Steve Naroff2009-03-031-1/+2
| | | | | | synthesized property 'sdkPath' must either be named the same as a compatible ivar or must explicitly name an ivar. llvm-svn: 65973
* Fix <rdar://problem/6497242> Inherited overridden protocol declared objects ↵Steve Naroff2009-03-031-6/+14
| | | | | | | | don't work. Change Sema::DiagnosePropertyMismatch() to check for type compatibility (rather than type equivalence, which is too strict). llvm-svn: 65949
* Fix <rdar://problem/6497608> clang does not catch ivar type mismatches in ↵Steve Naroff2009-03-031-5/+15
| | | | | | @implementation. llvm-svn: 65948
* Fixed a typo.Fariborz Jahanian2009-03-021-1/+1
| | | | llvm-svn: 65855
* Check for duplicate declaration of method of a classFariborz Jahanian2009-03-021-0/+31
| | | | | | in its extension. llvm-svn: 65854
* "This patch uses the new ObjCImplDecl class to merge ↵Chris Lattner2009-03-011-70/+29
| | | | | | | | | | | | | | Sema::ImplMethodsVsClassMethods and Sema::ImplCategoryMethodsVsIntfMethods methods. And now, when clang check a class implementation to find unimplemented methods, it also checks all methods from the class extensions (unnamed categories). There is also a test case to check this warning. This patch contains also a minor update for ObjCImplDecl . getNameAsCString and getNameAsString now returns an empty string instead of crashing for unnamed categories." Patch by Jean-Daniel Dupas! llvm-svn: 65744
* Minor name change (move the ObjC prefix to a more appropriate place).Steve Naroff2009-02-281-2/+2
| | | | llvm-svn: 65695
* Fix <rdar://problem/6451399> problems with labels and blocks.Steve Naroff2009-02-281-0/+2
| | | | | | | | | - Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with. - Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr(). - Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope. - Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions). llvm-svn: 65694
* Diagnose gc attribute mismatch of property and its ivar.Fariborz Jahanian2009-02-271-0/+12
| | | | llvm-svn: 65656
* Fix <rdar://problem/6574319> clang issues error on 'readonly' property with ↵Steve Naroff2009-02-261-1/+6
| | | | | | | | a defaul setter attribute. Needed to make isPropertyReadonly() non-const (for this fix to compile). I imagine there's a way to retain the const-ness, however I have more important fish to fry. llvm-svn: 65562
* fix rdar://6611778, a redefinition of an interface was causing anChris Lattner2009-02-231-2/+3
| | | | | | | | assertion when the ivars and method list was reset into the existing interface. To fix this, mark decls as invalid when they are redefined, and don't insert ivars/methods into invalid decls. llvm-svn: 65340
* Fix <rdar://problem/6500554> missing objc error message.Steve Naroff2009-02-201-3/+13
| | | | llvm-svn: 65198
* fix indentationChris Lattner2009-02-201-3/+3
| | | | llvm-svn: 65170
* add plumbing to get ASTContext& down to allocation/deallocation points in ↵Chris Lattner2009-02-201-12/+11
| | | | | | | | ObjCList, but don't start using it yet. Renamed some methods to be more consistent. llvm-svn: 65168
* remove some more methods from objc decls, using the iteratorChris Lattner2009-02-201-10/+15
| | | | | | interfaces more consistently. llvm-svn: 65138
* Downgrade complaints about calling unavailable functions to a warningDouglas Gregor2009-02-181-3/+3
| | | | | | | | | | | | | | | | | | (as GCC does), except when we've performed overload resolution and found an unavailable function: in this case, we actually error. Merge the checking of unavailable functions with the checking for deprecated functions. This unifies a bit of code, and makes sure that we're checking for unavailable functions in the right places. Also, this check can cause an error. We may, eventually, want an option to make "unavailable" warnings into errors. Implement much of the logic needed for C++0x deleted functions, which are effectively the same as "unavailable" functions (but always cause an error when referenced). However, we don't have the syntax to specify deleted functions yet :) llvm-svn: 64955
* diagnose uses of deprecated typenames and tags.Chris Lattner2009-02-161-3/+3
| | | | | | We now pass all the deprecation tests in the objc.dg suite. llvm-svn: 64679
* warn about interfaces that inherit from deprecated classes.Chris Lattner2009-02-161-0/+7
| | | | llvm-svn: 64671
* warn about categories that implement deprecated interfaces.Chris Lattner2009-02-161-6/+4
| | | | llvm-svn: 64670
* early exit on error. This code is creating an invalid decl on error. This isChris Lattner2009-02-161-24/+23
| | | | | | dubious, but at least mark it as an invalid decl. llvm-svn: 64668
* Remove an unused variable (which caused a warning).Fariborz Jahanian2009-02-161-1/+1
| | | | llvm-svn: 64660
* Remove FindIvarDeclaration. Use lookupInstanceVariable is is functionallyFariborz Jahanian2009-02-161-1/+1
| | | | | | the same. llvm-svn: 64657
* code cleanupChris Lattner2009-02-161-17/+17
| | | | llvm-svn: 64651
OpenPOWER on IntegriCloud