summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* One who seeks knowledge learns something new every day.John McCall2010-08-261-9/+8
| | | | | | | | | 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
* OwningExprResult -> ExprResult. This patch brought to you byJohn McCall2010-08-241-61/+61
| | | | | | | M-x query-replace-regexp \(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result llvm-svn: 111903
* Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).John McCall2010-08-231-37/+37
| | | | llvm-svn: 111863
* Introduce a code-completion hook for the Objective-C collectionDouglas Gregor2010-08-231-0/+10
| | | | | | | | argument in a for-each statement (e.g., "for (id x in <blah>)"), which restricts the expression completions provided to Objective-C types (or class types in C++). llvm-svn: 111843
* Sundry incremental steps towards killing off Action.John McCall2010-08-231-16/+16
| | | | llvm-svn: 111795
* DeclPtrTy -> Decl *John McCall2010-08-211-13/+13
| | | | llvm-svn: 111733
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-2/+2
| | | | | | | | | - 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
* Add a slightly better hack for microsoft style inline asm, Chris Lattner2010-08-171-2/+2
| | | | | | patch by Per Linden! llvm-svn: 111235
* Once code completion has completed, pass a "completion context" on toDouglas Gregor2010-08-111-3/+3
| | | | | | | the code-completion consumer. The consumer can use this information to augument, filter, or display the code-completion results. llvm-svn: 110858
* Remove ElseScope which is also dead code now.Nick Lewycky2010-08-061-6/+0
| | | | llvm-svn: 110433
* Fix PR7673 by allowing an empty clobbers section in an ASM statement.Chandler Carruth2010-07-221-8/+10
| | | | llvm-svn: 109087
* Move the "current scope" state from the Parser into Action. ThisDouglas Gregor2010-07-021-13/+13
| | | | | | | | | | | | | | allows Sema some limited access to the current scope, which we only use in one way: when Sema is performing some kind of declaration that is not directly driven by the parser (e.g., due to template instantiatio or lazy declaration of a member), we can find the Scope associated with a DeclContext, if that DeclContext is still in the process of being parsed. Use this to make the implicit declaration of special member functions in a C++ class more "scope-less", rather than using the NULL Scope hack. llvm-svn: 107491
* Make sure parens/braces/brackets are correctly balanced.Argyrios Kyrtzidis2010-06-171-0/+2
| | | | | | | | | | | In a line like: (; the semicolon leaves Parser:ParenCount unbalanced (it's 1 even though we stopped looking for a right paren). This may affect later parsing and result in bad recovery for parsing errors. llvm-svn: 106213
* Teach code completion to adjust its completion priorities based on theDouglas Gregor2010-05-301-0/+7
| | | | | | | | | type that we expect to see at a given point in the grammar, e.g., when initializing a variable, returning a result, or calling a function. We don't prune the candidate set at all, just adjust priorities to favor things that should type-check, using an ultra-simplified type system. llvm-svn: 105128
* Make -code-completion-patterns only cover multi-line codeDouglas Gregor2010-05-281-1/+1
| | | | | | | completions. Plus, tweak a few completion patterns to better reflect the language grammar. llvm-svn: 104905
* Improve code completion in failure cases in two ways:Douglas Gregor2010-05-251-2/+2
| | | | | | | | | | | 1) Suppress diagnostics as soon as we form the code-completion token, so we don't get any error/warning spew from the early end-of-file. 2) If we consume a code-completion token when we weren't expecting one, go into a code-completion recovery path that produces the best results it can based on the context that the parser is in. llvm-svn: 104585
* Improve parser recovery when a switch condition is invalid; fixesDouglas Gregor2010-05-201-3/+4
| | | | | | <rdar://problem/7971948>. llvm-svn: 104291
* Fixed DISABLE_SMART_POINTERS breakageDouglas Gregor2010-05-061-1/+3
| | | | llvm-svn: 103198
* Rework our handling of temporary objects within the conditions ofDouglas Gregor2010-05-061-32/+55
| | | | | | | | | | | | | | | | | | | if/switch/while/do/for statements. Previously, we would end up either: (1) Forgetting to destroy temporaries created in the condition (!), (2) Destroying the temporaries created in the condition *before* converting the condition to a boolean value (or, in the case of a switch statement, to an integral or enumeral value), or (3) In a for statement, destroying the condition's temporaries at the end of the increment expression (!). We now destroy temporaries in conditions at the right times. This required some tweaking of the Parse/Sema interaction, since the parser was building full expressions too early in many places. Fixes PR7067. llvm-svn: 103187
* change Scope::WithinElse to be a normal scope flag, widen theChris Lattner2010-04-121-5/+8
| | | | | | fields to two 16-bit values instead of using bitfields. llvm-svn: 101020
* fix PR6782, an accept invalid. We weren't emitting the diagnostic Chris Lattner2010-04-051-1/+1
| | | | | | returned by SetTypeSpecType. llvm-svn: 100443
* Don't skip past the '}' if an expression has error and is not followed by ';'.Argyrios Kyrtzidis2010-03-311-3/+5
| | | | llvm-svn: 99972
* Clean up ownership of 'AttributeList' objects in Parser. ApparentlyTed Kremenek2010-02-111-15/+44
| | | | | | | | | | | | | | | | | | | | | we would just leak them all over the place, with no clear ownership of these objects at all. AttributeList objects would get leaked on both error and non-error paths. Note: I introduced the usage of llvm::OwningPtr<AttributeList> to manage these objects, which is particularly useful for methods with multiple return sites. In at least one method I used them even when they weren't strictly necessary because it clarified the ownership semantics and made the code easier to read. Should the excessive 'take()' and 'reset()' calls become a performance issue we can always re-evaluate. Note+1: I believe I have not introduced any double-frees, but it would be nice for someone to review this. This fixes <rdar://problem/7635046>. llvm-svn: 95847
* Use IdentifierInfo * instead of std::string for the AsmStmt names.Anders Carlsson2010-01-301-8/+7
| | | | llvm-svn: 94925
* fix PR6034, a crash on invalid where the switch stack would get Chris Lattner2010-01-241-8/+8
| | | | | | unbalanced. llvm-svn: 94347
* Improve code completion by introducing patterns for the various C andDouglas Gregor2010-01-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | C++ grammatical constructs that show up in top-level (namespace-level) declarations, member declarations, template declarations, statements, expressions, conditions, etc. For example, we now provide a pattern for static_cast<type>(expr) when we can have an expression, or using namespace identifier; when we can have a using directive. Also, improves the results of code completion at the beginning of a top-level declaration. Previously, we would see value names (function names, global variables, etc.); now we see types, namespace names, etc., but no values. llvm-svn: 93134
* Remember if the AsmStmt came from Microsoft-style inline assembly code.Mike Stump2010-01-041-1/+1
| | | | llvm-svn: 92526
* fix PR5500: clang fails to parse inline asm with :: in C++ mode Chris Lattner2009-12-201-7/+22
| | | | llvm-svn: 91802
* refactor asm stmt parsing to avoid nesting as much, andChris Lattner2009-12-201-39/+38
| | | | | | pull ':' eating out of ParseAsmOperandsOpt. llvm-svn: 91801
* Check in a rudimentary FullExpr class that isn't used anywhere yet. Rename ↵Anders Carlsson2009-12-161-8/+8
| | | | | | Action::FullExpr to Action::MakeFullExpr to avoid name clashes. llvm-svn: 91494
* Implement just a bit more of inline assembly.Mike Stump2009-12-111-1/+14
| | | | llvm-svn: 91079
* fix PR5740: a colon is sacred when parsing case statement expressions!Chris Lattner2009-12-101-0/+7
| | | | llvm-svn: 91016
* rename ExtensionRAIIObject.h -> RAIIObjectsForParser.hChris Lattner2009-12-101-1/+1
| | | | llvm-svn: 91008
* When the condition of a switch() statement is semantically invalid,Douglas Gregor2009-11-251-3/+1
| | | | | | | still parse the body of the switch to try to avoid spurious diagnostics. Fixes PR5606. llvm-svn: 89847
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-251-28/+38
| | | | | | | | | | | | | | | | | All statements that involve conditions can now hold on to a separate condition declaration (a VarDecl), and will use a DeclRefExpr referring to that VarDecl for the condition expression. ForStmts now have such a VarDecl (I'd missed those in previous commits). Also, since this change reworks the Action interface for if/while/switch/for, use FullExprArg for the full expressions in those expressions, to ensure that we're emitting Note that we are (still) not generating the right cleanups for condition variables in for statements. That will be a follow-on commit. llvm-svn: 89817
* "Do" loops cannot have condition variables, so don't parse them.Douglas Gregor2009-11-241-4/+3
| | | | llvm-svn: 89801
* Added rudimentary C++0x attribute support.Alexis Hunt2009-11-211-37/+76
| | | | | | | | | | | | | | The following attributes are currently supported in C++0x attribute lists (and in GNU ones as well): - align() - semantics believed to be conformant to n3000, except for redeclarations and what entities it may apply to - final - semantics believed to be conformant to CWG issue 817's proposed wording, except for redeclarations - noreturn - semantics believed to be conformant to n3000, except for redeclarations - carries_dependency - currently ignored (this is an optimization hint) llvm-svn: 89543
* Don't issue spurious diagnostic with Obj-C fast enumeration.Fariborz Jahanian2009-11-191-0/+1
| | | | | | (radar 7409165). llvm-svn: 89400
* Reorganize the parsing of decl groups / function definitions so thatJohn McCall2009-11-031-2/+1
| | | | | | | declarators are parsed primarily within a single function (at least for these cases). Remove some excess diagnostics arising during parse failures. llvm-svn: 85924
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-1/+1
| | | | | | are updated. llvm-svn: 84447
* Move misc clients to IdentifierInfo StringRef API.Daniel Dunbar2009-10-181-1/+3
| | | | | | | | | - strcmp -> == - OS.write(II->getName() ...) -> OS << II->getNameStr() - Avoid std::string concatenation - Use getNameStr().str() when an std::string is really needed. llvm-svn: 84437
* Code completion for ordinary names when we're starting a declaration, ↵Douglas Gregor2009-09-211-0/+10
| | | | | | expression, or statement llvm-svn: 82481
* Code completion for "case" statements within a switch on an expressionDouglas Gregor2009-09-211-0/+5
| | | | | | of enumeration type, providing the various unused enumerators as options. llvm-svn: 82467
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-47/+47
| | | | llvm-svn: 81346
* Change ActOnReturnStmt to not take a FullExprArg. Instead, Sema will wrap ↵Anders Carlsson2009-08-181-1/+1
| | | | | | the return expr inside a CXXExprWithTemporaries if needed. llvm-svn: 79342
* change ParseStatementOrDeclaration to emit the 'missing ;' withChris Lattner2009-06-141-1/+5
| | | | | | | | | | | | | | | | | | | ExpectAndConsume instead of custom diag logic. This gets us an insertion hint and positions the ; at the end of the line instead of on the next token. Before: t.c:5:1: error: expected ';' after return statement } ^ after: t.c:4:11: error: expected ';' after return statement return 4 ^ ; llvm-svn: 73315
* improve localizability by not passing english phrases into Chris Lattner2009-06-141-7/+7
| | | | | | diagnostics in some cases. llvm-svn: 73314
* add the location of the ')' in a do/while statement to DoStmt.Chris Lattner2009-06-121-4/+10
| | | | | | This fixes a source range problem reported by Olaf Krzikalla. llvm-svn: 73266
* Make sure to call FullExpr before parsing anything else.Anders Carlsson2009-06-041-2/+6
| | | | llvm-svn: 72834
OpenPOWER on IntegriCloud