summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Keep track of the actual storage specifier written on a variable orDouglas Gregor2010-04-191-1/+1
| | | | | | | | function declaration, since it may end up being changed (e.g., "extern" can become "static" if a prior declaration was static). Patch by Enea Zaffanella and Paolo Bolzoni. llvm-svn: 101826
* Allow the 'ibaction' attribute to be attached to method declarations (and ↵Ted Kremenek2010-04-181-2/+12
| | | | | | not issue a warning). llvm-svn: 101699
* Audit uses of Sema::LookupSingleName for those lookups that areDouglas Gregor2010-04-151-12/+7
| | | | | | | | | | | intended for redeclarations, fixing those that need it. Fixes PR6831. This uncovered an issue where the C++ type-specifier-seq parsing logic would try to perform name lookup on an identifier after it already had a type-specifier, which could also lead to spurious ambiguity errors (as in PR6831, but with a different test case). llvm-svn: 101419
* Feed proper source-location information into Sema::LookupSingleResult,Douglas Gregor2010-04-151-15/+24
| | | | | | | | in case it ends up doing something that might trigger diagnostics (template instantiation, ambiguity reporting, access reporting). Noticed while working on PR6831. llvm-svn: 101412
* Teach typo correction about various language keywords. We can'tDouglas Gregor2010-04-141-3/+3
| | | | | | | | | | | | | generally recover from typos in keywords (since we would effectively have to mangle the token stream). However, there are still benefits to typo-correcting with keywords: - We don't make stupid suggestions when the user typed something that is similar to a keyword. - We can suggest the keyword in a diagnostic (did you mean "static_cast"?), even if we can't recover and therefore don't have a fix-it. llvm-svn: 101274
* When upgrading an Objective-C class from a forward declaration to aDouglas Gregor2010-04-091-0/+1
| | | | | | | full-fledged @interface, be sure that the declaration has the right lexical context. <rdar://problem/7827709> llvm-svn: 100903
* Fixes a regression caused by implementing cstyle methods Fariborz Jahanian2010-04-091-2/+2
| | | | | | for objc. llvm-svn: 100865
* Implement method type encoding in the presenseFariborz Jahanian2010-04-081-0/+1
| | | | | | of c-style arguments. Completes radar 7445205. llvm-svn: 100813
* Patch to implement gcc's cstyle arguments in objcFariborz Jahanian2010-04-081-2/+21
| | | | | | methods. wip. llvm-svn: 100734
* diagnose declaring class extension after its implementationFariborz Jahanian2010-04-021-0/+5
| | | | | | (radar 7822210). llvm-svn: 100226
* Patch implements gcc's -Wno-protocol option to suppress warningFariborz Jahanian2010-03-311-10/+18
| | | | | | | on unimplemented methods in protocols adopted by a class. (radar 7056600). llvm-svn: 100028
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-311-2/+2
| | | | | | the C-only "optimization". llvm-svn: 100022
* Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor2010-03-311-2/+2
| | | | llvm-svn: 100018
* Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor2010-03-311-2/+2
| | | | | | | term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. llvm-svn: 100008
* Further improvement to point to categoryFariborz Jahanian2010-03-271-3/+10
| | | | | | whose protocolls methods needs implementation. llvm-svn: 99730
* Improve diagnostics on incomplete implementationFariborz Jahanian2010-03-271-3/+10
| | | | | | | | of objc classes; including which methods need be implemented and where they come from. WIP. llvm-svn: 99724
* Fixes access rues for ivars declared in classFariborz Jahanian2010-03-221-2/+0
| | | | | | implementations (radar 7547942). llvm-svn: 99198
* Split Sema logic for ObjC @property and @synthesize intoTed Kremenek2010-03-121-1006/+0
| | | | | | a separate file. llvm-svn: 98317
* For ivars created using @synthesize, set their DeclContext to beTed Kremenek2010-03-111-1/+3
| | | | | | | | | | | | the @implementation (instead of the @interface) and actually add the ivar to the DeclContext (which we weren't doing before). This allows us to simplify ASTContext::CollectNonClassIvars() by removing ASTContext::CollectProtocolSynthesizedIvars(). Now all ivars can be found by either inspecting the ObjCInterfaceDecl and its companion ObjCImplementationDecl. llvm-svn: 98280
* Keep track of type source information in the return type of anDouglas Gregor2010-03-081-3/+5
| | | | | | | | | | Objective-C method declaration, e.g., for - (Foo *)myMethod; we now have TypeSourceInfo for the Foo*. llvm-svn: 97942
* Keep an explicit stack of function and block scopes, each element ofDouglas Gregor2010-03-011-5/+3
| | | | | | | | | | | | | | | | | | | | which has the label map, switch statement stack, etc. Previously, we had a single set of maps in Sema (for the function) along with a stack of block scopes. However, this lead to funky behavior with nested functions, e.g., in the member functions of local classes. The explicit-stack approach is far cleaner, and we retain a 1-element cache so that we're not malloc/free'ing every time we enter a function. Fixes PR6382. Also, tweaked the unused-variable warning suppression logic to look at errors within a given Scope rather than within a given function. The prior code wasn't looking at the right number-of-errors count when dealing with blocks, since the block's count would be deallocated before we got to ActOnPopScope. This approach works with nested blocks/functions, and gives tighter error recovery. llvm-svn: 97518
* Implement jump checking for initialized c++ variables, implementingChris Lattner2010-03-011-0/+1
| | | | | | | | | | | | | | | | | | a fixme and PR6451. Only perform jump checking if the containing function has no errors, and add the infrastructure needed to do this. On the testcase in the PR, we produce: t.cc:6:3: error: illegal goto into protected scope goto later; ^ t.cc:7:5: note: jump bypasses variable initialization X x; ^ llvm-svn: 97497
* More Sema check for ivars in class continuation.Fariborz Jahanian2010-02-231-0/+28
| | | | llvm-svn: 97002
* Fix another crash on invalid code. In this case, handle ObjC categories ↵Ted Kremenek2010-02-231-10/+19
| | | | | | | | (with no names) that refer to an undefined class. llvm-svn: 96976
* More support for ivars in class extension.Fariborz Jahanian2010-02-231-6/+2
| | | | llvm-svn: 96850
* Start supporting declaration of ivars in @implementationFariborz Jahanian2010-02-191-1/+20
| | | | | | blocks. WIP. llvm-svn: 96696
* Patch removes IVars list from ObjCInterfaceDecl andFariborz Jahanian2010-02-191-3/+2
| | | | | | instead relies on their DeclContext for iteration, etc. llvm-svn: 96638
* Use proper lexcial context for newly added ivars.Fariborz Jahanian2010-02-171-2/+2
| | | | llvm-svn: 96484
* Allow for declaration and use of ivars in a stand-aloneFariborz Jahanian2010-02-171-0/+6
| | | | | | implementation (toward radar 7547942). llvm-svn: 96479
* Class continuation now has its own property ast forFariborz Jahanian2010-02-151-53/+87
| | | | | | | | those declared in it. This is to allow duplicate property diagnostics for properties declared in class extensions multiple times (radar 7629420) and for future use. llvm-svn: 96276
* Allocate 'ObjCMethodList' objects (owned by Sema) using Sema's ↵Ted Kremenek2010-02-111-2/+4
| | | | | | BumpPtrAllocator. Previously they were not getting freed. Fixes <rdar://problem/7635663>. llvm-svn: 95834
* Finish implementing property synthesis by default.Fariborz Jahanian2010-02-091-0/+22
| | | | | | (radar 7381956). llvm-svn: 95695
* Implement synthesizing properties by default.Fariborz Jahanian2010-02-091-1/+48
| | | | | | | | | This is a non-fragile-abi feature only. Since it breaks existing code, it is currently placed under -fobjc-nonfragile-abi2 option for test purposes only until further notice. WIP. llvm-svn: 95685
* Patch to implement rewriting of properties.Fariborz Jahanian2010-01-211-1/+2
| | | | | | Fixes radar 7562952. llvm-svn: 94087
* Settled rule on warning on unimplemented property inFariborz Jahanian2010-01-201-2/+28
| | | | | | | | category implementation when some implementations are missing in the primary class implementation. (fixes radar 6505200). llvm-svn: 94014
* Improve performance of warning when not implementing a required Fariborz Jahanian2010-01-201-13/+13
| | | | | | | property of a protocol (my previous patch). No change in functionality. (radar 7544809). llvm-svn: 94005
* Patch to implement required warnings for unimplementedFariborz Jahanian2010-01-201-38/+71
| | | | | | properties imported frfom protocol. Fixes radar 7544809. llvm-svn: 93965
* Mostly renaming some methods and updating comments toFariborz Jahanian2010-01-181-27/+34
| | | | | | | reflect what these methods are actually doing. One method template for future work. No change in functionality. llvm-svn: 93742
* Improve location information for Objective-C category declarations. WeDouglas Gregor2010-01-161-2/+3
| | | | | | | | | | | | | previously only had a single location (the @ in @interface); now we know where the @ is (for the start of the declaration), where the class name is (that's the normal "location" now for diagnostics), and where the category name is. Also, eliminated the redundant "end" location, since ObjCContainerDecl already has better @end information. The only XFAIL'd test is temporary; will un-XFAIL-it once I've taught CIndex how to use the new locations. llvm-svn: 93639
* Keep track of the source locations for each protocol reference inDouglas Gregor2010-01-161-5/+13
| | | | | | | | Objective-C classes, protocol definitions, forward protocol declarations, and categories. This information isn't actually used yet; that's coming next. llvm-svn: 93636
* Change ObjCContainerDecl to contain the entire range for the '@end'Ted Kremenek2010-01-071-7/+12
| | | | | | | | | | | piece of the declaration. The '@' and the 'end' are separate tokens, and require two SourceLocations to accurately track. This change was motivated because ObjCContainerDecl::getSourceRange() would previously not return the entire range of the declaration (the 'end' would be left off). llvm-svn: 92891
* Whenever we emit a typo-correction diagnostic, also emit a noteDouglas Gregor2010-01-071-0/+4
| | | | | | | pointing to the declaration that we found that has that name (if it is unique). llvm-svn: 92877
* When suggesting a typo correction for an @implementation without aDouglas Gregor2010-01-061-1/+7
| | | | | | | | | | corresponding @interface, provide a note showing which interface we're referring to. This note has the fix-it hint on it. Also, don't automatically apply fix-it hints for notes. They're meant to express fix-its that would change semantics. llvm-svn: 92870
* Fix a bug when property is redeclared in multipleFariborz Jahanian2010-01-061-0/+26
| | | | | | | continuation classes and its original declaration is imported from a protocol. This fixes radar 7509234. llvm-svn: 92856
* Do not diagnose method disguised as property setterFariborz Jahanian2010-01-061-2/+5
| | | | | | for a 'readonly' property. Fixes radar 7427072. llvm-svn: 92808
* When declaring an Objective-C implementation without a correspondingDouglas Gregor2010-01-041-4/+18
| | | | | | | | | | | | | | | | | | | | | | interface, suggest correction of typos. For example, given: @interface NSString @end @implementation NSstring @end we'll warn with: t.m:4:19: warning: cannot find interface declaration for 'NSstring'; did you mean 'NSString'? @implementation NSstring ^ However, since this is just a warning, we don't provide a fix-it hint. Good idea, Ted! llvm-svn: 92488
* Implement typo correction for a variety of Objective-C-specificDouglas Gregor2010-01-031-2/+24
| | | | | | | | | | | | | | constructs: - Instance variable lookup ("foo->ivar" and, in instance methods, "ivar") - Property name lookup ("foo.prop") - Superclasses - Various places where a class name is required - Protocol names (e.g., id<proto>) This seems to cover many of the common places where typos could occur. llvm-svn: 92449
* Diagnose duplicate declaration of a property. FixesFariborz Jahanian2009-12-171-1/+8
| | | | | | PR5809 llvm-svn: 91575
* Diagnose property of reference type as unsupportedFariborz Jahanian2009-12-161-0/+4
| | | | | | instead of crashing for now. llvm-svn: 91546
* Improve the diagnostic when a new declaration conflicts with a using shadowJohn McCall2009-12-101-4/+4
| | | | | | | | declaration. Rename note_using_decl to note_using, which is possibly less confusing. Add a test for non-class-scope using decl collisions and be sure to note the case we can't diagnose yet. llvm-svn: 91057
OpenPOWER on IntegriCloud