summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* More code conformance.Fariborz Jahanian2013-07-171-1/+1
| | | | llvm-svn: 186474
* This patch removes unused parameter allProperties and converts remainingFariborz Jahanian2013-07-161-10/+6
| | | | | | | parameters in ArrayRef'ize Sema::ActOnAtEnd to ArrayRef. Patch by Robert Wilhelm. llvm-svn: 186421
* Objective-C: merge objc_requires_super attribute ofFariborz Jahanian2013-07-091-1/+9
| | | | | | | | | method declaration into its implementation to prevent a bogus warning about mismatched attributes. then make sure the warning about missing call to super comes out of the method implementation. // rdar://14251387 llvm-svn: 185974
* ArrayRef'ize Sema::FinalizeDeclaratorGroup, Sema::BuildDeclaratorGroup andRafael Espindola2013-07-091-4/+4
| | | | | | | | Sema::ActOnDocumentableDecls. Patch by Robert Wilhelm. llvm-svn: 185931
* Remove some useless declarations (found by scan-build)Sylvestre Ledru2013-07-061-1/+0
| | | | llvm-svn: 185752
* ObjectiveC: diagnose duplicate declaration ofFariborz Jahanian2013-06-261-0/+13
| | | | | | | private ivars in class extensions and class @implementation. // rdar://14278560 llvm-svn: 185025
* Don't use unnamed local enums as template arguments.Joerg Sonnenberger2013-06-261-2/+2
| | | | | | Fixes -Werror bootstrap. llvm-svn: 185023
* [Sema] Call CheckParmForFunctionDef on ObjC method parametersReid Kleckner2013-06-241-4/+4
| | | | | | | CheckParmForFunctionDef performs standard checks for type completeness and other things like a destructor check for the MSVC++ ABI. llvm-svn: 184740
* Delete dead code.Eli Friedman2013-06-211-7/+0
| | | | llvm-svn: 184520
* Delete dead code.Eli Friedman2013-06-211-4/+1
| | | | llvm-svn: 184517
* When building a module, keep *all* declared methods in the global method pool.Douglas Gregor2013-06-211-0/+4
| | | | | | | | | | | | | | | | | As an optimization, we only kept declared methods with distinct signatures in the global method pool, to keep the method lists small. Under modules, however, one could have two different methods with the same signature that occur in different (sub)modules. If only the later submodule is important, message sends to 'id' with that selector would fail because the first method (the only one that got into the method pool) was hidden. When building a module, keep *all* of the declared methods. I did a quick check of both module build time and uses of modules, and found no performance regression despite this causing us to keep more methods in the global method pool. Fixes <rdar://problem/14148896>. llvm-svn: 184504
* When declaring an ObjC interface decl with a @compatibility_alias alias ↵Argyrios Kyrtzidis2013-06-181-1/+36
| | | | | | | | | | | | | | | | | | name, change the class name to the "real" one. If we have something like @class NewImage; @compatibility_alias OldImage NewImage; @class OldImage; the lookup for 'OldImage' will return the 'NewImage' decl ("@class NewImage"). In such a case, when creating the decl for "@class OldImage" use the real declaration name ("NewImage"), instead of the alias one ("OldImage"), otherwise we will break IdentifierResolver and redecls-chain invariants. Fixes crash of rdar://14112291. llvm-svn: 184238
* Objective-C: Fixes a typo correction bug where aFariborz Jahanian2013-06-181-2/+4
| | | | | | | selector would be correted to identical selector name in certain corner cases. // rdar://7853549 llvm-svn: 184208
* Objective-C [qoi]: privide typo correction for selectorsFariborz Jahanian2013-06-181-6/+30
| | | | | | | | in addition of receiver having static type, but also when receiver has dynamic type (of 'id' variety) as well as when receiver is of 'Class' type vareity. // rdar://7853549 llvm-svn: 184195
* Objective-C [qoi]: Provide fixit hint when message with typoFariborz Jahanian2013-06-171-3/+15
| | | | | | is sent to a receiver object. This is wip. // rdar://7853549 llvm-svn: 184086
* Unify return type checking for functions and ObjC methods. Move all theEli Friedman2013-06-141-14/+3
| | | | | | | | random checks for ObjC object return types to SemaType.cpp. Fixes issue with ObjC method type checking reported on cfe-dev. llvm-svn: 184006
* Don't create a StringRef from a temporary string.Richard Trieu2013-06-061-1/+1
| | | | llvm-svn: 183372
* Objective-C: Provide fixit with suggested spelling correctionFariborz Jahanian2013-06-051-0/+51
| | | | | | for -Wundeclared-selector warnings. // rdar://14039037 llvm-svn: 183331
* fixes a comment in my last patch.Fariborz Jahanian2013-05-301-1/+1
| | | | llvm-svn: 182966
* Objective-C: Implements gcc's -Wselector optionFariborz Jahanian2013-05-301-1/+48
| | | | | | | | which diagnoses type mismatches of identical selectors declared in classes throughout. // rdar://14007194 llvm-svn: 182964
* Fix potential infinite loop when iterating over redeclarations of an ↵Argyrios Kyrtzidis2013-05-301-0/+2
| | | | | | | | | | | ObjMethodDecl, resulting from invalid code. Check for invalid decls in ObjCMethodDecl::getNextRedeclaration(); otherwise if we start from an invalid redeclaration of an @implementation we would move to the @interface and not reach the original declaration again. Fixes rdar://14024851 llvm-svn: 182951
* Objective-C arc: Diagnose when user attempts toFariborz Jahanian2013-05-161-1/+1
| | | | | | | | synthesize a property getter method that overrides a method definition named 'retain' and the like. Fixes // rdar://13885083 llvm-svn: 182039
* Use only explicit bool conversion operatorDavid Blaikie2013-05-151-1/+1
| | | | | | | | | | | | | | | | | | | The most common (non-buggy) case are where such objects are used as return expressions in bool-returning functions or as boolean function arguments. In those cases I've used (& added if necessary) a named function to provide the equivalent (or sometimes negative, depending on convenient wording) test. DiagnosticBuilder kept its implicit conversion operator owing to the prevalent use of it in return statements. One bug was found in ExprConstant.cpp involving a comparison of two PointerUnions (PointerUnion did not previously have an operator==, so instead both operands were converted to bool & then compared). A test is included in test/SemaCXX/constant-expression-cxx1y.cpp for the fix (adding operator== to PointerUnion in LLVM). llvm-svn: 181869
* Objective-C error recovery. This patch makes a quickFariborz Jahanian2013-05-131-0/+2
| | | | | | | | | recovery form duplicate method definition error thus preventing doc parsing to loop trying to find comment for the invalid redefinition in a previous declaration. // rdar://13836387 llvm-svn: 181710
* Keep track of an @implementation's super class name location, if one was ↵Argyrios Kyrtzidis2013-05-031-1/+1
| | | | | | provided. llvm-svn: 181039
* Fix an assertion hit in Sema::CheckObjCMethodOverrides.Argyrios Kyrtzidis2013-04-271-4/+6
| | | | llvm-svn: 180651
* Objective-C: When reporting on missing property accessor implementation inFariborz Jahanian2013-04-241-12/+2
| | | | | | | | categories, do not report when they are declared in primary class, class's protocol, or one of it super classes. This is because, its class is going to implement them. // rdar://13713098 llvm-svn: 180198
* Use the extra info in global method pool to speed up looking for ObjC ↵Argyrios Kyrtzidis2013-04-171-4/+40
| | | | | | | | | | | | | | | | | | overridden methods. When we are in a implementation, we check the global method pool whether there were category methods with the same selector. If there were none (common case) we don't need to do lookups for overridden methods again. Note that for an interface method (if we don't encounter its implementation), it is considered that it overrides methods that were declared before it, not for category methods introduced after it. This is tradeoff in favor of performance, since it is expensive to do lookups in case there was a category, and moving the global method pool to ASTContext (so we can check it) would increase complexity. rdar://13508196 llvm-svn: 179654
* Enhance the ObjC global method pool to record whether there were 0, 1, or >= ↵Argyrios Kyrtzidis2013-04-171-4/+10
| | | | | | | | | 2 methods (with a particular selector) inside categories. This is done by extending ObjCMethodList (which is only used by the global method pool) to have 2 extra bits of information. We will later take advantage of this info in global method pool for the overridden methods calculation. llvm-svn: 179652
* Parsing support for thread_local and _Thread_local. We give them the sameRichard Smith2013-04-121-5/+7
| | | | | | semantics as __thread for now. llvm-svn: 179424
* Objective-C: This patch fixes a none-issuance of warningFariborz Jahanian2013-04-091-1/+4
| | | | | | | | | | | when result type of protocol property and getter method differ by fixing a more serious problem. When a forward protocol declaration comes between its definition and its use in class protocol list, the forward protocol ast was being used in building the protocol list. // rdar://12522752 llvm-svn: 179108
* Objective-C: Issue deprecated warning when using a Fariborz Jahanian2013-04-041-1/+7
| | | | | | | deprecated typedef to subclass or invoke a class method. // rdar://13569424 llvm-svn: 178775
* Be sure to check ARC conventions on the implicit method declarationsJohn McCall2013-04-041-10/+10
| | | | | | | | | of a property just in case the property's getter happens to be +1. We won't synthesize a getter for such a property, but we will allow the user to define a +1 method for it. rdar://13115896 llvm-svn: 178731
* Add 178663 back.Rafael Espindola2013-04-031-2/+2
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-031-2/+2
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-2/+2
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* When looking for overridden ObjC methods, don't ignore 'hidden' ones.Argyrios Kyrtzidis2013-03-291-4/+5
| | | | | | | | | | | | When using modules we should not ignore overridden methods from categories that are hidden because the module is not visible. This will give more consistent results (when imports change) and it's more correct since the methods are indeed overridden even if they are not "visible" for lookup purposes. rdar://13350796 llvm-svn: 178374
* Split "incomplete implementation" warnings for ObjC into separate warnings.Ted Kremenek2013-03-271-14/+14
| | | | | | | | | | | | Previously all unimplemented methods for a class were grouped under a single warning, with all the unimplemented methods mentioned as notes. Based on feedback from users, most users would like a separate warning for each method, with a note pointing back to the original method declaration. Implements <rdar://problem/13350414> llvm-svn: 178097
* Add a clarifying note when a return statement is rejected becauseJohn McCall2013-03-191-1/+2
| | | | | | | | we expect a related result type. rdar://12493140 llvm-svn: 177378
* Add missing diagnostic for a nested-name-specifier on a free-standing type ↵Richard Smith2013-03-181-1/+1
| | | | | | definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations. llvm-svn: 177335
* Silence a number of static analyzer warnings with assertions and such.Jordan Rose2013-03-051-3/+3
| | | | | | No functionality change. llvm-svn: 176469
* Retain all hidden methods in the global method pool, because they may become ↵Douglas Gregor2013-02-071-0/+4
| | | | | | visible <rdar://problem/13172858>. llvm-svn: 174648
* Eliminate Sema::CompareProperties(), which was walking over a pile ofDouglas Gregor2013-01-211-6/+2
| | | | | | | | | lexical declarations looking for properties when we could more efficiently check for property mismatches at property declaration time. Good for ~1% of -fsyntax-only time when most of the properties we're checking against come from an AST file. llvm-svn: 173079
* Eliminate the oddly-named Sema::ComparePropertiesInBaseAndSuper, whichDouglas Gregor2013-01-211-1/+0
| | | | | | | | | | did a redundant traversal of the lexical declarations in the superclass. Instead, when we declare a new property, look into the superclass to see whether we're redeclaring the property. Goot for 1% of -fsyntax-only time on Cocoa.h and a little less than 3% on my modules test case. llvm-svn: 173073
* When checking the parameter types of an Objective-C method, don'tDouglas Gregor2013-01-181-2/+0
| | | | | | | decay the parameter type immediately; let CheckParameter() do its job. Fixes <rdar://problem/12071218>. llvm-svn: 172780
* Treat hidden Objective-C protocol definitions as if they wereDouglas Gregor2013-01-171-1/+3
| | | | | | | undefined, and don't find methods or protocols within those protocol definitions. This completes <rdar://problem/10634711>. llvm-svn: 172686
* Rework the traversal of Objective-C categories and extensions toDouglas Gregor2013-01-161-51/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider (sub)module visibility. The bulk of this change replaces myriad hand-rolled loops over the linked list of Objective-C categories/extensions attached to an interface declaration with loops using one of the four new category iterator kinds: visible_categories_iterator: Iterates over all visible categories and extensions, hiding any that have their "hidden" bit set. This is by far the most commonly used iterator. known_categories_iterator: Iterates over all categories and extensions, ignoring the "hidden" bit. This tends to be used for redeclaration-like traversals. visible_extensions_iterator: Iterates over all visible extensions, hiding any that have their "hidden" bit set. known_extensions_iterator: Iterates over all extensions, whether they are visible to normal name lookup or not. The effect of this change is that any uses of the visible_ iterators will respect module-import visibility. See the new tests for examples. Note that the old accessors for categories and extensions are gone; there are *Raw() forms for some of them, for those (few) areas of the compiler that have to manipulate the linked list of categories directly. This is generally discouraged. Part two of <rdar://problem/10634711>. llvm-svn: 172665
* Teach global selector lookup to ignore hidden methods, which occurDouglas Gregor2013-01-161-47/+65
| | | | | | | when the methods are declared in a submodule that has not yet been imported. Part of <rdar://problem/10634711>. llvm-svn: 172635
* When checking availability attributes for consistency between anDouglas Gregor2013-01-151-2/+1
| | | | | | | | overriding and overridden method, allow the overridden method to have a narrower contract (introduced earlier, deprecated/obsoleted later) than the overriding method. Fixes <rdar://problem/12992023>. llvm-svn: 172567
* objective-C: when searching for declarations in protocolFariborz Jahanian2013-01-071-0/+5
| | | | | | | list of classes, etc., make sure to look into protocol definitions. // rdar://12958878 llvm-svn: 171777
OpenPOWER on IntegriCloud