summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Alter the interface of GetTypeForDeclarator to return a TypeSourceInfo*.John McCall2010-06-041-2/+2
| | | | | | This is never null, but the associated type might be. llvm-svn: 105503
* Clang missing warning about conflicting declaration vs. definition Fariborz Jahanian2010-05-211-0/+4
| | | | | | for variable arguments list methods. (radar 8006060). llvm-svn: 104407
* Various small fixes for construction/destruction of Objective-C++Douglas Gregor2010-05-201-3/+3
| | | | | | | | | | instance variables: - Use isRecordType() rather than isa<RecordType>(), so that we see through typedefs in ivar types. - Mark the destructor as referenced - Perform C++ access control on the destructor llvm-svn: 104206
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-151-12/+12
| | | | | | | | | | | | | | | | | | | | | ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
* Implement new default property synthesis rules. Essentially, no longerFariborz Jahanian2010-05-141-1/+3
| | | | | | | | | user directive is needed to force a property implementation. It is decided based on those propeties which are declared in the class (or in its protocols) but not those which must be default implemented by one of its super classes. Implements radar 7923851. llvm-svn: 103787
* This patch deals with Sema Part of Setter/Getter synthesisFariborz Jahanian2010-05-051-7/+7
| | | | | | | of properties which are of C++ objects. Code Gen to follow (Radar 7468090). llvm-svn: 103123
* Diagnose unused exception parameters under a different warning groupDouglas Gregor2010-05-031-1/+3
| | | | | | | | (-Wunused-exception-parameter) than normal variables, since it's more common to name and then ignore an exception parameter. This warning is neither enabled by default nor by -Wall. Fixes <rdar://problem/7931045>. llvm-svn: 102931
* More of Sema to implement initialization ofFariborz Jahanian2010-04-281-24/+23
| | | | | | ivar of c++ object types. llvm-svn: 102500
* Move CollectIvarsToConstructOrDestruct to SemaFariborz Jahanian2010-04-271-0/+52
| | | | | | | from AST, consider ivar array of objects (per Doug's comment). llvm-svn: 102446
* Implement template instantiation for Objective-C @catchDouglas Gregor2010-04-261-0/+2
| | | | | | statements. This is the last of the Objective-C statements. llvm-svn: 102356
* Refactor Objective-C @catch parameter checking by detangling it fromDouglas Gregor2010-04-261-5/+87
| | | | | | | | function-parameter checking and splitting it into the normal ActOn*/Build* pair in Sema. We now use VarDecl to represent the @catch parameter rather than the ill-fitting ParmVarDecl. llvm-svn: 102347
* Make the static type of the exception variable in an Objective-CDouglas Gregor2010-04-261-1/+1
| | | | | | | @catch a VarDecl. The dynamic type is still a ParmVarDecl, but that will change soon. No effective functionality change. llvm-svn: 102341
* Rework Parser-Sema interface for Objective-C @catch exception objectDouglas Gregor2010-04-231-0/+7
| | | | | | | | | arguments. Rather than having the parser call ActOnParamDeclarator (which is a bit of a hack), call a new ActOnObjCExceptionDecl action. We'll be moving more functionality into this handler to perform earlier checking of @catch. llvm-svn: 102222
* 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
OpenPOWER on IntegriCloud