summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor Sema::LookupDecl() into 2 functions: LookupDeclInScope() and ↵Steve Naroff2009-01-291-8/+8
| | | | | | | | | | LookupDeclInContext(). The previous interface was very confusing. This is much more explicit, which will be easier to understand/optimize/convert. The plan is to eventually deprecate both of these functions. For now, I'm focused on performance. llvm-svn: 63256
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-1/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-201-8/+8
| | | | | | | | | | | | | | | | 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
* Type of property and its ivar is more restrictiveFariborz Jahanian2009-01-191-0/+15
| | | | | | that rules for assignment. llvm-svn: 62524
* Diagnose when method parameter is an object.Fariborz Jahanian2009-01-171-0/+5
| | | | llvm-svn: 62431
* Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr RakDouglas Gregor2009-01-121-18/+18
| | | | llvm-svn: 62122
* Patch to supprt case of readonly property being Fariborz Jahanian2009-01-121-0/+45
| | | | | | | | 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-10/+4
| | | | | | This completes the ObjCContainerDecl AST cleanup (for now). llvm-svn: 62037
* This patch removes mergeProperties and does the property lookupFariborz Jahanian2009-01-091-11/+2
| | | | | | in designated protocols lazily. llvm-svn: 62007
* Replace DeclContext's vector of ScopedDecl pointers with a linked listDouglas Gregor2009-01-091-6/+4
| | | | | | | | | | | | | | | | | | of ScopedDecls (using the new ScopedDecl::NextDeclInScope pointer). Performance-wise: - It's a net win in memory utilization, since DeclContext is now one pointer smaller than it used to be (std::vectors are typically 3 pointers; we now use 2 pointers) and - Parsing Cocoa.h with -fsyntax-only (with a Release-Asserts Clang) is about 1.9% faster than before, most likely because we no longer have the memory allocations and copying associated with the std::vector. I'll re-enable serialization of DeclContexts once I've sorted out the NextDeclarator/NextDeclInScope question. llvm-svn: 62001
* Provide a new kind of iterator, the specific_decl_iterator, thatDouglas Gregor2009-01-091-2/+2
| | | | | | | | | 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-42/+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
* Addressed the issue in <rdar://problem/6479085>, where we failed toDouglas Gregor2009-01-091-21/+50
| | | | | | | | | | | | | | | 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
* Adding support for ObjC methods which have c-styleFariborz Jahanian2009-01-091-0/+1
| | | | | | parameter list. This is work in progress. llvm-svn: 61964
* Move FIXME to a better location.Steve Naroff2009-01-081-5/+5
| | | | llvm-svn: 61937
* Removed ObjCContainerDecl::getPropertyMethods()...doesn't belong in the AST.Steve Naroff2009-01-081-1/+53
| | | | | | Moved logic to Sema::ProcessPropertyDecl(). llvm-svn: 61936
* This is a large/messy diff that unifies the ObjC AST's with DeclContext.Steve Naroff2009-01-081-56/+53
| | | | | | | | | | | | | | | - 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's compatibility-alias semantics and codeFariborz Jahanian2009-01-081-0/+9
| | | | | | gen issue fix. llvm-svn: 61901
* Allow Objective-C entities to be declared within a transparent contextDouglas Gregor2009-01-061-1/+1
| | | | | | nested in the translation unit. This fixes <rdar://problem/6476070>. llvm-svn: 61832
* Remove hasKind(). Use existing getKind().Fariborz Jahanian2008-12-291-2/+2
| | | | llvm-svn: 61476
* Patch to remove bogus warning in case of @dynamicFariborz Jahanian2008-12-221-5/+12
| | | | | | | property in a category and to issue diagnostics for mismatch method in some other cases. llvm-svn: 61336
* Finish up saving original parameter type andFariborz Jahanian2008-12-201-6/+16
| | | | | | using it in ObjC's method parameter encoding. llvm-svn: 61293
* This patch will build the Records lazily per Steve's comments.Fariborz Jahanian2008-12-171-1/+0
| | | | | | | Note that one test duplicate-ivar-check.m will fail because I need to re-implement duplicate ivar checking. llvm-svn: 61154
* Move the other Sema::ActOnLinkageSpec to SemaDeclCXX.Chris Lattner2008-12-171-2/+50
| | | | | | Move Sema::ActOnDefs to SemaDeclObjC llvm-svn: 61126
* Semantics of @protocol attributes.Fariborz Jahanian2008-12-171-3/+14
| | | | llvm-svn: 61114
* Silence a couple more operator precedence warnings; this shouldn't Eli Friedman2008-12-161-4/+4
| | | | | | | change the semantics. Please correct this if the precedence was actually supposed to be something different. llvm-svn: 61099
* Patch to check for ObjC's property type.Fariborz Jahanian2008-12-161-0/+4
| | | | llvm-svn: 61090
* Name of addLayoutToClass is confusing as no layout calculationFariborz Jahanian2008-12-151-1/+1
| | | | | | | is done. Layout is calculated lazily at code gen type. This patch changes the name. llvm-svn: 61054
* Add storage layout to ObjC classes.Fariborz Jahanian2008-12-131-0/+1
| | | | llvm-svn: 60993
* Unifies the name-lookup mechanisms used in various parts of the ASTDouglas Gregor2008-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Support for implementation of property in the case whereFariborz Jahanian2008-12-091-1/+1
| | | | | | | the synthesis is in an implementation of s subclass of a super class where the property has been declared. llvm-svn: 60792
* Sema::ActOnMethodDeclaration(): Make sure we perform the default ↵Steve Naroff2008-12-091-2/+7
| | | | | | | | | function/array conversion for parameter types. This fixes <rdar://problem/6424064> checker on xcode: (possible bad AST) can the type of a method parameter really have "isFunctionType() == true"? and http://llvm.org/bugs/show_bug.cgi?id=2997. llvm-svn: 60781
* Changed 'readonly' 'retain/copy' diagnostics intoFariborz Jahanian2008-12-081-2/+3
| | | | | | warning as it is allowed in gcc and will break projects. llvm-svn: 60710
* Since we do not allow a readonly property to be 'copy'retain', weFariborz Jahanian2008-12-081-5/+1
| | | | | | | must allow the continuation class to extend it to a 'readwrite' and 'copy/retain'. llvm-svn: 60709
* Move Sema::isTemplateParameterDecl to Decl::isTemplateParameter, where it ↵Douglas Gregor2008-12-081-2/+2
| | | | | | belongs llvm-svn: 60708
* Setters returning a typedef of 'void' should not cause error.Fariborz Jahanian2008-12-061-1/+2
| | | | | | Bug reported by Chris L. llvm-svn: 60635
* Use of properties declared in protocols in the categoryFariborz Jahanian2008-12-061-6/+56
| | | | | | | via the category's protocol list1s, with appropriate diagnsostics and a test case. llvm-svn: 60634
* Improve error reporting of property and setter/getterFariborz Jahanian2008-12-061-2/+6
| | | | | | type mimatches. llvm-svn: 60630
* Check for correct'void' return type for setter methods.Fariborz Jahanian2008-12-061-1/+1
| | | | llvm-svn: 60629
* Changed a 'FIXME' into new comment. Added a test caseFariborz Jahanian2008-12-061-1/+3
| | | | | | testing declaration of properties in categories. llvm-svn: 60625
* Patch to diagnose a variety of misuse of propertyFariborz Jahanian2008-12-061-4/+14
| | | | | | | attributes. Example would be, readonly, assign or assign, copy, etc. llvm-svn: 60620
* This test checks for duplicate implementation of the same Fariborz Jahanian2008-12-051-2/+33
| | | | | | | | 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
* (instance/class) Method type checking between class and its implementation.Fariborz Jahanian2008-12-051-23/+50
| | | | | | | (instance/class) Method type checking between category and its implementation. And a test case for all. llvm-svn: 60598
* Representation of template type parameters and non-type templateDouglas Gregor2008-12-051-0/+14
| | | | | | | | | | | | | | | parameters, with some semantic analysis: - Template parameters are introduced into template parameter scope - Complain about template parameter shadowing (except in Microsoft mode) Note that we leak template parameter declarations like crazy, a problem we'll remedy once we actually create proper declarations for templates. Next up: dependent types and value-dependent/type-dependent expressions. llvm-svn: 60597
* Patch for diagnosing type mismatch between Fariborz Jahanian2008-12-051-0/+28
| | | | | | | methods in class and its implementation. This is work in progress. llvm-svn: 60573
* Output better diagnostics for continuation classFariborz Jahanian2008-12-041-1/+1
| | | | | | property attribute mis-specification. llvm-svn: 60562
* More type-checking of setter/getter methods. This is stillFariborz Jahanian2008-12-021-3/+39
| | | | | | work in prgress. llvm-svn: 60430
* This patch corrects problem in searching for a setter/getter method forFariborz Jahanian2008-12-021-3/+3
| | | | | | | | 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
* Removed a FIXME. Added a test case for anonymous category.Fariborz Jahanian2008-11-261-4/+4
| | | | llvm-svn: 60115
* Set default property attributes on each property.Fariborz Jahanian2008-11-261-5/+74
| | | | | | | | Implemented anonymous category (also know as continuation class) used to override main class's property attribute. This is work in propgress. llvm-svn: 60114
OpenPOWER on IntegriCloud