summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement the virtual getNextRedeclaration() for ObjCMethodDecl.Argyrios Kyrtzidis2009-07-211-0/+24
| | | | | | | If it's in an ObjCContainerDecl, its "redeclaration" is the method definition in the corresponding ObjCImplDecl. If it's in an ObjCImplDecl, its "redeclaration" is the method in the interface. llvm-svn: 76512
* Remove the ObjCCategoryImpls vector from Sema class.Argyrios Kyrtzidis2009-07-211-0/+19
| | | | | | Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality. llvm-svn: 76510
* - Introduce ASTContext::getObjCImplementation() and ↵Argyrios Kyrtzidis2009-07-211-0/+36
| | | | | | | | | | | | ASTContext::setObjCImplementation() which use a DenseMap to associate an interface/category with its implementation (if one exists). - Introduce ObjCInterfaceDecl::get/setImplementation() and ObjCCategoryDecl::get/setImplementation() that use the above methods. - Add a compiler error for when a category is reimplemented. llvm-svn: 76508
* This patch includes a conceptually simple, but very intrusive/pervasive change. Steve Naroff2009-07-101-1/+1
| | | | | | | | | | | | The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches. This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic. By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks. llvm-svn: 75314
* De-ASTContext-ify DeclContext.Argyrios Kyrtzidis2009-06-301-61/+42
| | | | | | | Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating". Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit. llvm-svn: 74506
* Adds synthesize ivars to DeclContext.Fariborz Jahanian2009-06-061-10/+0
| | | | llvm-svn: 73000
* Use of DeclContext for objc's ivars. No functionalityFariborz Jahanian2009-06-051-6/+16
| | | | | | change. More to follow. llvm-svn: 72951
* (Next runtime only) check to see if class implements forwardInvocation method Fariborz Jahanian2009-05-221-0/+14
| | | | | | | | | and objects of this class are derived from 'NSProxy'. Under such conditions, which means that every method possible is implemented in the class, we should not issue "Method definition not found" warnings. llvm-svn: 72267
* The ivars in an ObjCImplementationDecl are now stored in theDouglas Gregor2009-04-231-6/+0
| | | | | | | DeclContext rather than in a separate list. This makes PCH (de-)serialization trivial, so that ivars can be loaded lazily. llvm-svn: 69857
* PCH (de-)serialization for ObjCImplDecl. This can't be tested yet.Douglas Gregor2009-04-231-0/+1
| | | | llvm-svn: 69855
* Eliminate the three SmallVectors in ObjCImplDecl (for instanceDouglas Gregor2009-04-231-15/+48
| | | | | | | | | | | 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
* Remove lookupFieldDeclFromIvar from ObjCIvarDecl interface.Daniel Dunbar2009-04-221-15/+0
| | | | | | - This is only used by CGObjCRuntime now. llvm-svn: 69800
* Revert r69771, I missed some (obvious) details. :/Daniel Dunbar2009-04-221-23/+5
| | | | llvm-svn: 69773
* Mark another TypeForDecl const and make getObjCInterfaceType's argument const.Daniel Dunbar2009-04-221-1/+1
| | | | llvm-svn: 69772
* Rework the shadow struct that is layed out for Objective-C classes.Daniel Dunbar2009-04-221-5/+23
| | | | | | | | | | | | | | | | | | | - Superclasses are now always laid out their shadow structure at the first field. - Prior to this, the entire class heirarchy was flattened into a single structure which meant that alignment, padding, and bitfields weren't packed correctly (the ASTRecordLayout was correct however, which meant our debug info didn't coincide with ivar offsets, for example). - This is still very suboptimal, but I believe the ivar layout itself is now at least close to correct. - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding backwards llvm-svn: 69771
* Make sure to mark the interface as completed when we see anDaniel Dunbar2009-04-211-0/+1
| | | | | | | | | @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
* Add pch reader/writer support for ObjCMethodDecl.Steve Naroff2009-04-201-5/+5
| | | | | | Test will be enabled with ObjCInterfaceDecl is added. llvm-svn: 69594
* Remove non-const form of lookupFieldDeclForIvar.Daniel Dunbar2009-04-201-3/+4
| | | | llvm-svn: 69563
* Propagate the ASTContext to various AST traversal and lookup functions.Douglas Gregor2009-04-091-31/+44
| | | | | | No functionality change (really). llvm-svn: 68726
* Fix up lookup rules for properties declared inFariborz Jahanian2009-04-021-26/+0
| | | | | | objc's continuation class. llvm-svn: 68339
* Fix a bug in declaration of property in continuationFariborz Jahanian2009-04-011-0/+10
| | | | | | | class which was exposed by implementation of objc2's nonfragile abi code gen. llvm-svn: 68259
* Nonfragile ivar synthesis with property is in a continuationFariborz Jahanian2009-04-011-0/+16
| | | | | | class. llvm-svn: 68234
* simplify some castingChris Lattner2009-03-311-7/+4
| | | | llvm-svn: 68098
* fe support for objc2's nonfragile-abi synthesized ivars.Fariborz Jahanian2009-03-311-0/+10
| | | | llvm-svn: 68077
* Fix <rdar://problem/6619539> incompatible pointer types sending ↵Steve Naroff2009-03-011-0/+13
| | | | | | | | | 'XCElementSpacer *', expected 'XCElement *' (not handling protocol signatures correctly?). - Reworked ASTContext::canAssignObjCInterfaces(). - Added ObjCProtocolDecl::lookupProtocolNamed(). llvm-svn: 65773
* "This patch addresses two FIXME on ObjCCategoryImplDecl:Chris Lattner2009-02-281-56/+6
| | | | | | | | | | | | | /// FIXME: Like ObjCImplementationDecl, this should not be a NamedDecl! /// FIXME: Introduce a new common base class for ObjCImplementationDecl and ObjCCategoryImplDecl It adds an IndentifierInfo ivar to the ObjCCategoryImplDecl, so it can inherits from Decl and not NamedDecl (I'm not sure about the memory management of this ivar). And now that both ObjCImplementationDecl and ObjCCategoryImplDecl have the same super classes, it allow creation of a common base class: ObjCImplDecl" Patch by Jean-Daniel Dupas! llvm-svn: 65703
* Fix ObjCInterfaceDecl::lookupInstanceMethod()/lookupClassMethod() to search ↵Steve Naroff2009-02-261-3/+11
| | | | | | | | | | in inherited protocols. Also changed ObjCInterfaceDecl::lookupClassMethod() to look through a categories protocols. Test/patch submitted by Jean-Daniel Dupas (thanks!). llvm-svn: 65526
* Contains the following (related to problems found while investigting ↵Steve Naroff2009-02-221-9/+31
| | | | | | | | | | <rdar://problem/6497631> Message lookup is sometimes different than gcc's). - Implement instance/class overloading in ObjCContainerDecl (removing a FIXME). This involved hacking NamedDecl::declarationReplaces(), which took awhile to figure out (didn't realize replace was the default). - Changed Sema::ActOnInstanceMessage() to remove redundant warnings when dealing with protocols. For now, I've omitted the "protocol" term in the diagnostic. It simplifies the code flow and wan't always 100% accurate (e.g. "Foo<Prot>" looks in the class interface, not just the protocol). - Changed several test cases to jive with the above changes. llvm-svn: 65292
* allocate and dellocate objc decl list through AST Context instead ofChris Lattner2009-02-201-2/+3
| | | | | | | | | with new/delete. With disable-free, this reduces the number of 4/8 byte mallocs from 4793/1541 to 865/456 and also drops other sizes as well. This is a very small perf win, nothing major. llvm-svn: 65171
* add plumbing to get ASTContext& down to allocation/deallocation points in ↵Chris Lattner2009-02-201-19/+29
| | | | | | | | ObjCList, but don't start using it yet. Renamed some methods to be more consistent. llvm-svn: 65168
* newly factored, we can now move the set and destroy methods out of line.Chris Lattner2009-02-201-0/+20
| | | | llvm-svn: 65166
* rename ObjCList::clear() -> ObjCList::Destroy(). Require that destroy is calledChris Lattner2009-02-201-6/+6
| | | | | | before the dtor. llvm-svn: 65156
* rearrange the contents of DeclObjC to be by-class. Fix some 80 column issuesChris Lattner2009-02-201-328/+367
| | | | | | and other non-semantic changes. llvm-svn: 65155
* destroy should forward to base class.Chris Lattner2009-02-201-0/+1
| | | | llvm-svn: 65151
* move the @implementation ivar list to being an ObjCList, which preventsChris Lattner2009-02-201-12/+6
| | | | | | it from being leaked, among other things. llvm-svn: 65150
* remove some slow O(n) methods.Chris Lattner2009-02-201-19/+0
| | | | llvm-svn: 65132
* Change ObjCForwardProtocolDecl to use an ObjCList.Chris Lattner2009-02-201-11/+6
| | | | llvm-svn: 65131
* move the interace list of @class to use ObjCList.Chris Lattner2009-02-201-16/+3
| | | | llvm-svn: 65129
* remove a dead list.Chris Lattner2009-02-201-2/+1
| | | | llvm-svn: 65127
* switch ObjCMethodDecl's parameter list from being explicitly managed to an ↵Chris Lattner2009-02-201-14/+1
| | | | | | ObjCList. llvm-svn: 65114
* switch the interface ivar list from being explicitly managed to using ObjCList.Chris Lattner2009-02-201-17/+2
| | | | llvm-svn: 65113
* move more objc destruction out of dtors into Destroy.Chris Lattner2009-02-201-11/+42
| | | | llvm-svn: 65112
* move some objc decl destruction out of dtors into Destroy method.Chris Lattner2009-02-201-6/+9
| | | | llvm-svn: 65111
* All Decls have a DeclContext now, hooray! Fans of consistency rejoice.Argyrios Kyrtzidis2009-02-171-4/+4
| | | | | | Pass the DeclContext to ObjCIvarDecls as well. llvm-svn: 64801
* Remove FindIvarDeclaration. Use lookupInstanceVariable is is functionallyFariborz Jahanian2009-02-161-16/+0
| | | | | | the same. llvm-svn: 64657
* wrap long lines.Chris Lattner2009-02-161-6/+8
| | | | llvm-svn: 64650
* Remove many references to ASTContext::getAllocator(), replacing them with ↵Steve Naroff2009-01-271-27/+14
| | | | | | | | calls to the recently added placement new (which uses ASTContext's allocator for memory). Also added ASTContext::Deallocate(). This will simplify runtime replacement of ASTContext's allocator. Keeping the allocator private (and removing getAllocator() entirely) is also goodness. llvm-svn: 63135
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-201-4/+3
| | | | | | | | | | | | | | | | that every declaration lives inside a DeclContext. Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure. The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc. llvm-svn: 62562
* Patch to allow @dynamic synthesis of property in a category,Fariborz Jahanian2009-01-191-2/+11
| | | | | | with @synthesize being illegal. llvm-svn: 62515
* Fix crasher due to use-after-release: DeclContext now owns all ↵Ted Kremenek2009-01-121-18/+0
| | | | | | ObjCMethodDecls, and shouldn't be released elsewhere. llvm-svn: 62113
OpenPOWER on IntegriCloud