summaryrefslogtreecommitdiffstats
path: root/clang/Parse/ParseExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-1081/+0
| | | | | | | | | | lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
* add parsing, ast building and pretty printing support for C++ throw expressions.Chris Lattner2008-02-261-0/+7
| | | | | | Patch by Mike Stump! llvm-svn: 47582
* Implement support for __extension__ which silences extwarnings in its Chris Lattner2008-02-021-2/+12
| | | | | | scope. This is part of the fix for PR1966 llvm-svn: 46669
* Remainder of the __builtin_overload feedbackNate Begeman2008-01-311-6/+0
| | | | llvm-svn: 46601
* remove an implemented todoChris Lattner2008-01-251-2/+1
| | | | llvm-svn: 46362
* Implement basic overload support via a new builtin, __builtin_overload.Nate Begeman2008-01-171-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | __builtin_overload takes 2 or more arguments: 0) a non-zero constant-expr for the number of arguments the overloaded functions will take 1) the arguments to pass to the matching overloaded function 2) a list of functions to match. The return type of __builtin_overload is inferred from the function whose args match the types of the arguments passed to the builtin. For example: float a; float sinf(float); int sini(int); float b = __builtin_overload(1, a, sini, sinf); Says that we are overloading functions that take one argument, and trying to pass an argument of the same type as 'a'. sini() does not match since it takes and argument of type int. sinf does match, so at codegen time this will turn into float b = sinf(a); llvm-svn: 46132
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-291-2/+2
| | | | | | discussion of this change. llvm-svn: 45410
* Fix an nice and subtle parser bug reported by Nico Weber.Chris Lattner2007-12-181-2/+2
| | | | llvm-svn: 45149
* Parse "sizeof(arr)[0]" as a sizeof of an expr if arr Chris Lattner2007-11-131-2/+6
| | | | | | is an expression. llvm-svn: 44065
* Fix a parser bug with message expressions - need to call ↵Steve Naroff2007-10-151-3/+4
| | | | | | | | | | ParsePostfixExpressionSuffix(). Now were correctly allow the following... i = [str rangeOfString:@"]"].length; llvm-svn: 43012
* Add code generation and sema checking for __builtin_va_arg.Anders Carlsson2007-10-151-6/+10
| | | | llvm-svn: 43006
* switch more code to use Token::is/isNot where possible.Chris Lattner2007-10-091-31/+29
| | | | llvm-svn: 42797
* this patch accomodates clattner's comments on expression processing in ↵Fariborz Jahanian2007-10-041-1/+1
| | | | | | @try-statement. llvm-svn: 42611
* minor cleanupChris Lattner2007-10-031-8/+7
| | | | llvm-svn: 42596
* Removed a few TODOs on things which are done.Fariborz Jahanian2007-09-261-3/+3
| | | | llvm-svn: 42358
* Patch to parse objective-c's @try-statement and @throw-statement.Fariborz Jahanian2007-09-191-1/+16
| | | | llvm-svn: 42148
* Rename statement actions (from Parse-prefix to ActOn-prefix).Steve Naroff2007-09-161-5/+5
| | | | llvm-svn: 42000
* Rename expression actions (from Parse-prefix to ActOn-prefix).Steve Naroff2007-09-161-18/+18
| | | | llvm-svn: 41997
* Start converting Action methods from Parse-prefix to ActOn-prefix.Steve Naroff2007-09-151-3/+3
| | | | | | The previous naming scheme was confusing, since it resulted in both the Parser and Action modules having methods with the same name. In addition, the Action module never does any parsing... llvm-svn: 41986
* 1. Fix parsing of method prototype involving c-style argument declarations.Fariborz Jahanian2007-09-051-5/+7
| | | | | | | | 2. Fixes all allowable key-words used as selectors. 3. Template to do the messaging parse. 4. A test case for all allowable selector names. llvm-svn: 41723
* Fix a bug/missing-feature Ted noticed: the 'unused' warning should notChris Lattner2007-08-311-3/+2
| | | | | | | | | | 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
* 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
* Don't remove the grammar construct, just the TODO.Anders Carlsson2007-08-211-0/+1
| | | | llvm-svn: 41245
* 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-211-0/+2
| | | | llvm-svn: 41238
* Implement __builtin_choose_expr.Steve Naroff2007-08-031-7/+23
| | | | llvm-svn: 40794
* - 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
* implement ast building and trivial semantic analysis of stmt exprs.Chris Lattner2007-07-241-4/+8
| | | | | | This implements test/Sema/stmt_exprs.c llvm-svn: 40465
* Implement code generation for __func__, __FUNCTION__ and __PRETTY_FUNCTION__Anders Carlsson2007-07-211-1/+1
| | | | llvm-svn: 40162
* improve and simplify error recovery for calls, fix a crash when diagnosingChris Lattner2007-07-211-6/+3
| | | | | | invalid arguments. llvm-svn: 40161
* At one point there were going to be lexer and parser tokens.Chris Lattner2007-07-201-6/+6
| | | | | | | Since that point is now long gone, we should rename LexerToken to Token, as it is the only kind of token we have. llvm-svn: 40105
* Work towards fixing crasher with compound literals...Steve Naroff2007-07-191-1/+2
| | | | | | | | | | | | | | | | Before this commit, we crashed in ParseBinOp... [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang -parse-ast-check compound_literal.c SemaExpr.cpp:1298: failed assertion `(rhs != 0) && "ParseBinOp(): missing right expression"' With this commit, we still crash in the newly added action ParseCompoundLiteral (which is progress:-) [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang -parse-ast-check compound_literal.c SemaExpr.cpp:478: failed assertion `(Op != 0) && "ParseCompoundLiteral(): missing expression"' The crash go away once the actions return AST nodes. I will do this in a separate commit. llvm-svn: 40032
* Submitted by: Bill WendlingBill Wendling2007-06-291-0/+4
| | | | | | | | | | | | Reviewed by: Chris Lattner - Fix for C++ casting operators failing during parsing. Deriving the C++ cast expressions from CastExpr was the wrong way to go. Its constructor creates null QualTypes in one of its constructors. This doesn't work well with how the C++ casting expression class wanted to do things. Derive just from Expr instead. llvm-svn: 39714
* Submitted by: Bill WendlingBill Wendling2007-06-281-2/+1
| | | | | | Small cleanup. No need to assign to a variable before returning. llvm-svn: 39697
* Finally bite the bullet and make the major change: split the clang namespaceChris Lattner2007-06-151-4/+3
| | | | | | | | | | | | | out of the llvm namespace. This makes the clang namespace be a sibling of llvm instead of being a child. The good thing about this is that it makes many things unambiguous. The bad things is that many things in the llvm namespace (notably data structures like smallvector) now require an llvm:: qualifier. IMO, libsystem and libsupport should be split out of llvm into their own namespace in the future, which will fix this issue. llvm-svn: 39659
* implement full sema support for the GCC address-of-label extension.Chris Lattner2007-05-281-6/+5
| | | | llvm-svn: 39510
* Fix a problem where a semantic error confused error recovery to the pointChris Lattner2007-05-211-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | where the parser emitted bogus diagnostics. Before, when compiling: struct A { int X; } someA; int func(int, struct A); int test1(void *P, int C) { return func(((C*40) + *P) / 42+P, someA); } we emitted: bug3.c:7:25: error: invalid operands to binary expression ('int' and 'void') return func(((C*40) + *P) / 42+P, someA); ~~~~~~ ^ ~~ bug3.c:7:31: error: expected ')' return func(((C*40) + *P) / 42+P, someA); ^ bug3.c:7:16: error: to match this '(' return func(((C*40) + *P) / 42+P, someA); ^ now we only emit the first. llvm-svn: 39474
* Bug #:Steve Naroff2007-04-261-0/+4
| | | | | | | | | | | | | | Submitted by: Reviewed by: Misc. changes driven by getting "carbon.h" to compile... - Added ParseCharacterConstant() hook to Action, Sema, etc. - Added CheckAssignmentOperands() & CheckCommaOperands() to Sema. - Added CharacterLiteral AST node. - Fixed CallExpr instantiation - install the correct type. - Install a bunch of temp types and annotate with FIXME's. llvm-svn: 39416
* Bug #:Steve Naroff2007-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: Reviewed by: Type Checking...round 2. This checkin "breaks" parsing carbon.h. I imagine that this will be true for the next week or so. Nevertheless, this round of changes includes the following: - Hacked various Expr classes to pass the appropriate TypeRef. Still have a few more classes to touch. - Implement type checking for ParseArraySubscriptExpr and ParseMemberReferenceExpr. - Added a debug hook to derive the class name for Stmt/Expr nodes. Currently a linear search...could easily optimize if important. - Changed the name of TaggedType->TagType. Now we have TagType and TagDecl (which are easier to remember). - Fixed a bug in StringLiteral conversion I did a couple weeks ago. hadError was not initialized (oops). - changed Sema::Diag to return true. This streamlines the type checking code considerably. - Added many diagnositics. This should be it! llvm-svn: 39361
* Bug #:Steve Naroff2007-03-141-1/+1
| | | | | | | | | | | | | | | Submitted by: Reviewed by: Added size expression to ArrayType. This was needed to implement Type::isIncompleteType(). At the moment, there is no support for determining if we have a constant expression (which won't be too difficult now that we have support for literal parsing/ast's). Nevertheless, the parser will allow "struct foo { int a[b]; }" (which is illegal). There is still significant work to fully analyze array types. The good news is "carbon.h" goes from 288 bogus errors down to 26! llvm-svn: 39355
* Bug #:Steve Naroff2007-03-061-112/+1
| | | | | | | | | | | | | | | Submitted by: Reviewed by: More code to parse numeric constants. This checkin includes: - Feedback from Chris. - Support for parsing floating point constants. - Moved the code to "Sema". Changed API in Action. - More/better error diagnostics. At this point, the parsing support should be largely complete. Next step is to work on filling in sensible values (in IntegerLiteral/FloatLiteral). llvm-svn: 39349
* Bug #:Steve Naroff2007-03-031-7/+112
| | | | | | | | | | | | | Submitted by: Reviewed by: First phase of parsing IntegerConstants. At the moment, all processing is done in the Parser, not Sema. If necessary, this is easy to move. Next steps: - Convert well for strings to actual values (need to look @ APInt.h) - Design the API between the Parser and Sema. Sema shouldn't have to be concerned with any parsing issues... llvm-svn: 39348
* Batch search/replace snafu (inadvertantly changed ↵Steve Naroff2007-02-211-2/+2
| | | | | | | | | IntegerConstant->StringLiteral). clang still compiled/linked/ran properly...simply a confusing name regression. From now on I'll make sure I run "cvs diff" before committing any changes! llvm-svn: 39342
* rename IntegerConstant->IntegerLiteralSteve Naroff2007-02-211-2/+2
| | | | | | | rename FloatingConstant->FloatingLiteral rename StringExpr->StringLiteral llvm-svn: 39341
* C++: Added support for bool types.Bill Wendling2007-02-131-0/+5
| | | | llvm-svn: 39338
OpenPOWER on IntegriCloud