summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* propagate attributes onto property decls.Chris Lattner2009-02-161-5/+7
| | | | llvm-svn: 64643
* Untabify.Ben Laurie2009-02-161-2/+2
| | | | llvm-svn: 64628
* simplify some code.Chris Lattner2009-02-141-8/+7
| | | | llvm-svn: 64548
* Some name-lookup-related fixes, from Piotr Rak!Douglas Gregor2009-02-041-5/+5
| | | | | | | | | | | | | - Changes Lookup*Name functions to return NamedDecls, instead of Decls. Unfortunately my recent statement that it will simplify lot of code, was not quite right, but it simplifies some... - Makes MergeLookupResult SmallPtrSet instead of vector, following Douglas suggestions. - Adds %qN format for printing qualified names to Diagnostic. - Avoids searching for using-directives in Scopes, which are not DeclScope, during unqualified name lookup. llvm-svn: 63739
* Fix <rdar://problem/6552648> error: redefinition of ↵Steve Naroff2009-02-041-12/+27
| | | | | | | | 'XCElementAnchorDelegate' as different kind of symbol. At first glance, this looked like a recent regression (possibly created by http://llvm.org/viewvc/llvm-project?view=rev&revision=63354, which was the only recent change to this section of Sema::ActOnStartClassInterface()). After more investigation, it looks like an edge case bug that we didn't cover in our tests. llvm-svn: 63738
* Add a macro-based enumeration of all of the Decl nodes (like we doDouglas Gregor2009-02-021-4/+4
| | | | | | | with Stmt/Expr nodes), and convert some of the more mundane switch-on-all-decl-kinds uses over to use this new file. llvm-svn: 63570
* Eliminated LookupCriteria, whose creation was causing a bottleneck forDouglas Gregor2009-01-301-8/+8
| | | | | | | | | | | | | | | | | | LookupName et al. Instead, use an enum and a bool to describe its contents. Optimized the C/Objective-C path through LookupName, eliminating any unnecessarily C++isms. Simplify IdentifierResolver::iterator, removing some code and arguments that are no longer used. Eliminated LookupDeclInScope/LookupDeclInContext, moving all callers over to LookupName, LookupQualifiedName, or LookupParsedName, as appropriate. All together, I'm seeing a 0.2% speedup on Cocoa.h with PTH and -disable-free. Plus, we're down to three name-lookup routines. llvm-svn: 63354
* diags moved, so these casts are no longer needed.Chris Lattner2009-01-291-2/+2
| | | | llvm-svn: 63324
* Suppress a warningDouglas Gregor2009-01-291-2/+2
| | | | llvm-svn: 63310
* move library-specific diagnostic headers into library private dirs. ReduceChris Lattner2009-01-291-1/+0
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* 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
OpenPOWER on IntegriCloud