aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
AgeCommit message (Collapse)Author
2009-07-27Make ObjCImplDecl inherit from ObjCContainerDecl.Argyrios Kyrtzidis
ObjCContainerDecl now is the root class for objc decls that contain methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23Remove a bunch of FIXME's related to ObjC type checking.Steve Naroff
- 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76830 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21Remove the ObjCCategoryImpls vector from Sema class.Argyrios Kyrtzidis
Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21Remove Sema::LookupObjCImplementation and replace it with just calling ↵Argyrios Kyrtzidis
ObjCInterfaceDecl::getImplementation(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21- Introduce ASTContext::getObjCImplementation() and ↵Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76508 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16Remove ASTContext::isObjCObjectPointerType().Steve Naroff
Convert all clients to use the new predicate on Type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-10This patch includes a conceptually simple, but very intrusive/pervasive change. Steve Naroff
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-09don't crash if class is using itself as its super class.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75178 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30De-ASTContext-ify DeclContext.Argyrios Kyrtzidis
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-17Support dependent extended vector types and template instantiationDouglas Gregor
thereof. Patch by Anders Johnsen! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06Adds synthesize ivars to DeclContext.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04More refactoring/cleanup of objc ivars.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22(Next runtime only) check to see if class implements forwardInvocation method Fariborz Jahanian
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-21Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-16Reflow some comments.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71936 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14Don't warn if result/argument type of an implemented Fariborz Jahanian
method is a qualified id which conforms to the matching type of its method declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71817 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12Method attributes may only be specified on methodFariborz Jahanian
declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08Fixes a bug in my last patch. Order of types reversed.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08Refactoring of my last patch.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71248 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08More type checking for properties, accessors andFariborz Jahanian
use of dot-syntax expression. This is to match gcc's. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07Add a warning for a missing copy attribute on a property that is aMike Stump
block pointer. Radar 6441502 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07a forward class declaration matching a typedef name of a classFariborz Jahanian
refers to the underlying class. This is radar 6859726. Steve, please read the radar for my rational. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04Remove support for ObjCMethodDecl attributes that appear between theTed Kremenek
return type and the selector. This is inconsistent with C functions (where such attributes would be placed on the return type, not the the FunctionDecl), and is inconsistent with what people are use to seeing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01Check for method type conflict between declaration inFariborz Jahanian
class/protocol and implementation which could be an imm. implementation or down in the inheritance hierarchy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70568 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30Use of super class ivar to synthesize property is back to being error.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70514 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30Hook up Sema support for attributes on Objective-C method declarations thatTed Kremenek
appear between the return type and the selector. This is a separate code path from regular attribute processing, as we only want to (a) accept only a specific set of attributes in this place and (b) want to distinguish to clients the context in which an attribute was added to an ObjCMethodDecl. Currently, the attribute 'objc_ownership_returns' is the only attribute that uses this new feature. Shortly I will add a warning for 'objc_ownership_returns' to be placed at the end of a method declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29Change to warning when property uses an ivar in super classFariborz Jahanian
in an @synthesize diective, as it breaks few projects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70441 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29use of an ivar specified on a property @synthesizeFariborz Jahanian
and found in super class triggers a diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24Fix a pasto in the lookup of instance methods in the global poolDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69996 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24PCH support for the global method pool (= instance and factory methodDouglas Gregor
pools, combined). The methods in the global method pool are lazily loaded from an on-disk hash table when Sema looks into its version of the hash tables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69989 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24Eliminate Sema::ObjCAliasDecls. This is based on Steve's fix, but alsoDouglas Gregor
updates name lookup so that we see through @compatibility_alias declarations to their underlying interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24Fix Objective-C crashesDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69945 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24Eliminate Sema::ObjCInterfaceDeclsDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69942 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's ↵Douglas Gregor
good for uniformity is good for PCH (or is it the other way around?). As part of this, make ObjCImplDecl inherit from NamedDecl (since ObjCImplementationDecls now need to have names so that they can be found). This brings ObjCImplDecl very, very close to ObjCContainerDecl; we may be able to merge them soon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69941 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23Eliminate Sema::ObjCProtocols. Instead, we place ObjCProtocolDecls inDouglas Gregor
their own namespace (IDNS_Protocol) and use the normal name-lookup routines to find them. Aside from the simplification this provides (one less DenseMap!), it means that protocols will be lazily deserialized from PCH files. Make the code size of the selector table block match the code size of the type and decl blocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69939 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23Diagnose if an implementation implements a forward classFariborz Jahanian
declaration (and avoid issuing bogus error later on). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69928 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23Remove @compatibility_alias regression.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69899 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23More PushOnScopeChain() FIXME's.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23Sema::ActOnStartClassInterface(): Use PushOnScopeChains().Steve Naroff
This enables class recognition to work with PCH. I believe this means we can remove Sema::ObjCInterfaceDecls and it's usage within Sema::LookupName(). Will investigate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69891 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23Eliminate the three SmallVectors in ObjCImplDecl (for instanceDouglas Gregor
methods, class methods, and property implementations) and instead place all of these entities into the DeclContext. This eliminates more linear walks when looking for class or instance methods and should make PCH (de-)serialization of ObjCDecls trivial (and lazy). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21Make sure to mark the interface as completed when we see anDaniel Dunbar
@implementation that closes a @class delcaration. - I don't know how to make a test case for this, but this strengthens the invariants that hold internally. The functionality change here is the edit to SemaDeclObjC.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69728 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21Patch to diagnose use of objc's @defs in nonfragile abi.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69710 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ↵Steve Naroff
ObjCIvarDecl. Next step: Add selector support to PCHWriter::AddDeclarationName(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20Add pch reader/writer support for ObjCMethodDecl.Steve Naroff
Test will be enabled with ObjCInterfaceDecl is added. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19add a new Sema::CurFunctionNeedsScopeChecking bool that is used to avoid Chris Lattner
calling into the jump checker when a function or method is known to contain no VLAs or @try blocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15Patch to remove a bogus warning which pointed to underlying ASTFariborz Jahanian
gen. issue for property in continuation class declared readwrite but which did not generate the declaration for the setter. Fix also removed a FIXME and resulted in code cleanup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69200 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14Diagnose properties which have no implementations;Fariborz Jahanian
either unimplemented setter/getter or no implementation directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-14Audit __private_extern__ handling.Daniel Dunbar
- Exposed quite a few Sema issues and a CodeGen crash. - See FIXMEs in test case, and in SemaDecl.cpp (PR3983). I'm skeptical that __private_extern__ should actually be a storage class value. I think that __private_extern__ basically amounts to extern A __attribute__((visibility("hidden"))) and would be better off handled (a) as that, or (b) with an extra bit in the VarDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13In objc2's None-Fragile ABI, one cannot use the super class ivar forFariborz Jahanian
setter/getter synthesis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68976 91177308-0d34-0410-b5e6-96231b3b80d8