summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Wire up redeclaration chains for Objective-C protocols, so that bothDouglas Gregor2012-01-011-37/+45
| | | | | | | forward declarations and definitions of an Objective-C protocol are represented within a single chain of ObjCProtocolDecls. llvm-svn: 147412
* Move the data that corresponds to the definition of a protocol into aDouglas Gregor2012-01-011-8/+17
| | | | | | | | | 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-12/+3
| | | | | | | covers both declarations (@class) and definitions (@interface) of an Objective-C class. llvm-svn: 147299
* objc QOI: Don't't warn about mismatch between attributes Fariborz Jahanian2011-12-211-2/+5
| | | | | | | on method declaration and definition if former is in a system header. // rdar://10580333 llvm-svn: 147020
* Fix chaining of ObjCInterfaceDecl redeclarationsDouglas Gregor2011-12-161-15/+9
| | | | llvm-svn: 146722
* Move ObjCInterfaceDecl's "EndLoc" into DefinitionData, since it onlyDouglas Gregor2011-12-151-9/+13
| | | | | | | | applies to an actual definition. Plus, clarify the purpose of this field and give the accessor a different name, since getLocEnd() is supposed to be the same as getSourceRange().getEnd(). llvm-svn: 146694
* Keep track of all declarations of an Objective-C class (both forwardDouglas Gregor2011-12-151-49/+42
| | | | | | | | | | 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
* Move the definition-specific data of ObjCInterfaceDecl into aDouglas Gregor2011-12-151-7/+11
| | | | | | | | | | | | | | | | 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
* Replace all comparisons between ObjCInterfaceDecl pointers with callsDouglas Gregor2011-12-151-4/+4
| | | | | | | | to declaresSameEntity(), as a baby step toward tracking forward declarations of Objective-C classes precisely. Part of <rdar://problem/10583531>. llvm-svn: 146618
* objc: diagnose duplicate declaration of methodsFariborz Jahanian2011-12-131-2/+14
| | | | | | in classes. // rdar://10535349 llvm-svn: 146504
* Make sure that we infer __strong, etc. when we instantiate variablesDouglas Gregor2011-12-101-0/+4
| | | | | | under ARC. Fixes <rdar://problem/10530209>. llvm-svn: 146307
* Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!Argyrios Kyrtzidis2011-12-091-1/+1
| | | | llvm-svn: 146213
* Extend warnings for missing '@end'.Erik Verbruggen2011-12-061-15/+32
| | | | | | Fixes PR2709. llvm-svn: 145928
* objc: put out more coherent warning when method definitionFariborz Jahanian2011-12-061-1/+3
| | | | | | attributes don't match its declaration. // rdar://10529259. llvm-svn: 145872
* When typo-correction an Objective-C superclass name, don'tDouglas Gregor2011-12-011-4/+9
| | | | | | typo-correct to ourselves. llvm-svn: 145583
* [libclang] Fix operations (token annotation, getting cursor, etc.) with a ↵Argyrios Kyrtzidis2011-11-231-0/+2
| | | | | | | | | | | | | | | file region inside an objc container that "contains" other file-level declarations. When getting the array of file-level declarations that overlap with a file region, we failed to report that the region overlaps with an objc container, if the container had other file-level declarations declared lexically inside it. Fix this by marking such declarations as "isTopLevelDeclInObjCContainer" in the AST and handling them appropriately. llvm-svn: 145109
* [libclang] Indexing API: Fix issues, mostly C++ related.Argyrios Kyrtzidis2011-11-231-2/+3
| | | | llvm-svn: 145107
* Use Sema::RequireCompleteType to check for the completeness ofDouglas Gregor2011-11-141-12/+20
| | | | | | | | | | Objective-C classes. This has two purposes: to consistently provide "forward declaration here" notes when we hit an incomplete type, and to give LLDB a chance to complete the type. RequireCompleteType bits from Sean Callanan! llvm-svn: 144573
* Don't crash when a duplicate interface/protocol is inside an extern "C" context.Argyrios Kyrtzidis2011-11-131-19/+32
| | | | llvm-svn: 144508
* Add a method in ASTMutationListener for the last use of Decl's ↵Argyrios Kyrtzidis2011-11-121-2/+5
| | | | | | | | [is/set]ChangedSinceDeserialization and remove them. llvm-svn: 144466
* [PCH] When completing an objc forward reference, do not serialize the chain ↵Argyrios Kyrtzidis2011-11-121-10/+6
| | | | | | | | | | | | | | | 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
* For the "'@end' is missing in implementation context" point at the location ↵Argyrios Kyrtzidis2011-10-271-1/+1
| | | | | | of '@'. llvm-svn: 143084
* Fixes a minor hick up to my last patch.Fariborz Jahanian2011-10-221-2/+6
| | | | llvm-svn: 142711
* objc: private methods can have their attributes, no diagnostic is required.Fariborz Jahanian2011-10-221-7/+30
| | | | | | | None private methods if their implementation have attribute, they must exactly match those in their declarations. // rdar://10271563 llvm-svn: 142709
* Introduce ASTConsumer::HandleTopLevelDeclInObjCContainer which acceptsArgyrios Kyrtzidis2011-10-171-0/+5
| | | | | | | | | | top-level declarations that occurred inside an ObjC container. This is useful to keep track of such decls otherwise when e.g. a function is declared inside an objc interface, it is not passed to HandleTopLevelDecl and it is not inside the DeclContext of the interface that is returned. llvm-svn: 142232
* Keep track when a ObjC interface/protocol was initially created as a forward ↵Argyrios Kyrtzidis2011-10-171-2/+4
| | | | | | reference. llvm-svn: 142230
* Really protect from infinite loop when there are objc method redeclarations.Argyrios Kyrtzidis2011-10-141-2/+2
| | | | | | Serialization part will come later. llvm-svn: 141950
* Keep track of objc method redeclarations in the same interface.Argyrios Kyrtzidis2011-10-141-0/+4
| | | | | | Avoid possible infinite loop when iterating over an ObjCMethod's redeclarations. llvm-svn: 141946
* Constant expression evaluation refactoring:Richard Smith2011-10-101-11/+8
| | | | | | | | | | | - Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions, and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert behaviour. - Factor out evaluation of bitfield bit widths. - Fix a few places which would evaluate an expression twice: once to determine whether it is a constant expression, then again to get the value. llvm-svn: 141561
* objc: Some refactoring of overriding method decl. codeFariborz Jahanian2011-10-101-14/+30
| | | | | | for future work. llvm-svn: 141553
* Implicitly assume that a ObjC category to an unavailable interface is also ↵Argyrios Kyrtzidis2011-10-061-3/+4
| | | | | | | | unavailable; only give an 'unavailable' error on the @implementation of the category. rdar://10234078 llvm-svn: 141335
* When using an unavailable/deprecated interface Foo inside Foo's ↵Argyrios Kyrtzidis2011-10-061-9/+9
| | | | | | | | interface/implementation don't emit unavailable errors. llvm-svn: 141334
* Fix the rewriter, rdar://10234024.Argyrios Kyrtzidis2011-10-051-1/+2
| | | | llvm-svn: 141201
* Improve location fidelity of objc decls.Argyrios Kyrtzidis2011-10-041-10/+10
| | | | | | | | -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-7/+8
| | | | | | | | | | | | | 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-3/+4
| | | | | | | | 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-2/+1
| | | | | | from the selector. llvm-svn: 140983
* Tweak -Wobjc-missing-super-calls to not warning about missing [super ↵Ted Kremenek2011-09-281-2/+3
| | | | | | dealloc] when in GC-only mode, and to not warning about missing [super finalize] when not using GC. llvm-svn: 140713
* objcetive-c-arc: When overriding a method, its ns_consumed patameterFariborz Jahanian2011-09-271-3/+30
| | | | | | | | attribute must match its overriden method. Same also for ns_returns_retained/not_retained on the result type. This is one half of // rdar://10187884 llvm-svn: 140649
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-3/+4
| | | | llvm-svn: 140478
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Give conversions of block pointers to ObjC pointers a different cast kindJohn McCall2011-09-091-1/+6
| | | | | | | | than conversions of C pointers to ObjC pointers. In order to ensure that we've caught every case, add asserts to CastExpr that strictly determine which cast kind is used for which kind of bit cast. llvm-svn: 139352
* Implement the Objective-C 'instancetype' type, which is an alias ofDouglas Gregor2011-09-081-17/+36
| | | | | | | | | | 'id' that can be used (only!) via a contextual keyword as the result type of an Objective-C message send. 'instancetype' then gives the method a related result type, which we have already been inferring for a variety of methods (new, alloc, init, self, retain). Addresses <rdar://problem/9267640>. llvm-svn: 139275
* objective-c: this patch (re)introduces objective-c's default propertyFariborz Jahanian2011-08-311-4/+0
| | | | | | | | | | synthesis. This new feature is currently placed under -fobjc-default-synthesize-properties option and is off by default pending further testing. It will become the default feature soon. // rdar://8843851 llvm-svn: 138913
* objective-c - This patch buffers method implementations Fariborz Jahanian2011-08-311-6/+14
| | | | | | | | | | | | | and does the Sema on their body after the entire class/category @implementation is seen. This change allows messaging of forward private methods, as well as, access to synthesized ivars of properties with foward synthesize declarations; among others. In effect, this patch removes several restrictions placed on objective-c due to in-place semantics processing of methods. This is part of // rdar://8843851. llvm-svn: 138865
* Remove a few mutating ObjCCategoryDecl methods.Argyrios Kyrtzidis2011-08-301-19/+10
| | | | | | | | | | | Remove -setClassInterface -setNextClassCategory -insertNextClassCategory and combine them in the Create function. llvm-svn: 138817
* Remove a couple of unnecessary objc method lookups.Argyrios Kyrtzidis2011-08-301-7/+7
| | | | llvm-svn: 138815
* Do not warn about [super finalize] in arc mode.Nico Weber2011-08-291-1/+3
| | | | llvm-svn: 138776
* Minor clean up of objc's decl context stuff.Fariborz Jahanian2011-08-291-0/+1
| | | | | | No change in functionality. llvm-svn: 138742
* Warn on missing [super finalize] calls.Nico Weber2011-08-281-2/+8
| | | | | | This matches gcc's logic. Second half of PR10661. llvm-svn: 138730
OpenPOWER on IntegriCloud