summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
...
* When we encounter a '==' in a context expecting a '=', assume the user made ↵Argyrios Kyrtzidis2010-10-083-3/+19
| | | | | | | | | | | | | a typo: t.c:1:7: error: invalid '==' at end of declaration; did you mean '='? int x == 0; ^~ = Implements rdar://8488464. llvm-svn: 116035
* Use ParseObjCSelectorPiece for parsing getter and setter names in @property ↵Anders Carlsson2010-10-021-10/+17
| | | | | | declarations. Fixes PR8169. llvm-svn: 115411
* Implement the C++0x "trailing return type" feature, e.g.,Douglas Gregor2010-10-012-5/+41
| | | | | | | | | | auto f(int) -> int from Daniel Wallin! (With a few minor bug fixes from me). llvm-svn: 115322
* enhance tentative parsing to handle ms extensions, patch by Martin Vejnar!Chris Lattner2010-09-281-1/+6
| | | | llvm-svn: 115004
* vla expressions used in __typeof__ must be evaluated.Fariborz Jahanian2010-09-283-15/+25
| | | | | | Fixes rdar://8476159. llvm-svn: 114982
* 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
* Don't warn for an unused label if it has 'unused' attribute. Fixes ↵Argyrios Kyrtzidis2010-09-281-2/+1
| | | | | | rdar://8483139. llvm-svn: 114954
* Allow the use of C++0x deleted functions as an extension in C++98.Anders Carlsson2010-09-242-2/+8
| | | | llvm-svn: 114762
* Refactor code completion for expressions that occur as arguments inDouglas Gregor2010-09-201-6/+36
| | | | | | | | Objective-C message sends. There is no functionality change here; this is prep work for using the parameter types to help guide the expression results when code-completing the argument. llvm-svn: 114375
* 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 code completion for Objective-C class message sends that areDouglas Gregor2010-09-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | missing the opening bracket '[', e.g., NSArray <CC> at function scope. Previously, we would only give trivial completions (const, volatile, etc.), because we're in a "declaration name" scope. Now, we also provide completions for class methods of NSArray, e.g., alloc Note that we already had support for this after the first argument, e.g., NSArray method:x <CC> would get code completion for class methods of NSArray whose selector starts with "method:". This was already present because we recover as if NSArray method:x were a class message send missing the opening bracket (which was committed in r114057). llvm-svn: 114078
* Implement automatic bracket insertion for Objective-C class messageDouglas Gregor2010-09-164-3/+102
| | | | | | | | | | | | | | | | 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
* Initialize TypeOrExpr to NULL to silence a false-positive uninitialized warningNick Lewycky2010-09-151-1/+1
| | | | | | from certain GCC's. Patch by Neil Vachharajani! llvm-svn: 113995
* 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-156-8/+63
| | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "CMake: Update to use standard CMake dependency tracking facilities ↵Michael J. Spencer2010-09-131-14/+3
| | | | | | | | | | | | | instead" This reverts commit r113631 Conflicts: CMakeLists.txt lib/CodeGen/CMakeLists.txt llvm-svn: 113817
* When parsing default function arguments, do not mark any declarationsDouglas Gregor2010-09-112-0/+10
| | | | | | | | | | | | | | | | | | | | | | used in the default function argument as "used". Instead, when we actually use the default argument, make another pass over the expression to mark any used declarations as "used" at that point. This addresses two kinds of related problems: 1) We were marking some declarations "used" that shouldn't be, because we were marking them too eagerly. 2) We were failing to mark some declarations as "used" when we should, if the first time it was instantiated happened to be an unevaluated context, we wouldn't mark them again at a later point. I've also added a potentially-handy visitor class template EvaluatedExprVisitor, which only visits the potentially-evaluated subexpressions of an expression. I bet this would have been useful for noexcept... Fixes PR5810 and PR8127. llvm-svn: 113700
* Eli helped me understand how evaluation contexts work.Sebastian Redl2010-09-101-0/+4
| | | | llvm-svn: 113642
* CMake: Update to use standard CMake dependency tracking facilities insteadMichael J. Spencer2010-09-101-3/+14
| | | | | | of whatever we were using before... llvm-svn: 113631
* Parse the noexcept operator and stub out sema.Sebastian Redl2010-09-101-3/+17
| | | | llvm-svn: 113622
* When we parse a pragma, keep track of how that pragma was originallyDouglas Gregor2010-09-092-12/+30
| | | | | | | | spelled (#pragma, _Pragma, __pragma). In -E mode, use that information to add appropriate newlines when translating _Pragma and __pragma into #pragma, like GCC does. Fixes <rdar://problem/8412013>. llvm-svn: 113553
* Eliminate the comma locations from all of the Sema routines that dealDouglas Gregor2010-09-094-6/+4
| | | | | | | | 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
* Add proper type-source information to UnaryTypeTraitExpr, includingDouglas Gregor2010-09-091-1/+1
| | | | | | libclang visitation. llvm-svn: 113492
* Fix a few minor issues with parsing and semantic analysis of C++Douglas Gregor2010-09-081-4/+6
| | | | | | | | typeid expressions: - make sure we have a proper source location for the closing ')' - cache the declaration of std::type_info once we've found it llvm-svn: 113441
* Clean up some of the CMake dependenciesDouglas Gregor2010-09-081-0/+2
| | | | llvm-svn: 113416
* Microsoft's __uuidof operator implementation part 1.Francois Pichet2010-09-082-0/+51
| | | | llvm-svn: 113356
* Provide proper type-source location information forDouglas Gregor2010-09-081-2/+1
| | | | | | | | CXXTemporaryObjectExpr, CXXScalarValueInitExpr, and CXXUnresolvedConstructExpr, getting rid of a bunch of FIXMEs in the process. llvm-svn: 113319
* Improve error recovery when we see ':' and expect a ';'.John McCall2010-09-071-0/+20
| | | | | | I, at least, make this typo all the time. llvm-svn: 113243
* Improve recovery when there is a stray ']' or ')' before the ';' atDouglas Gregor2010-09-074-6/+26
| | | | | | the end of a statement. Fixes <rdar://problem/6896493>. llvm-svn: 113202
* Improve recovery when a comma is missing between enumerators in anDouglas Gregor2010-09-072-5/+13
| | | | | | enumeration definition. Fixes <rdar://problem/7159693>. llvm-svn: 113201
* Improve diagnostic and recovery when missing a comma between base orDouglas Gregor2010-09-071-0/+6
| | | | | | member initializers in a C++ constructor. Fixes <rdar://problem/7796492>. llvm-svn: 113199
* Use std::string instead of llvm::StringRef to avoid dangling ref.Fariborz Jahanian2010-09-031-1/+1
| | | | | | Per Chris's comment. llvm-svn: 112979
* Use getSpelling to get original text of theFariborz Jahanian2010-09-031-55/+21
| | | | | | c++ operator token. (radar 8328250). llvm-svn: 112977
* Add symantic support for the Pascal calling convention viaDawn Perchik2010-09-032-10/+51
| | | | | | | "__attribute((pascal))" or "__pascal" (and "_pascal" under -fborland-extensions). Support still needs to be added to llvm. llvm-svn: 112939
* Patch to allow alternative representation of c++Fariborz Jahanian2010-09-031-1/+56
| | | | | | | operators (and, or, etc.) to be used as selectors to match g++'s behavior. llvm-svn: 112935
* Implement __has_virtual_destructor. Patch by Steven Watanabe.Sebastian Redl2010-09-021-1/+2
| | | | llvm-svn: 112905
* when emitting an error about a missing } in a compound statement, emitChris Lattner2010-09-011-0/+1
| | | | | | a "to match this {" note, pointing out the opener. llvm-svn: 112709
* Implement the __has_nothrow trait family, by Steven Watanabe.Sebastian Redl2010-08-311-3/+6
| | | | llvm-svn: 112577
* Enable inline namespaces in C++03 as an extension.Sebastian Redl2010-08-313-4/+8
| | | | llvm-svn: 112566
* Revert my user-defined literal commits - r1124{58,60,67} pendingAlexis Hunt2010-08-302-4/+2
| | | | | | some issues being sorted out. llvm-svn: 112493
* Implement C++0x user-defined string literals.Alexis Hunt2010-08-292-2/+4
| | | | | | | | | | 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
* ObjClang++: Allow declaration of block variable in a collectionFariborz Jahanian2010-08-291-1/+7
| | | | | | statement header (fixes radar 8295106). llvm-svn: 112443
* Basic code completion support for the base and member initializers inDouglas Gregor2010-08-281-6/+13
| | | | | | a constructor. llvm-svn: 112330
OpenPOWER on IntegriCloud