summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/Parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Parse: add support for parsing CUDA kernel callsPeter Collingbourne2011-02-091-0/+2
| | | | llvm-svn: 125219
* Support for objextive-c++ use of property-dot syntax as receiverFariborz Jahanian2011-02-081-1/+2
| | | | | | | in liu of a class method getter. // rdar://8962253 llvm-svn: 125094
* Fix a crash-on-invalid where we were trying to parse C++ constructs inDouglas Gregor2011-02-041-2/+3
| | | | | | | C, then hitting an assertion because C code shouldn't try to parse optional nested-name-specifiers. Fixes PR9137. llvm-svn: 124860
* Lazily initialize the 'final' and 'override' contextual keywords as ↵Anders Carlsson2011-01-201-5/+2
| | | | | | suggested by Doug. llvm-svn: 123876
* Convert "#pragma unused(...)" into tokens for the parser.Argyrios Kyrtzidis2011-01-171-0/+4
| | | | | | | This allows us to cache a "#pragma unused" that occurs inside an inline C++ member function. Fixes rdar://8829590&8770988. llvm-svn: 123666
* Begin work on supporting "N3206: Override control: Eliminating Attributes", fromAnders Carlsson2011-01-161-0/+6
| | | | | | | | | http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm This lands support for parsing virt-specifier-seq after member functions, including the contextual keywords 'final', and 'override'. The keywords are not yet used for anything. llvm-svn: 123606
* Speed up code-completion by skipping function bodies.Argyrios Kyrtzidis2011-01-031-5/+7
| | | | | | | | | | | | | | When we are in code-completion mode, skip parsing of all function bodies except the one where the code-completion point resides. For big .cpp files like 'SemaExpr.cpp' the improvement makes a huge difference, in some cases cutting down code-completion time -62% ! We don't get diagnostics for the bodies though, so modify the code-completion tests that check for errors. See rdar://8814203. llvm-svn: 122765
* Refactor how we collect attributes during parsing, and add slots for attributesJohn McCall2010-12-241-32/+24
| | | | | | | 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
* Added ParenType type node.Abramo Bagnara2010-12-101-9/+5
| | | | llvm-svn: 121488
* Not content to implement just "extern" explicit templateDouglas Gregor2010-12-011-4/+30
| | | | | | | | | instantiations, GCC also supports "inline" and "static" explicit template instantiations. Parse and warn about such constructs, but don't implement the semantics of either "inline" or "static". They don't seem to be widely used. llvm-svn: 120599
* Refactoring.Argyrios Kyrtzidis2010-11-191-2/+1
| | | | | | Move ErrorTrap from clang/Sema to clang/Basic as DiagnosticErrorTrap and use it in Scope. llvm-svn: 119763
* Refactoring of Diagnostic class.Argyrios Kyrtzidis2010-11-181-1/+1
| | | | | | | | | | | -Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. llvm-svn: 119730
* Add parsing support for Microsoft attributes. MS attributes will just be ↵Francois Pichet2010-10-111-0/+3
| | | | | | skipped and not inserted into the AST for now. llvm-svn: 116203
* When we encounter a '==' in a context expecting a '=', assume the user made ↵Argyrios Kyrtzidis2010-10-081-0/+14
| | | | | | | | | | | | | a typo: t.c:1:7: error: invalid '==' at end of declaration; did you mean '='? int x == 0; ^~ = Implements rdar://8488464. llvm-svn: 116035
* vla expressions used in __typeof__ must be evaluated.Fariborz Jahanian2010-09-281-2/+4
| | | | | | Fixes rdar://8476159. llvm-svn: 114982
* Implement bracket insertion for Objective-C instance message sends asDouglas Gregor2010-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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
* 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-071-0/+19
| | | | | | the end of a statement. Fixes <rdar://problem/6896493>. llvm-svn: 113202
* Enable inline namespaces in C++03 as an extension.Sebastian Redl2010-08-311-2/+2
| | | | llvm-svn: 112566
* Parser support for inline namespacesSebastian Redl2010-08-271-3/+11
| | | | llvm-svn: 112320
* One who seeks knowledge learns something new every day.John McCall2010-08-261-7/+7
| | | | | | | | | 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
* Initialize the translation-unit scope before lexing the firstDouglas Gregor2010-08-251-4/+4
| | | | | | | token. The first token might be something that ends up triggering code completion, which in turn requires a valid Scope. Test case forthcoming. llvm-svn: 112066
* Introduce a preprocessor code-completion hook for contexts where weDouglas Gregor2010-08-251-0/+4
| | | | | | | expect "natural" language and should not provide any completions, e.g., comments, string literals, #error. llvm-svn: 112054
* Implement code completion for preprocessor expressions and in macroDouglas Gregor2010-08-241-2/+13
| | | | | | arguments. llvm-svn: 111976
* Implement preprocessor code completion where a macro name is expected,Douglas Gregor2010-08-241-0/+4
| | | | | | | e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname> expression in a preprocessor conditional. llvm-svn: 111954
* Introduce basic code-completion support for preprocessor directives,Douglas Gregor2010-08-241-0/+13
| | | | | | e.g., after a "#" we'll suggest #if, #ifdef, etc. llvm-svn: 111943
* Parse all kinds of declarations as part of a linkage-specification,Douglas Gregor2010-08-241-2/+6
| | | | | | from Francois Pichet! Fixes PR7754. llvm-svn: 111912
* OwningExprResult -> ExprResult. This patch brought to you byJohn McCall2010-08-241-5/+5
| | | | | | | 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-9/+11
| | | | llvm-svn: 111901
* Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).John McCall2010-08-231-2/+2
| | | | llvm-svn: 111863
* DeclPtrTy -> Decl *John McCall2010-08-211-9/+9
| | | | llvm-svn: 111733
* 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-5/+5
| | | | | | | the code-completion consumer. The consumer can use this information to augument, filter, or display the code-completion results. llvm-svn: 110858
* Template keyword should not be ignored building a QualifiedTemplateName.Abramo Bagnara2010-08-061-3/+4
| | | | llvm-svn: 110441
* Implement #pragma GCC visibility.Eli Friedman2010-08-051-0/+5
| | | | llvm-svn: 110315
* Parser: Add support for #pragma align, which is just another spelling of #pragmaDaniel Dunbar2010-07-311-0/+5
| | | | | | options align. llvm-svn: 109952
* Modify the pragma handlers to accept and use StringRefs instead of ↵Argyrios Kyrtzidis2010-07-131-21/+15
| | | | | | | | | | | IdentifierInfos. When loading the PCH, IdentifierInfos that are associated with pragmas cause declarations that use these identifiers to be deserialized (e.g. the "clang" pragma causes the "clang" namespace to be loaded). We can avoid this if we just use StringRefs for the pragmas. As a bonus, since we don't have to create and pass IdentifierInfos, the pragma interfaces get a bit more simplified. llvm-svn: 108237
* revert a hunk of code that Argiris added in r106213, which is theChris Lattner2010-07-121-10/+1
| | | | | | | root cause of PR7481 and probably more, and has no apparent testcases. I don't understand the logic here so I can't repair it. llvm-svn: 108119
* Fix PR7617 by not entering ParseFunctionDefinition whenChris Lattner2010-07-111-4/+9
| | | | | | | | | | | | | | | | | | | | | a function prototype is followed by a declarator if we aren't parsing a K&R style identifier list. Also, avoid skipping randomly after a declaration if a semicolon is missing. Before we'd get: t.c:3:1: error: expected function body after function declarator void bar(); ^ Now we get: t.c:1:11: error: invalid token after top level declarator void foo() ^ ; llvm-svn: 108105
* add a const qualifier, refactor some code.Chris Lattner2010-07-111-1/+1
| | | | llvm-svn: 108104
* Move the "current scope" state from the Parser into Action. ThisDouglas Gregor2010-07-021-29/+30
| | | | | | | | | | | | | | 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-1/+12
| | | | | | | | | | | 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
* Fix the recently-added warning about 'typename' and 'template'Douglas Gregor2010-06-161-2/+4
| | | | | | | | | disambiguation keywords outside of templates in C++98/03. Previously, the warning would fire when the associated nested-name-specifier was not dependent, but that was a misreading of the C++98/03 standard: now, we complain only when we're outside of any template. llvm-svn: 106161
* Parse: Add support for '#pragma options align'.Daniel Dunbar2010-05-261-0/+7
| | | | | | Also, fix a source location bug with the rparen in #pragma pack. llvm-svn: 104784
* Improve code completion in failure cases in two ways:Douglas Gregor2010-05-251-3/+23
| | | | | | | | | | | 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 we encounter a dependent template nameDouglas Gregor2010-05-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that is missing the 'template' keyword, e.g., t->getAs<T>() where getAs is a member of an unknown specialization. C++ requires that we treat "getAs" as a value, but that would fail to parse since T is the name of a type. We would then fail at the '>', since a type cannot be followed by a '>'. This is a very common error for C++ programmers to make, especially since GCC occasionally allows it when it shouldn't (as does Visual C++). So, when we are in this case, we use tentative parsing to see if the tokens starting at "<" can only be parsed as a template argument list. If so, we produce a diagnostic with a fix-it that states that the 'template' keyword is needed: test/SemaTemplate/dependent-template-recover.cpp:5:8: error: 'template' keyword is required to treat 'getAs' as a dependent template name t->getAs<T>(); ^ template This is just a start of this patch; I'd like to apply the same approach to everywhere that a template-id with dependent template name can be parsed. llvm-svn: 104406
* Propagate access specifiers to anonymous union members nested within classes.John McCall2010-05-211-1/+1
| | | | | | Fixes <rdar://problem/7987650>. llvm-svn: 104376
* Diagnose misordered initializers in constructor templates immediately instead ofJohn McCall2010-04-101-2/+8
| | | | | | | | | | when they're instantiated. Merge the note into the -Wreorder warning; it doesn't really contribute much, and it was splitting a thought across diagnostics anyway. Don't crash in the parser when a constructor's initializers end in a comma and there's no body; the recovery here is still terrible, but anything's better than a crash. llvm-svn: 100922
* Fix some redundant errors by changing CXXScopeSpec::isSet calls intoJeffrey Yasskin2010-04-071-1/+1
| | | | | | isNotEmpty calls. llvm-svn: 100722
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-311-5/+5
| | | | | | the C-only "optimization". llvm-svn: 100022
OpenPOWER on IntegriCloud