summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Patch to supprt case of readonly property being Fariborz Jahanian2009-01-121-28/+0
| | | | | | | | assigned to when it has user declared setter method defined in the class implementation (but no declaration in the class itself). llvm-svn: 62098
* Convert property implementation to DeclContext::addDecl().Steve Naroff2009-01-111-13/+1
| | | | | | This completes the ObjCContainerDecl AST cleanup (for now). llvm-svn: 62037
* A few property related cleanups to ObjCContainerDecl AST.Steve Naroff2009-01-111-0/+6
| | | | llvm-svn: 62034
* Explicit declaration of property setters over-rideFariborz Jahanian2009-01-101-1/+7
| | | | | | prohibition of 'readonly' properties in an assignment. llvm-svn: 62028
* This patch removes mergeProperties and does the property lookupFariborz Jahanian2009-01-091-25/+10
| | | | | | in designated protocols lazily. llvm-svn: 62007
* Provide a new kind of iterator, the specific_decl_iterator, thatDouglas Gregor2009-01-091-1/+1
| | | | | | | | | filters the decls seen by decl_iterator with two criteria: the dynamic type of the declaration and a run-time predicate described by a member function. This simplifies EnumDecl, RecordDecl, and ObjCContainerDecl considerably. It has no measurable performance impact. llvm-svn: 61994
* Move property API's up to ObjCContainerDecl (removing a lot of duplicate code).Steve Naroff2009-01-091-102/+27
| | | | | | | | | Add isa/cast/dyncast support for ObjCContainerDecl. Renamed classprop_iterator/begin/end to prop_iterator/begin/end (the class prefix was confusing). More simplifications to Sema::ActOnAtEnd()... Added/changed some FIXME's as a result of the above work. llvm-svn: 61988
* Fix crash on null deference when searching for readwrite properties inDaniel Dunbar2009-01-091-13/+15
| | | | | | | categories. - Also, simplify nesting via early return. llvm-svn: 61968
* Addressed the issue in <rdar://problem/6479085>, where we failed toDouglas Gregor2009-01-091-18/+20
| | | | | | | | | | | | | | | rewrite @class declarations that showed up within linkage specifications because those @class declarations never made it any place where the rewriter could find them. Moved all of the ObjC*Decl nodes over to ScopedDecls, so that they can live in the appropriate top-level or transparent DeclContext near the top level, e.g., TranslationUnitDecl or LinkageSpecDecl. Objective-C declarations now show up in a traversal of the declarations in a DeclContext (they didn't before!). This way, the rewriter finds all Objective-C declarations within linkage specifications. llvm-svn: 61966
* Fix ObjCInterfaceDecl::Destroy and ObjCProtocolDecl::Destroy to iterate and ↵Ted Kremenek2009-01-081-10/+4
| | | | | | destroy all contained ObjCMethodDecls in one sweep. This fixes a use-after-free error found by valgrind. llvm-svn: 61943
* Removed ObjCContainerDecl::getPropertyMethods()...doesn't belong in the AST.Steve Naroff2009-01-081-72/+0
| | | | | | Moved logic to Sema::ProcessPropertyDecl(). llvm-svn: 61936
* Remove redundant method context (now that ObjCMethodDecl isa ScopedDecl).Steve Naroff2009-01-081-6/+7
| | | | | | | | Convert clients to use the standard getDeclContext() API. Doug, thanks for the review! llvm-svn: 61935
* This is a large/messy diff that unifies the ObjC AST's with DeclContext.Steve Naroff2009-01-081-83/+44
| | | | | | | | | | | | | | | - ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts. - ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext). - ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-) - Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective. - Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch(). - Simplified Sema::ActOnAtEnd() considerably. Still more work to do. - Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl. - Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl. This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction. llvm-svn: 61929
* ObjC AST cleanups/simplifications (phase 1).Steve Naroff2009-01-071-49/+6
| | | | | | Add ObjCContainerDecl class and have ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl inherit from it. llvm-svn: 61866
* Fixed a bug showed up the meta-data for protocol Fariborz Jahanian2008-12-221-2/+10
| | | | | | | instance methods by building print-class-info.m, whose output is now identical to what gcc puts out. llvm-svn: 61339
* Fix http://llvm.org/bugs/show_bug.cgi?id=3189.Steve Naroff2008-12-181-2/+2
| | | | llvm-svn: 61202
* This patch will build the Records lazily per Steve's comments.Fariborz Jahanian2008-12-171-42/+3
| | | | | | | Note that one test duplicate-ivar-check.m will fail because I need to re-implement duplicate ivar checking. llvm-svn: 61154
* Added comment to Steve's patch to clarify the case.Fariborz Jahanian2008-12-171-0/+3
| | | | llvm-svn: 61144
* Fix <rdar://problem/6450964> clang on xcode: Assertion failed: ↵Steve Naroff2008-12-171-0/+2
| | | | | | | | | | (RecordForDecl && "lookupFieldDeclForIvar no storage for class"). This was a recent regression caused by r61043 (related to code gen. for ivar references). Fariborz, please review. I have some other concerns related to code generation for ivars that we can discuss later. llvm-svn: 61134
* Diagnose that ivars in current and super class may notFariborz Jahanian2008-12-161-2/+4
| | | | | | be duplicates and a test case. llvm-svn: 61068
* Name of addLayoutToClass is confusing as no layout calculationFariborz Jahanian2008-12-151-2/+2
| | | | | | | is done. Layout is calculated lazily at code gen type. This patch changes the name. llvm-svn: 61054
* Code gen. for ivar references; including bitfieldFariborz Jahanian2008-12-151-2/+3
| | | | | | ivars. llvm-svn: 61043
* Removed setRecordForDecl. Added a FIXME.Fariborz Jahanian2008-12-151-1/+1
| | | | llvm-svn: 61038
* Patch for ObjCIvarRefExpr containing the fieldFariborz Jahanian2008-12-131-1/+15
| | | | | | matching the storage layout for this ivar llvm-svn: 60996
* Add storage layout to ObjC classes.Fariborz Jahanian2008-12-131-0/+33
| | | | llvm-svn: 60993
* Unifies the name-lookup mechanisms used in various parts of the ASTDouglas Gregor2008-12-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and separates lexical name lookup from qualified name lookup. In particular: * Make DeclContext the central data structure for storing and looking up declarations within existing declarations, e.g., members of structs/unions/classes, enumerators in C++0x enums, members of C++ namespaces, and (later) members of Objective-C interfaces/implementations. DeclContext uses a lazily-constructed data structure optimized for fast lookup (array for small contexts, hash table for larger contexts). * Implement C++ qualified name lookup in terms of lookup into DeclContext. * Implement C++ unqualified name lookup in terms of qualified+unqualified name lookup (since unqualified lookup is not purely lexical in C++!) * Limit the use of the chains of declarations stored in IdentifierInfo to those names declared lexically. * Eliminate CXXFieldDecl, collapsing its behavior into FieldDecl. (FieldDecl is now a ScopedDecl). * Make RecordDecl into a DeclContext and eliminates its Members/NumMembers fields (since one can just iterate through the DeclContext to get the fields). llvm-svn: 60878
* Prevent bogus warning on unimplemented setter/getter when userFariborz Jahanian2008-12-091-0/+8
| | | | | | has added declaration of these methods in its @interface. llvm-svn: 60803
* Support for implementation of property in the case whereFariborz Jahanian2008-12-091-3/+4
| | | | | | | the synthesis is in an implementation of s subclass of a super class where the property has been declared. llvm-svn: 60792
* ObjCInterfaceDecl::lookupInstanceMethod() needs to look through a categories ↵Steve Naroff2008-12-081-0/+8
| | | | | | | | protocols. Fixes <rdar://problem/6418640> clang on prokit: error: incompatible type returning 'id', expected 'NSSize' llvm-svn: 60716
* Use of properties declared in protocols in the categoryFariborz Jahanian2008-12-061-0/+25
| | | | | | | via the category's protocol list1s, with appropriate diagnsostics and a test case. llvm-svn: 60634
* Fixed a comment.Fariborz Jahanian2008-12-051-4/+4
| | | | llvm-svn: 60611
* This test checks for duplicate implementation of the same Fariborz Jahanian2008-12-051-0/+54
| | | | | | | | property. It also checks for duplicate use of the same ivar in two different iproperty implementations. It also caught an error for a test case used in CodeGen :). llvm-svn: 60610
* This patch corrects problem in searching for a setter/getter method forFariborz Jahanian2008-12-021-24/+18
| | | | | | | | a property. Previous scheme of seaching in interface's list of methods would not work because this list is not yet constructed. This is in preparation for doing semantic check on viability of setter/getter method declarations. llvm-svn: 60386
* Refactored checking on readonly property into a method.Fariborz Jahanian2008-11-251-0/+20
| | | | llvm-svn: 60050
* Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make itChris Lattner2008-11-241-2/+2
| | | | | | | | | assert if the name is not an identifier. Update callers to do the right thing and avoid this method in unsafe cases. This also fixes an objc warning that was missing a space, and migrates a couple more to taking IdentifierInfo and QualTypes instead of std::strings. llvm-svn: 59936
* Rename Selector::getName() to Selector::getAsString(), and addChris Lattner2008-11-241-1/+1
| | | | | | | | | | | | | a new NamedDecl::getAsString() method. Change uses of Selector::getName() to just pass in a Selector where possible (e.g. to diagnostics) instead of going through an std::string. This also adds new formatters for objcinstance and objcclass as described in the dox. llvm-svn: 59933
* Introduction the DeclarationName class, as a single, general method ofDouglas Gregor2008-11-171-2/+2
| | | | | | | | representing the names of declarations in the C family of languages. DeclarationName is used in NamedDecl to store the name of the declaration (naturally), and ObjCMethodDecl is now a NamedDecl. llvm-svn: 59441
* Fix "possibly uninitialized" warning.Daniel Dunbar2008-08-271-1/+1
| | | | llvm-svn: 55406
* Add addPropertyMethods implementations forDaniel Dunbar2008-08-271-12/+57
| | | | | | | ObjC{Category,Protocol}Decl. - No functionality change. llvm-svn: 55404
* Add ObjCPropertyDecl::isReadOnly.Daniel Dunbar2008-08-261-0/+4
| | | | | | Respect isReadOnly when generating synthesized method decls. llvm-svn: 55364
* constify ObjC*::getClassMethod,getInstanceMethod Daniel Dunbar2008-08-261-10/+16
| | | | | | No (intended) functionality change. llvm-svn: 55362
* Missed a file; part of:Daniel Dunbar2008-08-261-0/+25
| | | | | | | | | | | Move implicit Obj-C param creation into ObjCMethodDecl. - Add ObjCMethodDecl::createImplicitParams. - Remove ObjCMethodDecl::set{Self,Cmd}Decl - Remove Sema::CreateImplicitParameter No (intended) functionality change. llvm-svn: 55357
* Rename ObjCPropertyImplDecl::PropertyImplKind (consistency)Daniel Dunbar2008-08-261-2/+2
| | | | | | | | | - Change enum name to Kind. - Change enum constants to English strings. Also, fix getPropertyImplementation (which probably should be renamed) llvm-svn: 55354
* Fix return type for setter method.Daniel Dunbar2008-08-261-1/+1
| | | | llvm-svn: 55353
* Synthesize property setter method as we do for getter.Daniel Dunbar2008-08-261-14/+38
| | | | | | | - Also, fix Parser to construct proper SetterName selector (should be lifted out of parser though). llvm-svn: 55352
* Fix attributes on Obj-C interfaces & methods.Daniel Dunbar2008-08-201-4/+3
| | | | | | | - Drop MethodAttrs parameter to ObjCMethodDecl - Call ProcessDeclAttributeList for interface & method decls. llvm-svn: 55068
* Added ObjCAtDefsFieldDecl to represent FieldDecls created by @defs.Ted Kremenek2008-08-201-0/+13
| | | | | | This fixes an ownership issue where FieldDecls could be owned both by an ObjCInterfaceDecl and a RecordDecl. llvm-svn: 55037
* More #include cleaningDaniel Dunbar2008-08-111-0/+1
| | | | | | | | - Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and SourceLocation.h) - Move ASTContext constructor into implementation llvm-svn: 54627
* When constructing an ObjCIvarDecl object in Sema, provide its visibility up ↵Ted Kremenek2008-07-231-2/+3
| | | | | | | | front instead of setting it afterwards. This change also fixes a subtle bug where the access control of an ivar would be initialized to garbage if we didn't have an explicit visibility specifier (e.g., @private). llvm-svn: 53955
* move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,Chris Lattner2008-07-211-34/+10
| | | | | | simplifying code along the way and fixing a problem and memory leak or two. llvm-svn: 53876
OpenPOWER on IntegriCloud