summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Propagate new-style exception spec information to Declarator.Sebastian Redl2011-03-051-2/+3
| | | | llvm-svn: 127111
* Push nested-name-specifier source-location information into dependentDouglas Gregor2011-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | template specialization types. This also required some parser tweaks, since we were losing track of the nested-name-specifier's source location information in several places in the parser. Other notable changes this required: - Sema::ActOnTagTemplateIdType now type-checks and forms the appropriate type nodes (+ source-location information) for an elaborated-type-specifier ending in a template-id. Previously, we used a combination of ActOnTemplateIdType and ActOnTagTemplateIdType that resulted in an ElaboratedType wrapped around a DependentTemplateSpecializationType, which duplicated the keyword ("class", "struct", etc.) and nested-name-specifier storage. - Sema::ActOnTemplateIdType now gets a nested-name-specifier, which it places into the returned type-source location information. - Sema::ActOnDependentTag now creates types with source-location information. llvm-svn: 126808
* fix rdar://9024687, a crash on invalid that we used to silently ignore.Chris Lattner2011-02-181-0/+3
| | | | llvm-svn: 125962
* Switch labels over to using normal name lookup, instead of their Chris Lattner2011-02-181-2/+3
| | | | | | | own weird little DenseMap. Hey look, we now emit unused label warnings deterministically, amazing. llvm-svn: 125813
* When Parser::ParseExpressionList isn't given a completer, fall back toDouglas Gregor2011-02-171-0/+2
| | | | | | | normal "expression" completion. Fixes the most annoying code-completion bug I've found. llvm-svn: 125715
* When we encounter an Objective-C class name in an expression, followedDouglas Gregor2011-02-151-5/+10
| | | | | | | by the code completion token, treat this as a class message send where the opening square bracket is missing. Fixes <rdar://problem/6970911>. llvm-svn: 125587
* Parse: add support for parsing CUDA kernel callsPeter Collingbourne2011-02-091-10/+55
| | | | llvm-svn: 125219
* Implement the Microsoft __is_convertible_to type trait, modeling theDouglas Gregor2011-01-271-2/+4
| | | | | | | | | | semantics after the C++0x is_convertible type trait. This implementation is not 100% complete, because it allows access errors to be hard errors (rather than just evaluating false). Original patch by Steven Watanabe! llvm-svn: 124425
* Rvalue references for *this: parse ref-qualifiers.Douglas Gregor2011-01-261-0/+1
| | | | llvm-svn: 124276
* Add support for explicit constructor calls in Microsoft mode.Francois Pichet2011-01-181-1/+3
| | | | | | | | | | | | | | | | | | | For example: class A{ public: A& operator=(const A& that) { if (this != &that) { this->A::~A(); this->A::A(that); // <=== explicit constructor call. } return *this; } }; More work will be needed to support an explicit call to a template constructor. llvm-svn: 123735
* Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin2011-01-181-2/+1
| | | | | | -Wint-to-pointer-cast. llvm-svn: 123719
* Implement the sizeof...(pack) expression to compute the length of aDouglas Gregor2011-01-041-0/+42
| | | | | | | | | parameter pack. Note that we're missing proper libclang support for the new SizeOfPackExpr expression node. llvm-svn: 122813
* Implement support for pack expansions in initializer lists andDouglas Gregor2011-01-031-6/+8
| | | | | | expression lists. llvm-svn: 122764
* Refactor how we collect attributes during parsing, and add slots for attributesJohn McCall2010-12-241-19/+8
| | | | | | | on array and function declarators. This is pretty far from complete, and I'll revisit it later if someone doesn't beat me to it. llvm-svn: 122535
* Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet2010-12-081-20/+1
| | | | | | BinaryTypeTraitExpr. llvm-svn: 121298
* Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet2010-12-071-0/+3
| | | | | | New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. llvm-svn: 121074
* Fix the source range of CXXNewExprs. Fixes http://llvm.org/pr8661.Nico Weber2010-11-221-2/+2
| | | | llvm-svn: 119966
* Provide code completion for types after the '^' that starts a blockDouglas Gregor2010-10-181-0/+5
| | | | | | literal. llvm-svn: 116754
* When we have two identifiers in a row in Objective-C, make sure toDouglas Gregor2010-09-281-1/+1
| | | | | | | | verify that we aren't in a message-send expression before digging into the identifier or looking ahead more tokens. Fixes a regression (<rdar://problem/8483253>) I introduced with bracket insertion. llvm-svn: 114968
* Continue parsing more postfix expressions, even after semanticDouglas Gregor2010-09-181-29/+18
| | | | | | errors. Improves code completion in yet another case. llvm-svn: 114255
* Improve recovery when the middle expression of a ternary operator is ill-formedDouglas Gregor2010-09-171-2/+4
| | | | llvm-svn: 114231
* When we run into an error parsing or type-checking the left-hand sideDouglas Gregor2010-09-171-24/+16
| | | | | | | | | | | | | | | | | | | | | | | of a binary expression, continue on and parse the right-hand side of the binary expression anyway, but don't call the semantic actions to type-check. Previously, we would see the error and then, effectively, skip tokens until the end of the statement. The result should be more useful recovery, both in the normal case (we'll actually see errors beyond the first one in a statement), but it also helps code completion do a much better job, because we do "real" code completion on the right-hand side of an invalid binary expression rather than completing with the recovery completion. For example, given x = p->y if there is no variable named "x", we can still complete after the p-> as a member expression. Along the recovery path, we would have completed after the "->" as if we were in an expression context, which is mostly useless. llvm-svn: 114225
* rename variable, 'Type' seems to be present inGabor Greif2010-09-171-3/+3
| | | | | | the enclosing scope, which confuses gcc v3.4 to no end llvm-svn: 114174
* Implement automatic bracket insertion for Objective-C class messageDouglas Gregor2010-09-161-2/+56
| | | | | | | | | | | | | | | | sends. These are far trickier than instance messages, because we typically have something like NSArray alloc] where it appears to be a declaration of a variable named "alloc" up until we see the ']' (or a ':'), and at that point we can't backtrace. So, we use a combination of syntactic and semantic disambiguation to treat this as a message send only when the type is an Objective-C type and it has the syntax of a class message send (which would otherwise be ill-formed). llvm-svn: 114057
* Handle bracket insertion for Objective-C class messages in a veryDouglas Gregor2010-09-151-37/+49
| | | | | | | | | | | narrow, almost useless case where we're inside a parenthesized expression, e.g., (NSArray alloc]) The solution to the general case still eludes me. llvm-svn: 114039
* Improve code completion for Objective-C message sends when the openingDouglas Gregor2010-09-151-4/+15
| | | | | | | | | | | | | | | | | | | | | | | '[' is missing. Prior commits improving recovery also improved code completion beyond the first selector, e.g., at or after the "to" in calculator add:x to:y but not after "calculator". We now provide the same completions for calculator <CC> that we would for [calculator <CC> if "calculator" is an expression whose type is something that can receive Objective-C messages. This code completion works for instance and super message sends, but not class message sends. llvm-svn: 113976
* Extend bracket insertion to message sends to "super", e.g.,Douglas Gregor2010-09-151-0/+12
| | | | | | | | super method:arg] will now recover nicely and insert the '[' before 'super'. llvm-svn: 113971
* Extend bracket insertion to handle nullary selectors, e.g.Douglas Gregor2010-09-151-1/+1
| | | | | | a getFoo] llvm-svn: 113969
* Implement bracket insertion for Objective-C instance message sends asDouglas Gregor2010-09-151-4/+29
| | | | | | | | | | | | | | | | | | | | | | | part of parser recovery. For example, given: a method1:arg]; we detect after parsing the expression "a" that we have the start of a message send expression. We pretend we've seen a '[' prior to the a, then parse the remainder as a message send. We'll then give a diagnostic+fix-it such as: fixit-objc-message.m:17:3: error: missing '[' at start of message send expression a method1:arg]; ^ [ The algorithm here is very simple, and always assumes that the open bracket goes at the beginning of the message send. It also only works for non-super instance message sends at this time. llvm-svn: 113968
* Introduce a new code-completion context for a parenthesizedDouglas Gregor2010-09-141-0/+8
| | | | | | | | expression, e.g., after the '(' that could also be a type cast. Here, we provide types as code-completion results in C/Objective-C (C++ already had them), although we wouldn't in a normal expression context. llvm-svn: 113904
* Eli helped me understand how evaluation contexts work.Sebastian Redl2010-09-101-0/+4
| | | | llvm-svn: 113642
* Parse the noexcept operator and stub out sema.Sebastian Redl2010-09-101-3/+17
| | | | llvm-svn: 113622
* Eliminate the comma locations from all of the Sema routines that dealDouglas Gregor2010-09-091-2/+1
| | | | | | | | with comma-separated lists. We never actually used the comma locations, nor did we store them in the AST, but we did manage to waste time during template instantiation to produce fake locations. llvm-svn: 113495
* Microsoft's __uuidof operator implementation part 1.Francois Pichet2010-09-081-0/+3
| | | | llvm-svn: 113356
* Implement __has_virtual_destructor. Patch by Steven Watanabe.Sebastian Redl2010-09-021-1/+2
| | | | llvm-svn: 112905
* Implement the __has_nothrow trait family, by Steven Watanabe.Sebastian Redl2010-08-311-3/+6
| | | | llvm-svn: 112577
* Revert my user-defined literal commits - r1124{58,60,67} pendingAlexis Hunt2010-08-301-2/+1
| | | | | | some issues being sorted out. llvm-svn: 112493
* Implement C++0x user-defined string literals.Alexis Hunt2010-08-291-1/+2
| | | | | | | | | | The extra data stored on user-defined literal Tokens is stored in extra allocated memory, which is managed by the PreprocessorLexer because there isn't a better place to put it that makes sure it gets deallocated, but only after it's used up. My testing has shown no significant slowdown as a result, but independent testing would be appreciated. llvm-svn: 112458
* Propagate whether an id-expression is the immediate argument ofJohn McCall2010-08-271-1/+5
| | | | | | | | | | | | | | | | | | | an '&' expression from the second caller of ActOnIdExpression. Teach template argument deduction that an overloaded id-expression doesn't give a valid type for deduction purposes to a non-static member function unless the expression has the correct syntactic form. Teach ActOnIdExpression that it shouldn't try to create implicit member expressions for '&function', because this isn't a permitted form of use for member functions. Teach CheckAddressOfOperand to diagnose these more carefully. Some of these cases aren't reachable right now because earlier diagnostics interrupt them. llvm-svn: 112258
* One who seeks knowledge learns something new every day.John McCall2010-08-261-11/+11
| | | | | | | | | One who seeks the Tao unlearns something new every day. Less and less remains until you arrive at non-action. When you arrive at non-action, nothing will be left undone. llvm-svn: 112244
* Preserve invalidity of typeof operands in C++.John McCall2010-08-241-1/+2
| | | | llvm-svn: 111999
* OwningExprResult -> ExprResult. This patch brought to you byJohn McCall2010-08-241-44/+44
| | | | | | | M-x query-replace-regexp \(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result llvm-svn: 111903
* Abstract out passing around types and kill off ActionBase.John McCall2010-08-241-15/+15
| | | | llvm-svn: 111901
* Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).John McCall2010-08-231-68/+59
| | | | llvm-svn: 111863
* Sundry incremental steps towards killing off Action.John McCall2010-08-231-13/+14
| | | | llvm-svn: 111795
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-3/+3
| | | | | | | | | - move DeclSpec &c into the Sema library - move ParseAST into the Parse library Reflect this change in a thousand different includes. Reflect this change in the link orders. llvm-svn: 111667
* Once code completion has completed, pass a "completion context" on toDouglas Gregor2010-08-111-2/+2
| | | | | | | the code-completion consumer. The consumer can use this information to augument, filter, or display the code-completion results. llvm-svn: 110858
* The pre-increment/pre-decrement grammar in C++ differs from that in C,Douglas Gregor2010-08-061-4/+8
| | | | | | | but we were parsing the C grammar. Handle the C++ grammar appropriately. Fixes PR7794. llvm-svn: 110445
* The grammar for GNU typeof in C requires an expression to beDouglas Gregor2010-07-281-4/+7
| | | | | | | | | | | | | parenthesized, unlike in C++, e.g., C has: typeof ( expression) C++ has: typeof unary-expression So, once we've parsed a parenthesized expression after typeof, we should only go on to parse the postfix expression suffix if we're in C++. Fixes <rdar://problem/8237491>. llvm-svn: 109606
* tidy up comment.Chris Lattner2010-07-191-2/+1
| | | | llvm-svn: 108676
OpenPOWER on IntegriCloud