summaryrefslogtreecommitdiffstats
path: root/clang/Parse
Commit message (Collapse)AuthorAgeFilesLines
...
* Patch to parse @implementation prologue, method definitions,Fariborz Jahanian2007-09-011-14/+160
| | | | | | objc2's @synthesize and @dynamic. llvm-svn: 41667
* Fix a bug/missing-feature Ted noticed: the 'unused' warning should notChris Lattner2007-08-312-7/+6
| | | | | | | | | | warn about the last stmt in a stmtexpr, f.e. there should be no warning for: int maxval_stmt_expr(int x, int y) { return ({int _a = x, _b = y; _a > _b ? _a : _b; }); } llvm-svn: 41655
* Author: F. JahanianFariborz Jahanian2007-08-312-3/+115
| | | | | | | | | | | | | Log: Implement parsing of objective-c's new @property declaration. Modified: include/clang/Basic/DiagnosticKinds.def include/clang/Parse/Parser.h Parse/ParseObjc.cpp Parse/Parser.cpp llvm-svn: 41644
* don't turn semantic errors into parse errors.Chris Lattner2007-08-311-9/+13
| | | | llvm-svn: 41638
* fix some memory leaks when recovering.Chris Lattner2007-08-311-3/+18
| | | | llvm-svn: 41637
* Pass the location of the type.Chris Lattner2007-08-301-1/+2
| | | | llvm-svn: 41612
* make sure to parse postfix expression suffixes after builtinChris Lattner2007-08-301-7/+10
| | | | | | primary expressions. llvm-svn: 41607
* add an action callback for __builtin_offsetofChris Lattner2007-08-301-12/+38
| | | | llvm-svn: 41606
* cleanup context-sensitive objc keyword recognition. Patch by Fariborz Jahanian.Chris Lattner2007-08-292-5/+14
| | | | llvm-svn: 41583
* Tweak declaration...Steve Naroff2007-08-281-1/+1
| | | | llvm-svn: 41542
* Implement more thoughful error recovery when dealing with bogus declarator ↵Steve Naroff2007-08-281-3/+2
| | | | | | | | | | | | | | | | | | | | | | types. For example, the following code was resulting in spurious warnings. This was the result of Sema::GetTypeForDeclarator() synthesizing a type to hand back to the caller (in this case, "int []", instead of "struct s[]", which is invalid). struct s; struct s* t (struct s z[]) { // expected-error {{array has incomplete element type}} return z; } Strategy: Flag the error in Declarator/DeclaratorChunk. This info is later stored in the ParmVarDecl. If the decl is referenced, Sema::ParseIdentifierExpr() will check if the type is invalid. If so, it quietly returns "true", without instantiating a DeclRefExpr. This seems to work nicely. If Chris is happy with the approach, I will generalize this to all VarDecls. llvm-svn: 41521
* C++ allows empty enum list.Chris Lattner2007-08-271-1/+2
| | | | llvm-svn: 41498
* extwarn about decls intermixed with code in c89 mode.Chris Lattner2007-08-271-3/+0
| | | | llvm-svn: 41477
* implement a fixme: __extension__ marker on decls in compound stmts.Chris Lattner2007-08-271-3/+39
| | | | llvm-svn: 41473
* Fix test/Parser/if-scope-*.c. Patch by Neil Booth!Chris Lattner2007-08-261-8/+35
| | | | llvm-svn: 41471
* Break the assumption that any sort of scope (e.g. a loop scope) can Chris Lattner2007-08-263-18/+19
| | | | | | | | hold declarations. Instead, introduce a new "DeclScope" scope type that holds them explicitly. For now, all scopes have this bit, but in the future we can use them to fix some issues Neil noticed. llvm-svn: 41431
* read and ignore the body of a namespace.Chris Lattner2007-08-252-2/+5
| | | | llvm-svn: 41403
* refactor enough of the top-level parsing logic to parse andChris Lattner2007-08-253-5/+102
| | | | | | ignore 'namespace foo {}' llvm-svn: 41400
* C++ explicitly allows an empty source file.Chris Lattner2007-08-251-1/+2
| | | | llvm-svn: 41399
* - Cleanup "hack" comment and fix typos.Steve Naroff2007-08-232-6/+9
| | | | | | - Use getLang().ObjC2 when appropriate. llvm-svn: 41333
* Add helper functions Token::isObjCAtKeyword() and Token::getObjCKeywordID().Steve Naroff2007-08-231-18/+10
| | | | | | Convert all clients to the new cleaner, more robust API. llvm-svn: 41330
* As suggested by Chris, use MatchRHSPunctuation instead of manually looking ↵Anders Carlsson2007-08-231-11/+3
| | | | | | for a right parenthesis when parsing @encode() and @protocol(). llvm-svn: 41321
* Parse ObjC @protocol expressions.Anders Carlsson2007-08-231-1/+40
| | | | llvm-svn: 41320
* With this commit, we now successfully parse "Cocoa.h"!Steve Naroff2007-08-222-6/+27
| | | | llvm-svn: 41303
* Add support for parsing protocols.Steve Naroff2007-08-222-20/+86
| | | | | | Now we can parse quite a bit of "Foundation.h" (a couple bugs remain). llvm-svn: 41300
* Finish up method prototype parsing.Steve Naroff2007-08-221-13/+60
| | | | | | Next step...starting installing class names into the type namespace (so we can start parsing Cocoa headers). llvm-svn: 41283
* Add support for parsing method prototypes (and other stuff required by ↵Steve Naroff2007-08-221-22/+160
| | | | | | | | | | @interface). Still need to finish Parser::ParseObjCMethodDecl(). Before I do, I need to do a minor refactoring of ParseDeclarationOrFunctionDefinition(), to disallow function definitions. At the moment, @inteface allows function defs (which is incorrect). llvm-svn: 41275
* Parse @encode expressions.Anders Carlsson2007-08-221-0/+29
| | | | llvm-svn: 41273
* update todo markersChris Lattner2007-08-221-3/+3
| | | | llvm-svn: 41267
* optimize scope push/pop to avoid work in the common case.Chris Lattner2007-08-221-18/+31
| | | | llvm-svn: 41265
* Fix the scoping issue Neil pointed out for the rest ofChris Lattner2007-08-221-4/+32
| | | | | | | the selection statements and iteration statements. Add spec citations. llvm-svn: 41264
* Fix a nasty C99 scope issue that Neil pointed out (for ifs)Chris Lattner2007-08-221-0/+14
| | | | | | This fixes test/Parser/control-scope.c llvm-svn: 41263
* Implement parsing for objc instance variables.Steve Naroff2007-08-211-3/+54
| | | | | | Next step, method... llvm-svn: 41251
* Don't remove the grammar construct, just the TODO.Anders Carlsson2007-08-211-0/+1
| | | | llvm-svn: 41245
* Tweak error recovery for missing semicolon after decl. For this:Chris Lattner2007-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | void foo() { int x if (x) { } } We now emit: a.c:5:3: error: parse error if (x) { ^ 1 diagnostic generated. instead of: a.c:5:3: error: parse error if (x) { ^ a.c:9:1: error: expected '}' ^ 2 diagnostics generated. llvm-svn: 41243
* Remove objc-string-literal since it's been implemented now.Anders Carlsson2007-08-211-1/+0
| | | | llvm-svn: 41241
* Implement parsing and code generation of Objective-C string literals.Anders Carlsson2007-08-212-0/+26
| | | | llvm-svn: 41238
* Added Parser::ParseStructDeclaration() as a result of refactoring ↵Steve Naroff2007-08-201-73/+79
| | | | | | | | | Parser::ParseStructUnionBody(). Motivation: Objective-C can now share this rule. It also makes Parser::ParseStructUnionBody() a bit smaller/cleaner.. llvm-svn: 41201
* Start parsing ObjC classes/categories!Steve Naroff2007-08-202-12/+226
| | | | | | | Next step, refactor Parser::ParseStructUnionBody() so that struct declarations can be shared with Objective-C (for declaring instance variables). llvm-svn: 41200
* add support for a top-level __extension__ marker, implementing a todo.Chris Lattner2007-08-101-3/+10
| | | | llvm-svn: 41004
* minor cleanupsChris Lattner2007-08-091-6/+4
| | | | llvm-svn: 40963
* __attribute__ starts a declspec.Chris Lattner2007-08-091-1/+3
| | | | llvm-svn: 40962
* Implement __builtin_choose_expr.Steve Naroff2007-08-031-7/+23
| | | | llvm-svn: 40794
* Tidy up Parser::ParseTypeofSpecifier()...implement FIXME and minor restructure.Steve Naroff2007-08-021-18/+20
| | | | llvm-svn: 40713
* - Finish hooking up support for __builtin_types_compatible_p().Steve Naroff2007-08-011-3/+8
| | | | | | - Fix type printing code for recently added TypeOfExpr/TypeOfType. llvm-svn: 40700
* Add AST/Sema support for __builtin_types_compatible_p (a GNU extension).Steve Naroff2007-08-011-2/+2
| | | | | | Todo...still need to call the action from the parser... llvm-svn: 40693
* Tighten up Parser::ParseTypeofSpecifier().Steve Naroff2007-07-311-17/+23
| | | | | | Add some more tests to typeof.c. Also added a couple of missing "expect" attributes that caused the test to fail. llvm-svn: 40656
* Add parsing and AST support for GNU "typeof".Steve Naroff2007-07-312-0/+50
| | | | | | | Many small changes to lot's of files. Still some FIXME's, however the basic support is in place. llvm-svn: 40631
* Fix a couple of bugs, add some new cool stuff.Chris Lattner2007-07-252-3/+5
| | | | | | | | | | | | | | | 1. Fix a todo in Parser::ParseTag, to recover better. On code like that in test/Sema/decl-invalid.c it causes us to return a single error instead of multiple. 2. Fix an error in Sema::ParseDeclarator, where it would crash if the declarator didn't have an identifier. Instead, diagnose the problem. 3. Start adding infrastructure to track the range of locations covered by a declspec or declarator. This is mostly implemented for declspec, but could be improved, it is missing for declarator. Thanks to Neil for pointing out this crash. llvm-svn: 40482
* Fix a comment, patch by Kevin Andre!Chris Lattner2007-07-241-1/+1
| | | | llvm-svn: 40466
OpenPOWER on IntegriCloud