summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseObjc.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix a clang crash caused by incorrect user code.Fariborz Jahanian2009-06-241-1/+3
| | | | llvm-svn: 74080
* Use of DeclContext for objc's ivars. No functionalityFariborz Jahanian2009-06-051-0/+1
| | | | | | change. More to follow. llvm-svn: 72951
* Merge the ASTVector and ASTOwningVector templates, since they offeredDouglas Gregor2009-05-211-1/+0
| | | | | | | | redundant functionality. The result (ASTOwningVector) lives in clang/Parse/Ownership.h and is used by both the parser and semantic analysis. No intended functionality change. llvm-svn: 72214
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-10/+14
| | | | llvm-svn: 72210
* Make ActOnExprStmt take a FullExprArg.Anders Carlsson2009-05-171-1/+1
| | | | llvm-svn: 71989
* Remove support for ObjCMethodDecl attributes that appear between theTed Kremenek2009-05-041-10/+3
| | | | | | | | return type and the selector. This is inconsistent with C functions (where such attributes would be placed on the return type, not the the FunctionDecl), and is inconsistent with what people are use to seeing. llvm-svn: 70878
* Hook up Sema support for attributes on Objective-C method declarations thatTed Kremenek2009-04-301-2/+2
| | | | | | | | | | | | | appear between the return type and the selector. This is a separate code path from regular attribute processing, as we only want to (a) accept only a specific set of attributes in this place and (b) want to distinguish to clients the context in which an attribute was added to an ObjCMethodDecl. Currently, the attribute 'objc_ownership_returns' is the only attribute that uses this new feature. Shortly I will add a warning for 'objc_ownership_returns' to be placed at the end of a method declaration. llvm-svn: 70504
* Add parsing support in an Objective-C method declaration for attributes betweenTed Kremenek2009-04-301-0/+6
| | | | | | the return type and selector. Haven't hooked this up to Sema yet. llvm-svn: 70501
* Fix rdar://6771034: don't warn on use of forward declared protocol in protocolChris Lattner2009-04-121-1/+1
| | | | | | | list of another protocol definition. This warning is very noisy and GCC doesn't produce it so existing code doesn't expect it. llvm-svn: 68894
* change the interface to ActOnMethodDeclaration to pass down argumentChris Lattner2009-04-111-17/+16
| | | | | | | information in a little struct instead of individually. While we're at it, add per-argument loc info and attribute info. llvm-svn: 68871
* rename Parser::ParseObjCSelector -> Parser::ParseObjCSelectorPiece,Chris Lattner2009-04-111-7/+7
| | | | | | | since it only parses one identifier out of the selector, not the whole thing. llvm-svn: 68867
* Fixed a problem using property syntax on a 'super'Fariborz Jahanian2009-04-081-3/+5
| | | | | | used as receiver. llvm-svn: 68631
* Fix <rdar://problem/6764172> [sema] crash on invalid.Steve Naroff2009-04-071-1/+7
| | | | llvm-svn: 68568
* Push DeclGroup much farther throughout the compiler. Now the variousChris Lattner2009-03-291-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | productions (except the already broken ObjC cases like @class X,Y;) in the parser that can produce more than one Decl return a DeclGroup instead of a Decl, etc. This allows elimination of the Decl::NextDeclarator field, and exposes various clients that should look at all decls in a group, but which were only looking at one (such as the dumper, printer, etc). These have been fixed. Still TODO: 1) there are some FIXME's in the code about potentially using DeclGroup for better location info. 2) ParseObjCAtDirectives should return a DeclGroup due to @class etc. 3) I'm not sure what is going on with StmtIterator.cpp, or if it can be radically simplified now. 4) I put a truly horrible hack in ParseTemplate.cpp. I plan to bring up #3/4 on the mailing list, but don't plan to tackle #1/2 in the short term. llvm-svn: 68002
* Introduce a new OpaquePtr<N> struct type, which is a simple POD wrapper for aChris Lattner2009-03-281-81/+78
| | | | | | | | | | | | | | | | | | | | pointer. Its purpose in life is to be a glorified void*, but which does not implicitly convert to void* or other OpaquePtr's with a different UID. Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>. Change the entire parser/sema interface to use DeclPtrTy instead of DeclTy*. This makes the C++ compiler enforce that these aren't convertible to other opaque types. We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc, but I don't plan to do that in the short term. The one outstanding known problem with this patch is that we lose the bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to bitmangle the success bit into the low bit of DeclPtrTy. I will rectify this with a subsequent patch. llvm-svn: 67952
* objc: Implemented variables declared in class interface Fariborz Jahanian2009-03-181-2/+7
| | | | | | whose sema decl is at the translation unit. llvm-svn: 67249
* Use paropery's setter attribute name asFariborz Jahanian2009-03-121-7/+7
| | | | | | the selector for the property setter. llvm-svn: 66834
* Simplify SelectorTable::constructSetterName() usage...Steve Naroff2009-03-101-4/+5
| | | | llvm-svn: 66551
* Implement property '.' notation on Factory/Class objects. Parser changes ↵Steve Naroff2009-03-091-14/+3
| | | | | | | | aren't very pretty:-( This fixes <rdar://problem/6496506> Implement class setter/getter for properties. llvm-svn: 66465
* rename PrettyStackTraceDecl -> PrettyStackTraceActionsDecl.Chris Lattner2009-03-051-3/+3
| | | | | | | | | | | | | | | | Introduce a new PrettyStackTraceDecl. Use it to add the top level LLVM IR generation stuff in Backend.cpp to stack traces. We now get crashes like: Stack dump: 0. Program arguments: clang t.c -emit-llvm 1. <eof> parser at end of file 2. t.c:1:5: LLVM IR generation of declaration 'a' Abort for IR generation crashes. llvm-svn: 66153
* include objc method decl contexts in stack trace of crash, e.g.:Chris Lattner2009-03-051-0/+5
| | | | | | | | | Stack dump: 0. message.m:53:13: in compound statement ('{}') 1. message.m:53:13: parsing Objective-C method 'xx' 2. clang message.m llvm-svn: 66121
* Implemented access check for ivars accessed insideFariborz Jahanian2009-03-041-2/+5
| | | | | | c-style functions declared inside objc @implementations. llvm-svn: 66087
* Fix <rdar://problem/6640991> Exception handling executes wrong clause ↵Steve Naroff2009-03-031-13/+10
| | | | | | | | | | | (Daniel, please verify). Also necessary to fix: <rdar://problem/6632061> [sema] non object types should not be allowed in @catch statements <rdar://problem/6252237> [sema] qualified id should be disallowed in @catch statements llvm-svn: 65964
* Fix <rdar://problem/6636803> [sema] crash on InterfaceBuilder.Steve Naroff2009-03-021-2/+3
| | | | | | Parser::ParseObjCMethodDefinition(): Make sure we don't exit the BodyScope until ActOnFinishFunctionBody() is complete. llvm-svn: 65880
* Minor name change (move the ObjC prefix to a more appropriate place).Steve Naroff2009-02-281-1/+1
| | | | llvm-svn: 65695
* Update Parser::ParseTypeName to return a TypeResult, which also tellsDouglas Gregor2009-02-181-5/+11
| | | | | | | | us whether there was an error in trying to parse a type-name (type-id in C++). This allows propagation of errors further in the compiler, suppressing more bogus error messages. llvm-svn: 64922
* simplify some code.Chris Lattner2009-02-181-5/+3
| | | | llvm-svn: 64893
* implement gcc/testsuite/objc.dg/method-attribute-3.m, by improving error ↵Chris Lattner2009-02-151-1/+2
| | | | | | recovery. llvm-svn: 64609
* don't pass a random english string in as a string argument to Diag.Chris Lattner2009-02-151-1/+1
| | | | llvm-svn: 64608
* Pass the location of the start of the selector to ↵Anders Carlsson2009-02-141-2/+5
| | | | | | ActOnClassMessage/ActOnInstanceMessage. llvm-svn: 64560
* Fix <rdar://problem/6505139> [clang on growl]: need to allow unnamed ↵Steve Naroff2009-02-111-1/+2
| | | | | | selectors as the first argument llvm-svn: 64320
* Fix <rdar://problem/6243503> [sema] @throw; accepted outside catch block.Steve Naroff2009-02-111-2/+2
| | | | llvm-svn: 64318
* Put the invalid flag of OwningResult into the Action pointer.Sebastian Redl2009-02-051-12/+10
| | | | | | | | This shrinks OwningResult by one pointer. Since it is no longer larger than OwningPtr, merge the two. This leads to simpler client code and speeds up my benchmark by 2.7%. For some reason, this exposes a previously hidden bug, causing a regression in SemaCXX/condition.cpp. llvm-svn: 63867
* move library-specific diagnostic headers into library private dirs. ReduceChris Lattner2009-01-291-1/+1
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-1/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* Rename move_convert to move_arg and move_res. The new names are less ↵Sebastian Redl2009-01-181-12/+12
| | | | | | misleading (and shorter). llvm-svn: 62466
* Convert ObjC statement actions to smart pointers.Sebastian Redl2009-01-181-9/+9
| | | | llvm-svn: 62465
* Diagnose that property name cannot be a bitfieldFariborz Jahanian2009-01-171-0/+5
| | | | llvm-svn: 62432
* Properly set the scope of non-fields declared within a struct, union,Douglas Gregor2009-01-121-1/+1
| | | | | | | | | | | | | | | | | | | or enum to be outside that struct, union, or enum. Fixes several regressions: <rdar://problem/6487662> <rdar://problem/6487669> <rdar://problem/6487684> <rdar://problem/6487702> PR clang/3305 PR clang/3312 There is still some work to do in Objective-C++, but this requires that each of the Objective-C entities (interfaces, implementations, etc.) to be introduced into the context stack with PushDeclContext/PopDeclContext. This will be a separate fix, later. llvm-svn: 62091
* Fix rdar://6480479 - [parser] infinite loop on invalid inputChris Lattner2009-01-091-0/+6
| | | | llvm-svn: 61975
* Adding support for ObjC methods which have c-styleFariborz Jahanian2009-01-091-4/+6
| | | | | | parameter list. This is work in progress. llvm-svn: 61964
* Unify the code for defining tags in C and C++, so that we alwaysDouglas Gregor2009-01-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduce a Scope for the body of a tag. This reduces the number of semantic differences between C and C++ structs and unions, and will help with other features (e.g., anonymous unions) in C. Some important points: - Fields are now in the "member" namespace (IDNS_Member), to keep them separate from tags and ordinary names in C. See the new test in Sema/member-reference.c for an example of why this matters. In C++, ordinary and member name lookup will find members in both the ordinary and member namespace, so the difference between IDNS_Member and IDNS_Ordinary is erased by Sema::LookupDecl (but only in C++!). - We always introduce a Scope and push a DeclContext when we're defining a tag, in both C and C++. Previously, we had different actions and different Scope/CurContext behavior for enums, C structs/unions, and C++ structs/unions/classes. Now, it's one pair of actions. (Yay!) There's still some fuzziness in the handling of struct/union/enum definitions within other struct/union/enum definitions in C. We'll need to do some more cleanup to eliminate some reliance on CurContext before we can solve this issue for real. What we want is for something like this: struct X { struct T { int x; } t; }; to introduce T into translation unit scope (placing it at the appropriate point in the IdentifierResolver chain, too), but it should still have struct X as its lexical declaration context. PushOnScopeChains isn't smart enough to do that yet, though, so there's a FIXME test in nested-redef.c llvm-svn: 61940
* Convert a few Stmt actions to smart pointers.Sebastian Redl2008-12-211-2/+3
| | | | llvm-svn: 61309
* Semantics of @protocol attributes.Fariborz Jahanian2008-12-171-2/+4
| | | | llvm-svn: 61114
* Some utilities for using the smart pointers in Actions, especially Sema. ↵Sebastian Redl2008-12-131-3/+3
| | | | | | Convert a few functions. llvm-svn: 60983
* Convert remaining expression parsers to smart pointers. Now on to the Action ↵Sebastian Redl2008-12-131-79/+79
| | | | | | connection. llvm-svn: 60982
* Convert a big bunch of expression parsers to use smart pointers.Sebastian Redl2008-12-111-1/+1
| | | | llvm-svn: 60906
* Convert some more expression parsers to use smart pointers.Sebastian Redl2008-12-111-1/+1
| | | | llvm-svn: 60904
* Convert selected expression parsers to use smart pointers.Sebastian Redl2008-12-111-9/+13
| | | | llvm-svn: 60900
* Convert the remaining statement parsers to smart pointers.Sebastian Redl2008-12-111-24/+25
| | | | llvm-svn: 60895
OpenPOWER on IntegriCloud