summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Move method FindPropertyVisibleInPrimaryClass() from ObjCContainerDecl to ↵Ted Kremenek2010-03-151-10/+9
| | | | | | | | ObjCInterfaceDecl. Also change this method to lookup property declarations using DeclContext::lookup(). llvm-svn: 98574
* Change ObjCCategoryDecl::FindPropertyDeclaration() to lookupTed Kremenek2010-03-151-33/+42
| | | | | | property decls using DeclContext::lookup(). llvm-svn: 98571
* Make 'findPropertyDecl()' a static method of ObjCPropertyDecl.Ted Kremenek2010-03-151-0/+13
| | | | llvm-svn: 98570
* Remove unused 'IVars' field from ObjCInterfaceDecl. That functionalityTed Kremenek2010-03-111-1/+0
| | | | | | has migrated to DeclContext. llvm-svn: 98213
* Keep track of type source information in the return type of anDouglas Gregor2010-03-081-3/+4
| | | | | | | | | | Objective-C method declaration, e.g., for - (Foo *)myMethod; we now have TypeSourceInfo for the Foo*. llvm-svn: 97942
* More support for ivars in class extension.Fariborz Jahanian2010-02-231-0/+17
| | | | llvm-svn: 96850
* Class continuation now has its own property ast forFariborz Jahanian2010-02-151-6/+8
| | | | | | | | those declared in it. This is to allow duplicate property diagnostics for properties declared in class extensions multiple times (radar 7629420) and for future use. llvm-svn: 96276
* Patch to implement rewriting of properties.Fariborz Jahanian2010-01-211-1/+2
| | | | | | Fixes radar 7562952. llvm-svn: 94087
* Improve location information for Objective-C category declarations. WeDouglas Gregor2010-01-161-2/+4
| | | | | | | | | | | | | previously only had a single location (the @ in @interface); now we know where the @ is (for the start of the declaration), where the class name is (that's the normal "location" now for diagnostics), and where the category name is. Also, eliminated the redundant "end" location, since ObjCContainerDecl already has better @end information. The only XFAIL'd test is temporary; will un-XFAIL-it once I've taught CIndex how to use the new locations. llvm-svn: 93639
* Keep track of the source locations for each protocol reference inDouglas Gregor2010-01-161-8/+31
| | | | | | | | Objective-C classes, protocol definitions, forward protocol declarations, and categories. This information isn't actually used yet; that's coming next. llvm-svn: 93636
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | variables, but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
* Add ObjCClassDecl::getSourceRange().Ted Kremenek2009-11-181-0/+6
| | | | llvm-svn: 89179
* Add SourceLocations to ObjCClassDecl for the class identifiers referenced by ↵Ted Kremenek2009-11-181-13/+28
| | | | | | @class. llvm-svn: 89170
* Property declared in continuation class can only be used toFariborz Jahanian2009-11-021-0/+21
| | | | | | | change a readonly property declared in the class (and its inherited protocols) to writable property. (Fixes radar 7350645). llvm-svn: 85836
* - Add/tweak some comments.Steve Naroff2009-10-291-3/+3
| | | | | | | | - change ObjCCategoryImplDecl::getCategoryClass() to getCategoryDecl(). No functionality change. llvm-svn: 85528
* tweaked my last patch to 1) preserve the protocol inFariborz Jahanian2009-10-051-3/+1
| | | | | | | | | extension class's protocol list so its AST is complete. 2) Because of this no need to issue warning on unimplemeted methods coming from the extended class protocols because warning is issued when class definition is seen. llvm-svn: 83326
* Patch to implement Protocols on class extensions.Fariborz Jahanian2009-10-051-0/+41
| | | | | | <rdar://problem/7269631> Protocols on class extensions don't work llvm-svn: 83322
* - Remove Sema::FindMethodInNestedImplementations().Steve Naroff2009-10-011-1/+10
| | | | | | | | | - Add ObjCInterfaceDecl::lookupPrivateInstanceMethod(). - Convert clients. No functionality change - One less method in Sema:-) llvm-svn: 83224
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-37/+37
| | | | llvm-svn: 81346
* Vastly improve PredefinedExpr output, both in Sema and CodeGen. Patch by Sam ↵Anders Carlsson2009-09-081-17/+0
| | | | | | Weinig! llvm-svn: 81237
* Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema ↵Argyrios Kyrtzidis2009-08-191-2/+3
| | | | | | | | | | | | interfaces. DeclaratorDecl contains a DeclaratorInfo* to keep type source info. Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl. EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo. Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet. llvm-svn: 79392
* Patch to warn if a property which is 'assign' by defaultFariborz Jahanian2009-08-111-0/+45
| | | | | | may not implement NSCopying protocol in -fobjc-gc[-only] mode. llvm-svn: 78726
* Implement ObjCMethodDecl::getCanonicalDecl().Argyrios Kyrtzidis2009-07-281-0/+20
| | | | llvm-svn: 77298
* -Add ObjCCategoryImplDecl::getCategoryClass() which returns the category ↵Argyrios Kyrtzidis2009-07-281-1/+11
| | | | | | | | | interface decl. -Correct ObjCMethodDecl::getNextRedeclaration(); A method in a ObjCCategoryImplDecl should point to a method in the associated ObjCCategoryDecl, not the ObjCInterfaceDecl. llvm-svn: 77297
* Use ObjCImplDecl in place of ObjCCategoryImplDecl/ObjCImplementationDecl.Argyrios Kyrtzidis2009-07-281-5/+3
| | | | llvm-svn: 77296
* Make ObjCImplDecl inherit from ObjCContainerDecl.Argyrios Kyrtzidis2009-07-271-22/+0
| | | | | | ObjCContainerDecl now is the root class for objc decls that contain methods. llvm-svn: 77235
* Refactor ObjCImplDecl::getInstanceMethod/getClassMethod into oneArgyrios Kyrtzidis2009-07-251-25/+3
| | | | | | ObjCImplDecl::getMethod. llvm-svn: 77094
* Refactor ObjCInterfaceDecl::lookupInstanceMethod/lookupClassMethod into oneArgyrios Kyrtzidis2009-07-251-43/+8
| | | | | | ObjCInterfaceDecl::lookupMethod. llvm-svn: 77093
* Refactor ObjCProtocolDecl::lookupInstanceMethod/lookupClassMethod into oneArgyrios Kyrtzidis2009-07-251-18/+5
| | | | | | ObjCProtocolDecl::lookupMethod. llvm-svn: 77092
* Refactor ObjCContainerDecl::getInstanceMethod/getClassMethod into oneArgyrios Kyrtzidis2009-07-251-23/+3
| | | | | | | | ObjCContainerDecl::getMethod. Avoids code duplication. llvm-svn: 77091
* Disambiguate an if statement.Duncan Sands2009-07-211-2/+2
| | | | llvm-svn: 76547
* 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
OpenPOWER on IntegriCloud