summaryrefslogtreecommitdiffstats
path: root/clang/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* Handle void correctly in the argument list for a function. For:Chris Lattner2006-12-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | X = sizeof(int (void a)); X = sizeof(int (int, void)); X = sizeof(int (void, ...)); We now emit: t.c:6:24: error: void argument may not have a name X = sizeof(int (void a)); ^ t.c:7:24: error: 'void' must be the first and only parameter if specified X = sizeof(int (int, void)); ^ t.c:8:19: error: 'void' must be the first and only parameter if specified X = sizeof(int (void, ...)); ^ And we pretty print this correctly (even though void isn't stored in the arg list of the function type): X = sizeof(int (void)); However, this approach will have to change to handle typedefs of void. llvm-svn: 39235
* implement AST representation for function types with and without a prototype.Chris Lattner2006-12-023-2/+135
| | | | | | | | | | | | | | | | | | | | This lets us pretty print stuff like this: void foo() { int X; X = sizeof(void (*(*)())()); X = sizeof(int(*)(int, float, ...)); X = sizeof(void (*(int arga, void (*argb)(double Y)))(void* Z)); as: X = sizeof(void (*(*)())()) X = sizeof(int (*)(int, float, ...)) X = sizeof(void (*(int, void (*)(double)))(void *)) Ah the wonders of 'modern' C syntax! llvm-svn: 39232
* implement ParseParamDeclaratorType in the ast builderChris Lattner2006-12-022-0/+14
| | | | llvm-svn: 39231
* Next step of retaining information about function prototypes: actually retainChris Lattner2006-12-022-6/+6
| | | | | | | | 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
* Finish converting DeclSpec to use accessors.Chris Lattner2006-11-282-14/+17
| | | | llvm-svn: 39223
* Convert more code to use DeclSpec accessorsChris Lattner2006-11-281-1/+1
| | | | llvm-svn: 39222
* add accessors to DeclSpec, start moving clients over to use them.Chris Lattner2006-11-281-3/+3
| | | | llvm-svn: 39221
* When a decl is popped from its current scope, link it to the decl chain forChris Lattner2006-11-211-5/+10
| | | | | | the containing function. This avoids leaking decls. llvm-svn: 39197
* split the ParseFunctionDefinition action into two actions, one which isChris Lattner2006-11-212-9/+26
| | | | | | called before and one which is called after function definition parsing. llvm-svn: 39196
* Add support for C90 implicitly defined functions, e.g.:Chris Lattner2006-11-204-7/+62
| | | | | | | | int A() { return X(); } llvm-svn: 39194
* remember referenced decls in our AST'sChris Lattner2006-11-202-4/+3
| | | | llvm-svn: 39193
* parse identifier expressions properly. This allows us diagnose this:Chris Lattner2006-11-203-12/+31
| | | | | | | | | | | | | | | | | | | | | | | typedef int X; int A() { return X; } int B() { return Y; } as: /Users/sabre/test.c:5:10: error: unexpected type name 'X': expected expression return X; ^ /Users/sabre/test.c:9:10: error: use of undeclared 'Y' value return Y; ^ llvm-svn: 39192
* remember and pretty-print cast typesChris Lattner2006-11-204-6/+13
| | | | llvm-svn: 39191
* correctly handle stuff like:Chris Lattner2006-11-203-4/+10
| | | | | | | | typedef int G; X = sizeof(const G); X = sizeof(restrict G); llvm-svn: 39190
* Create a new TypeNameType class, which represents typedefs as types. ThisChris Lattner2006-11-203-5/+36
| | | | | | | | | | allows us to handle stuff like: typedef int G; .. X = sizeof(G); llvm-svn: 39189
* when a typedef name is parsed as part of declspecs, remember the decl for theChris Lattner2006-11-202-4/+3
| | | | | | typedef. llvm-svn: 39188
* decls should all have typesChris Lattner2006-11-191-5/+4
| | | | llvm-svn: 39187
* remove #include of clang/Parse/DeclSpec.h from clang/AST/Decl.hChris Lattner2006-11-192-5/+5
| | | | llvm-svn: 39186
* implement RTTI for Decl objects, eliminate some hokey virtual methods.Chris Lattner2006-11-191-5/+7
| | | | llvm-svn: 39185
* add an action method for declspecs without declarators, like "struct foo;".Chris Lattner2006-11-192-1/+20
| | | | llvm-svn: 39184
* build TypedefDecl objects when parsing typedefs.Chris Lattner2006-11-193-22/+45
| | | | | | Add a parsing fastpath for when we see typedef at the top-level. llvm-svn: 39182
* Parse and remember types enough that we can pretty print:Chris Lattner2006-11-194-4/+17
| | | | | | | | | | | | | | void foo(int X) { X = __alignof(int); X = sizeof(const int** restrict ** volatile*); } as: x = __alignof(int) x = sizeof(int const **restrict **volatile *) llvm-svn: 39181
* add an action for parsing type names.Chris Lattner2006-11-191-2/+1
| | | | llvm-svn: 39180
* rearrange the type printing code so that we can do the horrible C "inside out"Chris Lattner2006-11-132-16/+32
| | | | | | | | | thing properly. This allows us to print types like: int (*A)[restrict static 4][6]; properly, in addition to representing them properly. :) llvm-svn: 39178
* change print methods to render into a string, which is more useful for ↵Chris Lattner2006-11-131-25/+26
| | | | | | | | diagnostics and for handling precedence of types more accurately llvm-svn: 39177
* Implement parsing, printing and AST'ing of array types (except for the bounds).Chris Lattner2006-11-123-19/+76
| | | | | | | | | | This allows us to handle: int (*A)[restrict static 4][6]; for example. llvm-svn: 39176
* Implement and use isa/dyncast/cast etc for Type classes.Chris Lattner2006-11-121-2/+2
| | | | llvm-svn: 39175
* Teach ASTContext to delete all created types in its dtor.Chris Lattner2006-11-122-23/+43
| | | | | | | Teach getPointerType to (stupidly) memoize all created pointers. Give types an enum so we can implement classof. llvm-svn: 39174
* Build ASTs for the pointer qualifiers on declarators. This allows us toChris Lattner2006-11-124-66/+100
| | | | | | | | | | parse (and print) things like: int* const* restrict* const volatile*** etc. llvm-svn: 39173
* We can now parse and remember the distinction between:Chris Lattner2006-11-121-2/+2
| | | | | | | | 'unsigned char' and 'unsigned char const'. -Chris llvm-svn: 39172
* implement conversion of simple declspec base types, and implement TypeRef::dumpChris Lattner2006-11-113-1/+89
| | | | llvm-svn: 39170
* restructure code to build the framework for creating types from declarators.Chris Lattner2006-11-115-49/+117
| | | | llvm-svn: 39166
* add the builtin typesChris Lattner2006-11-101-0/+49
| | | | llvm-svn: 39164
* Let ASTContext hold target info, since it's usefulChris Lattner2006-11-102-2/+23
| | | | llvm-svn: 39162
* introduce a new ASTContext class to hold long-lived ast nodes.Chris Lattner2006-11-105-26/+25
| | | | llvm-svn: 39161
* move the rest of the expr sema to SemaExpr.cpp and the decl processing stuffChris Lattner2006-11-104-235/+233
| | | | | | to SemaDecl.cpp llvm-svn: 39159
* move semantic analysis of break/continue out of the parser into the sema class.Chris Lattner2006-11-103-4/+36
| | | | llvm-svn: 39157
* move semantic analysis of statements to it's own file.Chris Lattner2006-11-102-91/+106
| | | | llvm-svn: 39156
* split semantic analysis of expressions out to its own fileChris Lattner2006-11-102-220/+239
| | | | llvm-svn: 39155
* move ASTBuilder.h/cpp to be a private Sema.h/cpp files, not part of theChris Lattner2006-11-102-5/+5
| | | | | | interface exported by libast. llvm-svn: 39154
* rename ASTBuilder to SemaChris Lattner2006-11-093-71/+63
| | | | llvm-svn: 39153
* Change courses on how we do semantic analysis. Semantic analysisChris Lattner2006-11-093-13/+241
| | | | | | | | 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
* pretty print postfix ++/-- nicerChris Lattner2006-11-052-5/+20
| | | | llvm-svn: 39137
* start factoring actions into two flavors: minimal and semantic actions.Chris Lattner2006-11-051-1/+1
| | | | llvm-svn: 39133
* print indirect goto correctlyChris Lattner2006-11-051-1/+1
| | | | llvm-svn: 39122
* build ast nodes and print goto/goto*/break/continue.Chris Lattner2006-11-053-7/+57
| | | | llvm-svn: 39121
* Add ast node support for case/default/label stmts.Chris Lattner2006-11-053-1/+52
| | | | llvm-svn: 39120
* implement AST node for switch stmtChris Lattner2006-11-043-22/+17
| | | | llvm-svn: 39119
OpenPOWER on IntegriCloud