summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Eliminate Sema::ObjCInterfaceDeclsDouglas Gregor2009-04-241-10/+2
| | | | llvm-svn: 69942
* Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's ↵Douglas Gregor2009-04-241-7/+4
| | | | | | | | | | | good for uniformity is good for PCH (or is it the other way around?). As part of this, make ObjCImplDecl inherit from NamedDecl (since ObjCImplementationDecls now need to have names so that they can be found). This brings ObjCImplDecl very, very close to ObjCContainerDecl; we may be able to merge them soon. llvm-svn: 69941
* Eliminate Sema::ObjCProtocols. Instead, we place ObjCProtocolDecls inDouglas Gregor2009-04-231-9/+6
| | | | | | | | | | | | their own namespace (IDNS_Protocol) and use the normal name-lookup routines to find them. Aside from the simplification this provides (one less DenseMap!), it means that protocols will be lazily deserialized from PCH files. Make the code size of the selector table block match the code size of the type and decl blocks. llvm-svn: 69939
* Diagnose if an implementation implements a forward classFariborz Jahanian2009-04-231-1/+3
| | | | | | declaration (and avoid issuing bogus error later on). llvm-svn: 69928
* Remove @compatibility_alias regression.Steve Naroff2009-04-231-1/+2
| | | | llvm-svn: 69899
* More PushOnScopeChain() FIXME's.Steve Naroff2009-04-231-4/+2
| | | | llvm-svn: 69894
* Sema::ActOnStartClassInterface(): Use PushOnScopeChains().Steve Naroff2009-04-231-2/+1
| | | | | | This enables class recognition to work with PCH. I believe this means we can remove Sema::ObjCInterfaceDecls and it's usage within Sema::LookupName(). Will investigate. llvm-svn: 69891
* Eliminate the three SmallVectors in ObjCImplDecl (for instanceDouglas Gregor2009-04-231-26/+29
| | | | | | | | | | | methods, class methods, and property implementations) and instead place all of these entities into the DeclContext. This eliminates more linear walks when looking for class or instance methods and should make PCH (de-)serialization of ObjCDecls trivial (and lazy). llvm-svn: 69849
* Make sure to mark the interface as completed when we see anDaniel Dunbar2009-04-211-0/+5
| | | | | | | | | @implementation that closes a @class delcaration. - I don't know how to make a test case for this, but this strengthens the invariants that hold internally. The functionality change here is the edit to SemaDeclObjC.cpp. llvm-svn: 69728
* Patch to diagnose use of objc's @defs in nonfragile abi.Fariborz Jahanian2009-04-211-0/+5
| | | | llvm-svn: 69710
* Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ↵Steve Naroff2009-04-201-1/+1
| | | | | | | | ObjCIvarDecl. Next step: Add selector support to PCHWriter::AddDeclarationName(). llvm-svn: 69619
* Add pch reader/writer support for ObjCMethodDecl.Steve Naroff2009-04-201-4/+4
| | | | | | Test will be enabled with ObjCInterfaceDecl is added. llvm-svn: 69594
* add a new Sema::CurFunctionNeedsScopeChecking bool that is used to avoid Chris Lattner2009-04-191-0/+2
| | | | | | | calling into the jump checker when a function or method is known to contain no VLAs or @try blocks. llvm-svn: 69509
* Patch to remove a bogus warning which pointed to underlying ASTFariborz Jahanian2009-04-151-13/+3
| | | | | | | | gen. issue for property in continuation class declared readwrite but which did not generate the declaration for the setter. Fix also removed a FIXME and resulted in code cleanup. llvm-svn: 69200
* Diagnose properties which have no implementations;Fariborz Jahanian2009-04-141-19/+52
| | | | | | | either unimplemented setter/getter or no implementation directive. llvm-svn: 69098
* Audit __private_extern__ handling.Daniel Dunbar2009-04-141-2/+1
| | | | | | | | | | | | | | - Exposed quite a few Sema issues and a CodeGen crash. - See FIXMEs in test case, and in SemaDecl.cpp (PR3983). I'm skeptical that __private_extern__ should actually be a storage class value. I think that __private_extern__ basically amounts to extern A __attribute__((visibility("hidden"))) and would be better off handled (a) as that, or (b) with an extra bit in the VarDecl. llvm-svn: 69020
* In objc2's None-Fragile ABI, one cannot use the super class ivar forFariborz Jahanian2009-04-131-1/+12
| | | | | | setter/getter synthesis. llvm-svn: 68976
* Change diagnostic as a result of researching <rdar://problem/6779809> ↵Steve Naroff2009-04-131-2/+1
| | | | | | | | missing interface name in "error: cannot declare variable inside a class, protocol or category ''. Since ObjC 2.0 class "extensions" have a null name, the diagnostic above is actually "correct". Nevertheless, it is confusing. Decided to remove the name entirely (from my perspective, it didn't add any value). Also simplified the text of the diagnostic a bit. llvm-svn: 68967
* Fix rdar://6771034: don't warn on use of forward declared protocol in protocolChris Lattner2009-04-121-1/+1
| | | | | | | list of another protocol definition. This warning is very noisy and GCC doesn't produce it so existing code doesn't expect it. llvm-svn: 68894
* improve location info for property stuff. In a property like this:Chris Lattner2009-04-111-11/+10
| | | | | | | | | | | @property int x; associate the location of X with the property decl, not the location of the @. Also, pass this info along to the synthesized ParmVarDecls so that redefinition and other diagnostics can use it. This eliminates a fixme. llvm-svn: 68880
* improve the 'conflicting types' diagnostics to include correct location ↵Chris Lattner2009-04-111-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | info, now that it is plumbed through Sema. On a file from growl, we used to emit: t.mi:107059:1: warning: conflicting types for 'removePluginHandler:forPluginTypes:' - (void) removePluginHandler:(id <GrowlPluginHandler>)handler forPluginTypes:(NSSet *)extensions { ^ t.mi:105280:1: note: previous definition is here - (void) removePluginHandler:(id <NSObject>)handler forPluginTypes:(NSSet *)types; ^ now we produce: t.mi:107059:55: warning: conflicting parameter types in implementation of 'removePluginHandler:forPluginTypes:': 'id<NSObject>' vs 'id<GrowlPluginHandler>' - (void) removePluginHandler:(id <GrowlPluginHandler>)handler forPluginTypes:(NSSet *)extensions { ^ t.mi:105280:45: note: previous definition is here - (void) removePluginHandler:(id <NSObject>)handler forPluginTypes:(NSSet *)types; ^ We still don't have proper loc info for properties, hence the FIXME. rdar://6782494 llvm-svn: 68879
* Set proper location info on objc method arguments.Chris Lattner2009-04-111-5/+3
| | | | llvm-svn: 68877
* simplify code to use adjustParameterType, apply objc arg attributesChris Lattner2009-04-111-13/+12
| | | | | | to their arguments. llvm-svn: 68876
* 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
OpenPOWER on IntegriCloud