summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* introduce a new ObjCList templated class and start moving Chris Lattner2008-07-211-21/+12
| | | | | | | various objc lists over to it. First up, the protocol list on ObjCInterfaceDecl. llvm-svn: 53856
* rename setReferencedProtocolList -> addReferencedProtocols toChris Lattner2008-07-211-2/+2
| | | | | | be consistent with ObjCInterfaceDecl. llvm-svn: 53852
* Switch initialization of the protocol list for an interface decl to useChris Lattner2008-07-211-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | the standard "set these as the list of protocols" interface instead of a strange "set this as the size and then set each one to the value" interface. The problem with the later is that it a) is completely different from everything else, b) is awkward, and c) doesn't handle the case when a referenced protocol is invalid: it set it to null. This meant that all clients downstream would have to handle null protocols in the protocol list, and empirically they didn't. Fix this by not setting invalid protocols in the referenced protocol list, fixing the crash on test/Sema/objc-interface-1.m While I'm at it, clean up some locations so that we produce: t.m:1:25: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever' @interface NSWhatever : NSObject <NSCopying> ~~~~~~~~~~~~~~~~~~~~~ ^ instead of: t.m:1:1: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever' @interface NSWhatever : NSObject <NSCopying> ^ llvm-svn: 53846
* Two fixes:Steve Naroff2008-07-161-2/+2
| | | | | | | - Make sure ObjCIvarDecl propagates the bitfield width. - RewriteObjC::SynthesizeIvarOffsetComputation(): Avoid using the __OFFSETOF__ mumbo jumbo for bitfields (since it isn't legal C). This fixes <rdar://problem/5986079> clang ObjC rewriter: bitfields and ivar access don't mix. llvm-svn: 53694
* Reclaim memory owned by ObjCForwardProtocolDecls.Ted Kremenek2008-06-061-0/+4
| | | | llvm-svn: 52063
* Implement "Destroy" and destructor for ObjCClassDecl, allowing us to reclaim ↵Ted Kremenek2008-06-061-0/+17
| | | | | | its memory and the memory of the Decls it owns. llvm-svn: 52059
* Implement "Destroy" and destructor for ObjCProtocolDecl, allowing us to ↵Ted Kremenek2008-06-061-0/+25
| | | | | | reclaim its memory and the memory of the Decls it owns. llvm-svn: 52055
* Because of a lack of a clear ownership role between ObjCInterfaceDecls andTed Kremenek2008-06-061-7/+5
| | | | | | | ObjCPropertyDecls, have TranslationUnit destroy ObjCPropertyDecls. This is a horrible hack, and must be removed eventually. llvm-svn: 52051
* Initial work on additional memory collection for ObjC AST objects. We nowTed Kremenek2008-06-061-4/+43
| | | | | | | | have Destroy methods of ObjcMethodDecl and ObjCInterfaceDecl which recursively destroy their owned Decls and Stmts. There are a few cases where it is not clear what to do (FIXMEs included in the patch). llvm-svn: 52050
* Fix <rdar://problem/5987482> clang on xcode: null dereference in ↵Steve Naroff2008-06-051-0/+22
| | | | | | | | Sema::ActOnMemberReferenceExpr. In addition to fixing the crasher, this commit fixes further improves property lookup (by searching protocols of qualified interfaces..."NSObject <prot>"). llvm-svn: 52001
* Make sure we look through categories when searching for a classes property.Steve Naroff2008-06-041-0/+7
| | | | | | Fixes <rdar://problem/5984338> clang on xcode: property implementation must have its declaration in interface 'PBXOpenQuicklyModule' llvm-svn: 51925
* fix free/delete mismatch problem in add/mergeProperties (found by valgrind)Nuno Lopes2008-05-101-4/+2
| | | | llvm-svn: 50945
* Synthesized getter/setter method declarations need not haveFariborz Jahanian2008-05-071-2/+3
| | | | | | | an implementation. This fixes couple of failing prperty tests caused by my previous patch. llvm-svn: 50830
* This patch introduces declaration of getter methods for ObjC2'sFariborz Jahanian2008-05-071-0/+30
| | | | | | | properties. Couple of property tests will fail with this patch. Will fix them next. llvm-svn: 50818
* percolate @optional/@required protocols down to ASTs forFariborz Jahanian2008-05-051-1/+2
| | | | | | properties declared in the protocol. llvm-svn: 50662
* This patch is about merging ObjC2's properties declared in classFariborz Jahanian2008-05-021-0/+27
| | | | | | | protocols into class's property list and performing semantics on them for while doing so. llvm-svn: 50587
* Patch to build AST for property implementation declarations andFariborz Jahanian2008-04-231-0/+9
| | | | | | to print declaration from its AST. llvm-svn: 50117
* Allow property in base class to be implemented in a Fariborz Jahanian2008-04-211-0/+4
| | | | | | derived class. llvm-svn: 50074
* Continuation of work on ObjC2's properties.Fariborz Jahanian2008-04-211-0/+55
| | | | | | | | Added iterators, methods to find property and categories. Use them in doing semantic analysis on property implementation declarations. Fixed typos. llvm-svn: 50050
OpenPOWER on IntegriCloud