summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't warn if result/argument type of an implemented Fariborz Jahanian2009-05-141-2/+5
| | | | | | | method is a qualified id which conforms to the matching type of its method declaration. llvm-svn: 71817
* Method attributes may only be specified on methodFariborz Jahanian2009-05-121-0/+4
| | | | | | declarations. llvm-svn: 71597
* Fixes a bug in my last patch. Order of types reversed.Fariborz Jahanian2009-05-081-2/+1
| | | | llvm-svn: 71267
* Refactoring of my last patch.Fariborz Jahanian2009-05-081-16/+23
| | | | llvm-svn: 71248
* More type checking for properties, accessors andFariborz Jahanian2009-05-081-6/+12
| | | | | | use of dot-syntax expression. This is to match gcc's. llvm-svn: 71243
* Add a warning for a missing copy attribute on a property that is aMike Stump2009-05-071-0/+5
| | | | | | block pointer. Radar 6441502 llvm-svn: 71190
* a forward class declaration matching a typedef name of a classFariborz Jahanian2009-05-071-0/+7
| | | | | | | refers to the underlying class. This is radar 6859726. Steve, please read the radar for my rational. llvm-svn: 71181
* Remove support for ObjCMethodDecl attributes that appear between theTed Kremenek2009-05-041-4/+0
| | | | | | | | return type and the selector. This is inconsistent with C functions (where such attributes would be placed on the return type, not the the FunctionDecl), and is inconsistent with what people are use to seeing. llvm-svn: 70878
* Check for method type conflict between declaration inFariborz Jahanian2009-05-011-37/+85
| | | | | | | | class/protocol and implementation which could be an imm. implementation or down in the inheritance hierarchy. llvm-svn: 70568
* Use of super class ivar to synthesize property is back to being error.Fariborz Jahanian2009-04-301-1/+1
| | | | llvm-svn: 70514
* Hook up Sema support for attributes on Objective-C method declarations thatTed Kremenek2009-04-301-0/+4
| | | | | | | | | | | | | appear between the return type and the selector. This is a separate code path from regular attribute processing, as we only want to (a) accept only a specific set of attributes in this place and (b) want to distinguish to clients the context in which an attribute was added to an ObjCMethodDecl. Currently, the attribute 'objc_ownership_returns' is the only attribute that uses this new feature. Shortly I will add a warning for 'objc_ownership_returns' to be placed at the end of a method declaration. llvm-svn: 70504
* Change to warning when property uses an ivar in super classFariborz Jahanian2009-04-291-1/+1
| | | | | | in an @synthesize diective, as it breaks few projects. llvm-svn: 70441
* use of an ivar specified on a property @synthesizeFariborz Jahanian2009-04-291-2/+1
| | | | | | and found in super class triggers a diagnostics. llvm-svn: 70414
* Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.Eli Friedman2009-04-261-2/+2
| | | | llvm-svn: 70145
* Fix a pasto in the lookup of instance methods in the global poolDouglas Gregor2009-04-241-2/+2
| | | | llvm-svn: 69996
* PCH support for the global method pool (= instance and factory methodDouglas Gregor2009-04-241-3/+93
| | | | | | | | pools, combined). The methods in the global method pool are lazily loaded from an on-disk hash table when Sema looks into its version of the hash tables. llvm-svn: 69989
* Eliminate Sema::ObjCAliasDecls. This is based on Steve's fix, but alsoDouglas Gregor2009-04-241-5/+1
| | | | | | | updates name lookup so that we see through @compatibility_alias declarations to their underlying interfaces. llvm-svn: 69950
* Fix Objective-C crashesDouglas Gregor2009-04-241-3/+0
| | | | llvm-svn: 69945
* 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
OpenPOWER on IntegriCloud