summaryrefslogtreecommitdiffstats
path: root/clang/Parse/Parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Bug #:Steve Naroff2007-06-011-1/+2
| | | | | | | | | | | | | | | Submitted by: Reviewed by: Implement support for GCC __attribute__. - Implement "TODO" in Parser::ParseAttributes. Changed the return type from void to Parser::DeclTy. Changed all call sites to accept the return value. - Added Action::ParseAttribute and Sema::ParseAttribute to return an appropriate AST node. Added new node AttributeDecl to Decl.h. Still to do...hook up to the Decl... llvm-svn: 39539
* Add support for inserting up to 10 strings in a diagnostic, with %0, %1, %2,Chris Lattner2007-05-161-1/+1
| | | | | | etc. llvm-svn: 39447
* Do not invoke objc parser actions when a top level +/- is seen, unless objcChris Lattner2007-05-021-2/+13
| | | | | | is enabled. llvm-svn: 39430
* Generalize the skipping logic to allow skipping until any one of a set ofChris Lattner2007-04-271-8/+11
| | | | | | tokens is found. llvm-svn: 39419
* Do not use ParseCompoundStatement to parse the body of a function. This causesChris Lattner2007-01-211-2/+4
| | | | | | | | an extra scope stack to be pushed between the function body and arguments, which causes the parser to incorrectly accept stuff like 'int foo(int A) { int A; }', which is test/Parser/argument_redef.c. llvm-svn: 39252
* Add support for parsing and pretty printing const_cast, dynamic_cast,Chris Lattner2006-12-041-0/+1
| | | | | | reinterpret_cast, and static_cast. Patch by Bill! llvm-svn: 39247
* add some commentsChris Lattner2006-12-041-2/+2
| | | | llvm-svn: 39242
* Scrutinize K&R parameter declarations. This implements C99 6.9.1p6, correctlyChris Lattner2006-12-031-23/+130
| | | | | | diagnosing malformed K&R function definitions. llvm-svn: 39241
* Next step of retaining information about function prototypes: actually retainChris Lattner2006-12-021-2/+2
| | | | | | | | the info. Also, call Actions.ParseParamDeclaratorType instead of Actions.ParseDeclarator for parameter type lists: we don't want declaration objects created when parsing a function declarator, we just want type info. llvm-svn: 39230
* First step towards accurately retaining information about functionChris Lattner2006-12-021-1/+1
| | | | | | | | | parameters: build an array of ParamInfo structures and pass it to the declarator for safe keeping (it owns the list). Next step: actually populate the arg array with useful stuff. llvm-svn: 39229
* capture sourcelocation info for type specifiers. This improves diagnosticsChris Lattner2006-11-281-1/+1
| | | | | | for things like 'short _Complex'. llvm-svn: 39227
* record accurate sourceloc info for storage class specs, so we can reportChris Lattner2006-11-281-1/+2
| | | | | | | | | | | | | | | | things like: t.c:4:10: error: invalid storage class specifier in function declarator int foo2(auto int Aaslfkasdflkj, register B); ^ instead of: t.c:4:19: error: invalid storage class specifier in function declarator int foo2(auto int Aaslfkasdflkj, register B); ^ llvm-svn: 39224
* Finish converting DeclSpec to use accessors.Chris Lattner2006-11-281-2/+5
| | | | llvm-svn: 39223
* split the ParseFunctionDefinition action into two actions, one which isChris Lattner2006-11-211-1/+3
| | | | | | called before and one which is called after function definition parsing. llvm-svn: 39196
* Create a new TypeNameType class, which represents typedefs as types. ThisChris Lattner2006-11-201-1/+1
| | | | | | | | | | allows us to handle stuff like: typedef int G; .. X = sizeof(G); llvm-svn: 39189
* add an action method for declspecs without declarators, like "struct foo;".Chris Lattner2006-11-191-6/+1
| | | | llvm-svn: 39184
* build TypedefDecl objects when parsing typedefs.Chris Lattner2006-11-191-1/+5
| | | | | | Add a parsing fastpath for when we see typedef at the top-level. llvm-svn: 39182
* Rename SemaDeclSpec.{h|cpp} back to DeclSpec.{h|cpp} now that the distinctionChris Lattner2006-11-111-1/+1
| | | | | | between sema and parse is clear. llvm-svn: 39167
* remove diag helper that implicitly reports the diagnostic at the currentChris Lattner2006-11-101-2/+2
| | | | | | token: it is better for the code to be explicit. llvm-svn: 39158
* Change courses on how we do semantic analysis. Semantic analysisChris Lattner2006-11-091-14/+2
| | | | | | | | fundamentally requires having an AST around, so move all sema to the AST library. This is the first step, later steps will be needed to clean up libast. llvm-svn: 39150
* rename SemaDecl.cpp/h to SemaDeclSpec.cpp/hChris Lattner2006-11-081-1/+1
| | | | llvm-svn: 39149
* rename these methods so that they read correctly.Chris Lattner2006-11-081-3/+3
| | | | llvm-svn: 39148
* implement trivial scope caching. This reduces malloc traffic in the commonChris Lattner2006-11-061-7/+27
| | | | | | | | | | | | | | | | | | | | | case, speeding up parsing of this contrived example: #define A {{}} #define B A A A A A A A A A A #define C B B B B B B B B B B #define D C C C C C C C C C C #define E D D D D D D D D D D #define F E E E E E E E E E E #define G F F F F F F F F F F #define H G G G G G G G G G G void foo() { H } from 7.478s to 4.321s. GCC requires 8.2s. llvm-svn: 39138
* Make Scope keep track of the kind of scope it is. Properly scope loop andChris Lattner2006-11-051-4/+4
| | | | | | | switch statements. Make break/continue check that they are inside of an appropriate control-flow construct. This implements Parser/bad-control.c. llvm-svn: 39136
* start factoring actions into two flavors: minimal and semantic actions.Chris Lattner2006-11-051-2/+14
| | | | llvm-svn: 39133
* rename a bunch of files for better consistencyChris Lattner2006-11-051-1/+1
| | | | llvm-svn: 39126
* need to add scope for arguments, but now is not the right time.Chris Lattner2006-11-051-0/+8
| | | | llvm-svn: 39125
* Move objc productions to their own .cpp file.Chris Lattner2006-11-051-85/+0
| | | | llvm-svn: 39124
* improve objc commentsChris Lattner2006-11-051-7/+15
| | | | llvm-svn: 39123
* Add AST node, AST building, actions, and printing for 'for' stmts.Chris Lattner2006-11-041-15/+17
| | | | llvm-svn: 39113
* Emit:Chris Lattner2006-11-031-15/+21
| | | | | | | | | | test.m:2:14: error: expected ';' after @class @ class foo int x; ^ instead of silently accepting the malformed input. llvm-svn: 39100
* Fix case stmts to not fall through, rename methods, assert on unimplementedChris Lattner2006-11-031-25/+31
| | | | | | | | | | pieces, emit a diagnostic like this: test.m:4:1: error: unexpected '@' in program @ foo; ^ llvm-svn: 39099
* - Added basic structure for parsing top level Objective-C forms.Steve Naroff2006-10-271-0/+75
| | | | | | | - Extended the typedef mechanism for classes, improved performance of the common case. - Implemented @class in the parser. llvm-svn: 39074
* Make ConsumeFoo methods return the location of the consumed token.Chris Lattner2006-10-161-2/+1
| | | | llvm-svn: 38995
* implement action callbacks for almost all the stmts.Chris Lattner2006-10-161-4/+4
| | | | llvm-svn: 38993
* Changes through out the parser and actions/ast interface to return top-levelChris Lattner2006-10-161-17/+23
| | | | | | | | | | | | | | | | | | declarations through the asm streamer. For a testcase like: int G; int H, I, *J; int func() {} 'clang -parse-print-ast' prints: Read top-level decl: G Read top-level decl: H Read top-level decl: I Read top-level decl: J Read top-level decl: func llvm-svn: 38992
* start creating proper ast nodes for variables and functionsChris Lattner2006-10-151-2/+2
| | | | llvm-svn: 38991
* Rename LexerToken methods to be more consistent.Chris Lattner2006-10-141-1/+1
| | | | llvm-svn: 38969
* Initial support for semantic analysis and AST building for StringExpr nodes.Chris Lattner2006-10-061-1/+2
| | | | llvm-svn: 38960
* Hook up more of the ASTStreamerChris Lattner2006-08-171-11/+33
| | | | llvm-svn: 38936
* Implement asm statement parsing.Chris Lattner2006-08-151-16/+19
| | | | llvm-svn: 38929
* Make MatchRHSPunctuation smarter, allowing its clients to be simpler.Chris Lattner2006-08-151-4/+11
| | | | llvm-svn: 38926
* Allow ExpectAndConsume to be used with any token.Chris Lattner2006-08-151-1/+1
| | | | llvm-svn: 38923
* Parse asm specifiers on init declarators. Add __builtin_va_list to theChris Lattner2006-08-151-3/+64
| | | | | | symbol table at startup time. llvm-svn: 38922
* Rename Parse/ParserActions.h -> Parse/Action.hChris Lattner2006-08-141-4/+3
| | | | llvm-svn: 38913
* Add methods for scope manipulation.Chris Lattner2006-08-141-12/+40
| | | | llvm-svn: 38909
* Implement initializer parsering.Chris Lattner2006-08-131-1/+1
| | | | llvm-svn: 38900
* Parse things like 'struct X;'Chris Lattner2006-08-131-3/+7
| | | | llvm-svn: 38898
* Add a new ExpectAndConsume method to make parsing easier, and add a newChris Lattner2006-08-121-17/+21
| | | | | | ConsumeAnyToken method. llvm-svn: 38894
* Implement parsing of array declarators like:Chris Lattner2006-08-121-1/+1
| | | | | | int Array[*(int*)P+A]; llvm-svn: 38890
OpenPOWER on IntegriCloud