summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* objective-c: Treat top-level objective-c declarationsFariborz Jahanian2011-08-271-13/+9
| | | | | | | | | | , such as list of forward @class decls, in a DeclGroup node. Deal with its consequence throught clang. This is in preparation for more Sema work ahead. // rdar://8843851. Feel free to reverse if it breaks something important and I am unavailable. llvm-svn: 138709
* Don't warn on category implementing a method, if Fariborz Jahanian2011-08-251-1/+1
| | | | | | | declated method in the class belongs to a synthesized property getter/setter. // rdar://10014946 llvm-svn: 138598
* objc - fix a bug exposed by my recent decl contextFariborz Jahanian2011-08-251-0/+3
| | | | | | changes. // rdar://10015110 llvm-svn: 138594
* Reverse r138567 until a buildbot failure is investigated.Fariborz Jahanian2011-08-251-11/+11
| | | | llvm-svn: 138584
* Fixes a typo in my last patch.Fariborz Jahanian2011-08-251-1/+1
| | | | llvm-svn: 138571
* objc -arse: Use DeclGroup for forward class declarations;Fariborz Jahanian2011-08-251-11/+11
| | | | | | as in @class foo, bar. More cleanup to follow. llvm-svn: 138567
* Do not perform check for missing '[super dealloc]' under ARC as calling ↵Ted Kremenek2011-08-221-1/+3
| | | | | | -dealloc is illegal in that mode. llvm-svn: 138261
* objc - minor comment fix up and cleanup.Fariborz Jahanian2011-08-221-2/+2
| | | | llvm-svn: 138253
* Warn on missing [super dealloc] calls.Nico Weber2011-08-221-3/+11
| | | | | | This matches gcc's logic. Half of PR10661. llvm-svn: 138240
* Restore patch I reversed in r138040. Known buildbotFariborz Jahanian2011-08-221-9/+15
| | | | | | failures are resolved. llvm-svn: 138234
* Revers r138040. Need to look at a few buildbot failures.Fariborz Jahanian2011-08-191-15/+9
| | | | llvm-svn: 138049
* objective-c: Bring objective-c handling of decl contextFariborz Jahanian2011-08-191-9/+15
| | | | | | | | | | to modernity. Instead of passing down individual context objects from parser to sema, establish decl context in parser and have sema access current context as needed. I still need to take of Doug's comment for minor cleanups. llvm-svn: 138040
* Mark objc methods that are implicitly declared for properties (not ↵Argyrios Kyrtzidis2011-08-171-1/+2
| | | | | | | | user-declared) as implicit. This results in libclang ignoring such methods. llvm-svn: 137852
* objective-c: Using existing infrastructure for finding Fariborz Jahanian2011-08-101-266/+51
| | | | | | | | | overridden methods to diagnose their type mismatch. This is a general solution for previous fixes for // rdar://6191214 and // rdar://9352731 and removes lots of duplicate code. llvm-svn: 137222
* objective-c: diagnose protocol inconsistencies in following Fariborz Jahanian2011-08-081-1/+138
| | | | | | | | | situation. When a class explicitly or implicitly (through inheritance) "conformsTo" two protocols which conflict (have methods which conflict). This patch fixes the previous patch where warnings were coming out in non-deterministic order. This is 2nd part of // rdar://6191214. llvm-svn: 137055
* Silence the category-replacing-class-method warning for +load: categoryDavid Chisnall2011-08-081-0/+3
| | | | | | | | implementations of +load do not replace the class definition in a meaningful sense, they are run when the category loads, the +load method for class is run when the class is loaded. llvm-svn: 137053
* Revert 136984 and 136927.Ted Kremenek2011-08-051-126/+1
| | | | llvm-svn: 136998
* objective-c: diagnose protocol inconsistencies in following Fariborz Jahanian2011-08-041-1/+126
| | | | | | | | situation. When a class explicitly or implicitly (through inheritance) "conformsTo" two protocols which conflict (have methods which conflict). This is 2nd part of // rdar://6191214. llvm-svn: 136927
* Refactoring of my last patch.Fariborz Jahanian2011-08-031-40/+33
| | | | llvm-svn: 136841
* objective-c: Methods declared in methods must type matchFariborz Jahanian2011-08-031-86/+101
| | | | | | those declated in its protocols. First half or // rdar://6191214 llvm-svn: 136794
* objective-c: warn if implementation of a method in categoryFariborz Jahanian2011-07-281-34/+142
| | | | | | | | | | masks an existing method in its primary class, class extensions, and primary class's non-optional protocol methods; as primary class, or one of its subclass's will implement this method. This warning has potential of being noisy so it has its own group. // rdar://7020493 llvm-svn: 136426
OpenPOWER on IntegriCloud