summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseObjc.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Convert a number of statement parsers to smart pointers.Sebastian Redl2008-12-111-5/+5
| | | | llvm-svn: 60888
* Use a scoped object to manage entry/exit from a parser scope rather than ↵Douglas Gregor2008-12-101-11/+8
| | | | | | explicitly calling EnterScope/ExitScope llvm-svn: 60830
* Modify the move emulation according to the excellent design of Howard ↵Sebastian Redl2008-12-101-19/+21
| | | | | | Hinnant. Makes for much nicer syntax when smart pointers are used consistently. Also, start converting internal argument passing of Parser to smart pointers. llvm-svn: 60809
* Kick out the proof-of-concept ASTOwner and replace it with ASTOwningResultSebastian Redl2008-12-091-16/+17
| | | | llvm-svn: 60791
* Consistently use smart pointers for stmt and expr nodes in parser local ↵Sebastian Redl2008-12-091-62/+57
| | | | | | variables. llvm-svn: 60761
* improve comment.Chris Lattner2008-12-081-1/+1
| | | | llvm-svn: 60718
* Set default property attributes on each property.Fariborz Jahanian2008-11-261-1/+5
| | | | | | | | Implemented anonymous category (also know as continuation class) used to override main class's property attribute. This is work in propgress. llvm-svn: 60114
* Use RAII objects to ensure proper destruction of expression and statement ↵Sebastian Redl2008-11-251-21/+22
| | | | | | AST nodes in the parser in most cases, even on error. llvm-svn: 60057
* Daniel really really likes = instead of += :)Chris Lattner2008-11-201-1/+1
| | | | llvm-svn: 59716
* Rename IdentifierInfo::isName to ::isStr. Use a nifty trickChris Lattner2008-11-201-7/+7
| | | | | | | from Sebastian to enforce that a literal string is passed in, and use this to avoid having to call strlen on it. llvm-svn: 59706
* Fix <rdar://problem/6150376> [sema] crash on invalid message send.Steve Naroff2008-11-191-4/+6
| | | | | | The core fix in Sema::ActOnClassMessage(). All the other changes have to do with passing down the SourceLocation for the receiver (to properly position the cursor when producing an error diagnostic). llvm-svn: 59639
* remove some uses of IdentifierInfo::getName()Chris Lattner2008-11-191-9/+8
| | | | llvm-svn: 59606
* Use smallstring instead of new[]'ing a string. This simplifiesChris Lattner2008-11-191-8/+4
| | | | | | the code and speeds it up. llvm-svn: 59604
* remove uses of IdentifierInfo::getName()Chris Lattner2008-11-191-2/+1
| | | | llvm-svn: 59603
* remove the last couple obsolete forms of Parser::Diag.Chris Lattner2008-11-181-2/+2
| | | | llvm-svn: 59510
* Change a couple of the Parser::Diag methods to return DiagnosticInfoChris Lattner2008-11-181-22/+20
| | | | | | | | | and let the clients push whatever they want into the DiagnosticInfo instead of hard coding a few forms. Also switch various clients to use Diag(Tok, ...) instead of Diag(Tok.getLocation(), ...) as the canonical form to simplify the code a bit. llvm-svn: 59509
* some minor cleanups to ParseObjCTypeName:Chris Lattner2008-10-221-17/+12
| | | | | | | | | | 1. Remove a bogus assertion, clients other than sema can return a null pointer from actions that result in ParseTypeName returning null. 2. Remove dead RParenLoc variable. 3. Simplify control flow handling error conditions. 4. On a major failure, we should skip until ')' not until '}'. llvm-svn: 57949
* Fix a crasher during error recovery in Parser::ParseObjCTypeName().Steve Naroff2008-10-211-1/+2
| | | | | | Found this while fixing another unrelated radar. llvm-svn: 57904
* eliminate ObjCPropertyAttrs an corresponding enums, just useChris Lattner2008-10-201-9/+9
| | | | | | strcmp when needed. llvm-svn: 57817
* rearrange some code.Chris Lattner2008-10-201-17/+16
| | | | llvm-svn: 57816
* more simplifications to error recovery in ParseObjCPropertyAttributeChris Lattner2008-10-201-28/+18
| | | | llvm-svn: 57815
* move some code around to make it fall through more, no functionality change.Chris Lattner2008-10-201-25/+24
| | | | llvm-svn: 57813
* reject properties completely in objc1 instead of emitting Chris Lattner2008-10-201-7/+15
| | | | | | weird errors about property attributes being unknown. llvm-svn: 57812
* More property attribute recovery improvements. Instead of this:Chris Lattner2008-10-201-16/+13
| | | | | | | | | | | | | | | | | | | | | | crash.m:8:12: error: type name requires a specifier or qualifier @property (readonlyx, getter=isAwesome) int _awesome; ^ crash.m:8:29: error: expected ';' at end of declaration list @property (readonlyx, getter=isAwesome) int _awesome; ^ crash.m:8:39: error: expected identifier or '(' @property (readonlyx, getter=isAwesome) int _awesome; ^ we now get: crash.m:8:12: error: unknown property attribute 'readonlyx' @property (readonlyx, getter=isAwesome) int _awesome; ^ Also, we can eliminate isObjCPropertyAttribute now. llvm-svn: 57811
* significantly simplify and clean up error recovery in Chris Lattner2008-10-201-25/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ParseObjCPropertyAttribute. Before, on this code (where a comma was forgotten): @property (readonly getter=isAwesome) int _awesome; we emitted: crash.m:9:11: error: expected ')' @property (readonly getter=isAwesome) int _awesome; ^ crash.m:9:37: error: type name requires a specifier or qualifier @property (readonly getter=isAwesome) int _awesome; ^ crash.m:9:37: error: expected identifier or '(' crash.m:9:37: error: expected ';' at end of declaration list crash.m:9:1: error: @property requires fields to be named @property (readonly getter=isAwesome) int _awesome; ^ now we emit: crash.m:9:21: error: expected ')' @property (readonly getter=isAwesome) int _awesome; ^ crash.m:9:11: error: to match this '(' @property (readonly getter=isAwesome) int _awesome; ^ llvm-svn: 57809
OpenPOWER on IntegriCloud