summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't warn if objc method param types in declaration andFariborz Jahanian2009-11-181-3/+4
| | | | | | | | implementation mismatch in their qualifiers only. This will match similar behavior in c/c++ and fixes radar 7211653. llvm-svn: 89220
* Add SourceLocations to ObjCClassDecl for the class identifiers referenced by ↵Ted Kremenek2009-11-181-5/+3
| | | | | | @class. llvm-svn: 89170
* Pass source locations of identifiers referenced by @class through ↵Ted Kremenek2009-11-171-0/+1
| | | | | | Action::ActOnForwardClassDeclaration(). llvm-svn: 89162
* Do not register ObjCInterfaceDecls implicitly created by @class in theTed Kremenek2009-11-171-1/+14
| | | | | | | | | | | | | | | | | | current DeclContext. These "imaginary" declarations pose issues for clients searching DeclContext for actual declarations. Instead, register them for name lookup, and add the ObjCInterfaceDecl later to the DeclContext when we hit an actual @interface declaration. This also fixes a bug where the invariant that the Decls in a DeclContext are sorted in order of their appearance is no longer violated. What could happen is that an @class causes an ObjCInterfaceDecl to get added first to the DeclContext, then the ObjCClassDecl itself is added, and then later the SourceLocation of the ObjCInterfaceDecl is updated with the correct location (which is later in the file). This breaks an assumed invariant in ResolveLocation.cpp (and possibly other clients). llvm-svn: 89160
* Start support of weak_import objective-c classes.Fariborz Jahanian2009-11-171-0/+2
| | | | | | (Radar 6815425). llvm-svn: 89124
* Handle case of missing '@end' in implementation contextFariborz Jahanian2009-11-161-1/+6
| | | | | | | | gracefully, on par with gcc, by: Issuing a warning, doing final sematinc check of its definitions and generating its meta-data. llvm-svn: 88934
* writable atomic property's setter/getter must be in 'lock' step ofFariborz Jahanian2009-11-111-1/+38
| | | | | | | either both synthesized or bith user defined. Implements radar 6557233. llvm-svn: 86887
* Changed a variable name to match what it representsFariborz Jahanian2009-11-101-3/+3
| | | | | | (Ted's feedback). llvm-svn: 86702
* Since default writable attribute is 'assign', allowFariborz Jahanian2009-11-061-2/+1
| | | | | | | | | | specification of 'assign' (no warning to be issued), when a continuation class makes a 'readonly' attribute 'readwrite' but also specifies the 'assign' attribute. (this matches gcc's behavior and prevents exessive warnings)/ llvm-svn: 86297
* Change our basic strategy for avoiding deprecation warnings when the decl useJohn McCall2009-11-041-0/+10
| | | | | | | | | | | | appears in a deprecated context. In the new strategy, we emit the warnings as usual unless we're currently parsing a declaration, where "declaration" is restricted to mean a decl group or a few special cases in Objective C. If we *are* parsing a declaration, we queue up the deprecation warnings until the declaration has been completely parsed, and then emit them only if the decl is not deprecated. We also standardize the bookkeeping for deprecation so as to avoid special cases. llvm-svn: 85998
* Assortment of property attributes declared in continuationFariborz Jahanian2009-11-031-2/+9
| | | | | | | class must match those of same property declared in its primary class. (Fixes radar 7352425) llvm-svn: 85843
* Property declared in continuation class can only be used toFariborz Jahanian2009-11-021-12/+6
| | | | | | | change a readonly property declared in the class (and its inherited protocols) to writable property. (Fixes radar 7350645). llvm-svn: 85836
* Diagnose implementation of a property declared in a categoryFariborz Jahanian2009-11-021-0/+8
| | | | | | in its class implementation instead of crashing. Fixes radar 7350345. llvm-svn: 85813
* Remove OriginalTypeParmDecl; the original type is the one specifiedJohn McCall2009-10-231-16/+9
| | | | | | | | | | | | | in the DeclaratorInfo, if one is present. Preserve source information through template instantiation. This is made more complicated by the possibility that ParmVarDecls don't have DIs, which is possibly worth fixing in the future. Also preserve source information for function parameters in ObjC method declarations. llvm-svn: 84971
* Refactor the LookupResult API to simplify most common operations. Require ↵John McCall2009-10-091-8/+10
| | | | | | | | | users to pass a LookupResult reference to lookup routines. Call out uses which assume a single result. llvm-svn: 83674
* tweaked my last patch to 1) preserve the protocol inFariborz Jahanian2009-10-051-9/+11
| | | | | | | | | 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-2/+9
| | | | | | <rdar://problem/7269631> Protocols on class extensions don't work llvm-svn: 83322
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-3/+3
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* Make sure ObjCInterfaceDecl's that are forward declared always contain a ↵Steve Naroff2009-09-111-1/+5
| | | | | | valid location. llvm-svn: 81487
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-288/+286
| | | | llvm-svn: 81346
* patch to prevent crash in hopelessly incorrectFariborz Jahanian2009-08-281-0/+1
| | | | | | method definition with labels. llvm-svn: 80381
* Don't issue warning on multiple selector found when Fariborz Jahanian2009-08-221-2/+3
| | | | | | selector name is for a @selector expression. llvm-svn: 79776
* Use Sema's LocInfoType to pass and preserve type source info through the Parser.Argyrios Kyrtzidis2009-08-191-2/+2
| | | | llvm-svn: 79395
* Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema ↵Argyrios Kyrtzidis2009-08-191-1/+4
| | | | | | | | | | | | 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
* Fixed a regression in deciding when to issue warning on properties whichFariborz Jahanian2009-08-141-2/+4
| | | | | | implement NSCopying protocol in GC mode. llvm-svn: 79008
* error on property of objc interface type instead of crashingFariborz Jahanian2009-08-121-0/+2
| | | | llvm-svn: 78826
* Patch to warn if a property which is 'assign' by defaultFariborz Jahanian2009-08-111-1/+17
| | | | | | may not implement NSCopying protocol in -fobjc-gc[-only] mode. llvm-svn: 78726
* Canonicalize else.Mike Stump2009-08-041-27/+16
| | | | llvm-svn: 78102
* Some code refactoring. Be more generous in issuance of warningFariborz Jahanian2009-08-041-24/+34
| | | | | | on method type mismatches per Chris's comment. llvm-svn: 78075
* Compare matching selectors in current andFariborz Jahanian2009-08-041-0/+33
| | | | | | | super class(s) and warn on any parameter type mismatch if potentially unsafe. llvm-svn: 78029
* Make ObjCImplDecl inherit from ObjCContainerDecl.Argyrios Kyrtzidis2009-07-271-2/+2
| | | | | | ObjCContainerDecl now is the root class for objc decls that contain methods. llvm-svn: 77235
* Remove a bunch of FIXME's related to ObjC type checking.Steve Naroff2009-07-231-4/+5
| | | | | | | | - Move Sema::ObjCQualifiedIdTypesAreCompatible(), Sema::QualifiedIdConformsQualifiedId(), and a couple helper functions to ASTContext. - Change ASTContext::canAssignObjCInterfaces() to use ASTContext:: ObjCQualifiedIdTypesAreCompatible(). - Tweak several test cases to accommodate the new/improved type checking. llvm-svn: 76830
* Remove the ObjCCategoryImpls vector from Sema class.Argyrios Kyrtzidis2009-07-211-2/+0
| | | | | | Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality. llvm-svn: 76510
* Remove Sema::LookupObjCImplementation and replace it with just calling ↵Argyrios Kyrtzidis2009-07-211-4/+5
| | | | | | ObjCInterfaceDecl::getImplementation(). llvm-svn: 76509
* - Introduce ASTContext::getObjCImplementation() and ↵Argyrios Kyrtzidis2009-07-211-3/+27
| | | | | | | | | | | | 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
* Remove ASTContext::isObjCObjectPointerType().Steve Naroff2009-07-161-3/+5
| | | | | | Convert all clients to use the new predicate on Type. llvm-svn: 76076
* 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
* don't crash if class is using itself as its super class.Fariborz Jahanian2009-07-091-36/+42
| | | | llvm-svn: 75178
* De-ASTContext-ify DeclContext.Argyrios Kyrtzidis2009-06-301-81/+74
| | | | | | | 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
* Support dependent extended vector types and template instantiationDouglas Gregor2009-06-171-6/+6
| | | | | | thereof. Patch by Anders Johnsen! llvm-svn: 73641
* Adds synthesize ivars to DeclContext.Fariborz Jahanian2009-06-061-1/+6
| | | | llvm-svn: 73000
* More refactoring/cleanup of objc ivars.Fariborz Jahanian2009-06-041-22/+11
| | | | llvm-svn: 72871
* (Next runtime only) check to see if class implements forwardInvocation method Fariborz Jahanian2009-05-221-17/+34
| | | | | | | | | 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
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-1/+1
| | | | llvm-svn: 72210
* Reflow some comments.Mike Stump2009-05-161-13/+11
| | | | llvm-svn: 71936
* Don't warn if result/argument type of an implemented Fariborz Jahanian2009-05-141-2/+5
| | | | | | | method is a qualified id which conforms to the matching type of its method declaration. llvm-svn: 71817
* Method attributes may only be specified on methodFariborz Jahanian2009-05-121-0/+4
| | | | | | declarations. llvm-svn: 71597
* Fixes a bug in my last patch. Order of types reversed.Fariborz Jahanian2009-05-081-2/+1
| | | | llvm-svn: 71267
* Refactoring of my last patch.Fariborz Jahanian2009-05-081-16/+23
| | | | llvm-svn: 71248
* More type checking for properties, accessors andFariborz Jahanian2009-05-081-6/+12
| | | | | | use of dot-syntax expression. This is to match gcc's. llvm-svn: 71243
OpenPOWER on IntegriCloud