summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make getDefaultSynthIvarName() a member of ObjCPropertyDecl.Anna Zaks2012-09-271-0/+11
| | | | llvm-svn: 164789
* Mark ObjCInterfaceDecl::lookupPrivateMethod as const.Anna Zaks2012-07-301-1/+1
| | | | llvm-svn: 160989
* Consolidate ObjC lookupPrivateMethod methods from Sema and DeclObjC.Anna Zaks2012-07-271-1/+20
| | | | | | | | | | | | | Also, fix a subtle bug, which occurred due to lookupPrivateMethod defined in DeclObjC.h not looking up the method inside parent's categories. Note, the code assumes that Class's parent object has the same methods as what's in the Root class of a the hierarchy, which is a heuristic that might not hold for hierarchies which do not descend from NSObject. Would be great to fix this in the future. llvm-svn: 160885
* Remove HasSynthBitfield and all callers/writers/etc. Also removeEric Christopher2012-07-191-9/+3
| | | | | | | | previous ResetObjCLayout calls since this is now handled in Sema. Part of rdar://11842763 llvm-svn: 160527
* [AST/libclang] Fix the selector locations that are reported for aArgyrios Kyrtzidis2012-06-161-1/+8
| | | | | | | | | | | | | | | | | | | | | | method definition that has its '{' attached to the method name without a space. With a method like: -(id)meth{ ..... } the logic in ObjCMethodDecl that determined the selector locations got confused because it was initialized based on an end location for '{' but that end location changed to '}' after the method was finished. Fix this by having an immutable end location for the declarator and for getLocEnd() get the end location from the body itself. Fixes rdar://11659739. llvm-svn: 158583
* Documentation cleanup: escape Objective-C @keywords in Doxygen comments.James Dennett2012-06-151-3/+3
| | | | llvm-svn: 158565
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-061-11/+11
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-11/+11
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* objective-c: Don't warn when a category does not implement a methodFariborz Jahanian2012-04-051-10/+12
| | | | | | | declared in its adopted protocol when another category declares it because that category will implement it. // rdar://11186449 llvm-svn: 154132
* [Sema] Prefer to use ObjCInterfaceDecl's protocol_begin()/protocol_end() ↵Argyrios Kyrtzidis2012-03-131-9/+5
| | | | | | | | | iterators instead of ObjCInterfaceDecl::getReferencedProtocols(), because the iterators are safe to use even if the caller did not check that the interface is a definition. llvm-svn: 152597
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-1/+1
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* [Sema] Fix crash-on-invalid-code issue:Argyrios Kyrtzidis2012-03-021-0/+4
| | | | | | | | | | @class I; @implementation I(cat) // crashes here @end rdar://10968158 llvm-svn: 151931
* objective-c: provide fixit hint when atomic property does notFariborz Jahanian2012-02-291-1/+3
| | | | | | | have matching user defined setter/getter and a warning is issued. In this case, a fixit note is displayed. // rdar://10267155 llvm-svn: 151766
* modern objc translator. Finish off first cut of theFariborz Jahanian2012-02-201-4/+10
| | | | | | | modern meta-data translation by commenting out private ivar declarations in user source. Also, added several tests. llvm-svn: 150985
* objc: If a method is not implemented in the category implementation butFariborz Jahanian2012-02-091-15/+17
| | | | | | | | has been declared in its primary class, superclass, or in one of their protocols, no need to issue unimplemented method. // rdar://10823023 llvm-svn: 150206
* Switch the ObjC*Decl raw_stream overloads to take a reference, for ↵Benjamin Kramer2012-02-071-4/+4
| | | | | | consistency with NamedDecls. llvm-svn: 149981
* Delay the creation of the built-in Objective-C class 'Protocol' byDouglas Gregor2012-01-171-1/+1
| | | | | | | moving it from a "special type" to a predefined declaration, as we do for id, Class, and SEL. llvm-svn: 148313
* When deserializing the definition of a C++ class/ObjC class/ObjCDouglas Gregor2012-01-151-6/+0
| | | | | | | | | | | | | | | protocol, record the definition pointer in the canonical declaration for that entity, and then propagate that definition pointer from the canonical declaration to all other deserialized declarations. This approach works well even when deserializing declarations that didn't know about the original definition, which can occur with modules. A nice bonus from this definition-deserialization approach is that we no longer need update records when a definition is added, because the redeclaration chains ensure that the if any declaration is loaded, the definition will also get loaded. llvm-svn: 148223
* When creating declarations that are deserialized from an module file,Douglas Gregor2012-01-051-6/+70
| | | | | | | go through a central allocation routine Decl::AllocateDeserializedDecl(). No actual functionality change (yet). llvm-svn: 147614
* Eliminate the ForwardDecl/InitiallyForwardDecl bits from ObjCProtocolDecl. ↵Douglas Gregor2012-01-011-10/+4
| | | | | | They are no longer needed llvm-svn: 147419
* Eliminate ObjCForwardProtocolDecl, which is redundant now thatDouglas Gregor2012-01-011-24/+0
| | | | | | ObjCProtocolDecl modules forward declarations properly. llvm-svn: 147415
* Wire up redeclaration chains for Objective-C protocols, so that bothDouglas Gregor2012-01-011-7/+22
| | | | | | | forward declarations and definitions of an Objective-C protocol are represented within a single chain of ObjCProtocolDecls. llvm-svn: 147412
* Introduce the core infrastructure needed to model redeclaration chainsDouglas Gregor2012-01-011-1/+7
| | | | | | | | | | | | | | | for Objective-C protocols, including: - Using the first declaration as the canonical declaration - Using the definition as the primary DeclContext - Making sure that all declarations have a pointer to the definition data, and that we know which declaration is the definition - Serialization support for redeclaration chains and for adding definitions to already-serialized declarations. However, note that we're not taking advantage of much of this code yet, because we're still re-using ObjCProtocolDecls. llvm-svn: 147410
* Move the data that corresponds to the definition of a protocol into aDouglas Gregor2012-01-011-1/+11
| | | | | | | | | separately-allocated DefinitionData structure. Introduce various functions that will help with the separation of declarations from definitions (isThisDeclarationADefinition(), hasDefinition(), getDefinition()). llvm-svn: 147408
* Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDeclDouglas Gregor2011-12-271-22/+0
| | | | | | | covers both declarations (@class) and definitions (@interface) of an Objective-C class. llvm-svn: 147299
* objective-c: Use class definition AST in several situations whenFariborz Jahanian2011-12-231-0/+4
| | | | | | | building related objc ASTs which require a class definition AST. These were uncovered when testing objc rewriter. llvm-svn: 147210
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+24
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
* Make sure we're always setting the previous declaration of an ObjCInterfaceDeclDouglas Gregor2011-12-161-9/+10
| | | | llvm-svn: 146763
* If there is a definition of an ObjCInterfaceDecl, make it the Decl returned ↵Douglas Gregor2011-12-161-1/+5
| | | | | | from the corresponding ObjCInterfaceType llvm-svn: 146740
* Fix chaining of ObjCInterfaceDecl redeclarationsDouglas Gregor2011-12-161-14/+22
| | | | llvm-svn: 146722
* Keep track of all declarations of an Objective-C class (both forwardDouglas Gregor2011-12-151-14/+22
| | | | | | | | | | declarations and definitions) as ObjCInterfaceDecls within the same redeclaration chain. This new representation matches what we do for C/C++ variables/functions/classes/templates/etc., and makes it possible to answer the query "where are all of the declarations of this class?" llvm-svn: 146679
* Extend ObjCInterfaceDecl::DefinitionData to contain a pointer to theDouglas Gregor2011-12-151-4/+4
| | | | | | | definition, and implement ObjCInterfaceDecl::getDefinition() efficiently based on that. llvm-svn: 146669
* Introduce the core infrastructure needed to model a completeDouglas Gregor2011-12-151-1/+9
| | | | | | | | | | | | | | | redeclaration chain for Objective-C classes, including: - Using the first declaration as the canonical declaration. - Using the definition as the primary DeclContext - Making sure that all declarations have a pointer to the definition data, and the definition knows that it is the definition. - Serialization support for when a definition gets added to a declaration that comes from an AST file. However, note that we're not taking advantage of much of this code yet, because we're still re-using ObjCInterfaceDecls. llvm-svn: 146667
* Move the definition-specific data of ObjCInterfaceDecl into aDouglas Gregor2011-12-151-36/+72
| | | | | | | | | | | | | | | | separately-allocated DefinitionData structure, which we manage the same way as CXXRecordDecl::DefinitionData. This prepares the way for making ObjCInterfaceDecls redeclarable, to more accurately model forward declarations of Objective-C classes and eliminate the mutation of ObjCInterfaceDecl that causes us serious trouble in the AST reader. Note that ObjCInterfaceDecl's accessors are fairly robust against being applied to forward declarations, because Clang (and Sema in particular) doesn't perform RequireCompleteType/hasDefinition() checks everywhere it has to. Each of these overly-robust cases is marked with a FIXME, which we can tackle over time. llvm-svn: 146644
* Eliminate the vistigial ObjCClassDecl::ObjCClassRef, and inline itsDouglas Gregor2011-12-141-18/+8
| | | | | | | members into ObjCClassDecl, saving ourselves one pointer per forward declaration. llvm-svn: 146564
* Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!Argyrios Kyrtzidis2011-12-091-2/+3
| | | | llvm-svn: 146213
* Use Decl's isImplicit field to indicate whether an ObjCInterfaceDecl is ↵Argyrios Kyrtzidis2011-11-151-1/+2
| | | | | | | | 'ImplicitInterfaceDecl', no need to store it in another field. llvm-svn: 144624
* ARC: make assignment to 'self' within class methods illegal. Fixes ↵Ted Kremenek2011-11-141-11/+20
| | | | | | <rdar://problem/10416568>. llvm-svn: 144572
* [PCH] When completing an objc forward reference, do not serialize the chain ↵Argyrios Kyrtzidis2011-11-121-0/+14
| | | | | | | | | | | | | | | of its categories because it is going to be rewritten (and the chain will be serialized again), otherwise we may form a cycle in its categories list when deserializing. Also introduce ASTMutationListener::CompletedObjCForwardRef to notify that a forward reference was completed; using Decl's isChangedSinceDeserialization/setChangedSinceDeserialization is bug inducing and kinda gross, we should phase it out. Fixes infinite loop in rdar://10418538. llvm-svn: 144465
* Relax restriction of assigning to 'self' in ARC when a method is attributed ↵Ted Kremenek2011-10-251-2/+2
| | | | | | with ns_consumes_self. Fixes <rdar://problem/10274056>. llvm-svn: 142909
* Don't forget to complete the objc interface before asking for information,Argyrios Kyrtzidis2011-10-191-0/+9
| | | | | | otherwise lldb will suffer. llvm-svn: 142471
* Have ObjCMethodDecl::getCanonicalDecl take into account redeclared methods.Argyrios Kyrtzidis2011-10-171-0/+4
| | | | llvm-svn: 142231
* Keep track when a ObjC interface/protocol was initially created as a forward ↵Argyrios Kyrtzidis2011-10-171-4/+6
| | | | | | reference. llvm-svn: 142230
* [PCH] Serialize info about redeclared objc methods.Argyrios Kyrtzidis2011-10-141-2/+4
| | | | llvm-svn: 141964
* Really protect from infinite loop when there are objc method redeclarations.Argyrios Kyrtzidis2011-10-141-0/+12
| | | | | | Serialization part will come later. llvm-svn: 141950
* Keep track of objc method redeclarations in the same interface.Argyrios Kyrtzidis2011-10-141-1/+5
| | | | | | Avoid possible infinite loop when iterating over an ObjCMethod's redeclarations. llvm-svn: 141946
* Improve location fidelity of objc decls.Argyrios Kyrtzidis2011-10-041-12/+17
| | | | | | | | -Add the location of the class name to all objc container decls, not just ObjCInterfaceDecl. -Make objc decls consistent with the rest of the NamedDecls and have getLocation() point to the class name, not the location of '@'. llvm-svn: 141061
* Allow getting all source locations of selector identifiers in a ObjCMethodDecl.Argyrios Kyrtzidis2011-10-031-1/+36
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. llvm-svn: 140989
* Pass from the parser the locations of selector identifiers when creatingArgyrios Kyrtzidis2011-10-031-0/+1
| | | | | | | | objc method decls. They are not stored in the AST yet. llvm-svn: 140984
* Don't keep NumSelectorArgs in the ObjCMethodDecl, the number can be derived ↵Argyrios Kyrtzidis2011-10-031-4/+2
| | | | | | from the selector. llvm-svn: 140983
OpenPOWER on IntegriCloud