summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
...
* Reapplying the changes from r158717 as they were rolled back to avoid merge ↵Aaron Ballman2012-06-191-37/+143
| | | | | | conflicts from a separate problematic patch. llvm-svn: 158750
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-192-151/+42
| | | | | | | | The original r158700 caused crashes in the gcc test suite, g++.abi/vtable3a.C among others. It also caused failures in the libc++ test suite. llvm-svn: 158749
* Documentation cleanup: fixing file headers to use Doxygen \file markup whileJames Dennett2012-06-191-1/+3
| | | | | | also being sufficiently conformant to LLVM's coding standards. llvm-svn: 158739
* Revert predefined decl tracking.Meador Inge2012-06-191-33/+11
| | | | | | | | | | r158085 added some logic to track predefined declarations. The main reason we had predefined declarations in the input was because the __builtin_va_list declarations were injected into the preprocessor input. As of r158592 we explicitly build the __builtin_va_list declarations. Therefore the predefined decl tracking is no longer needed. llvm-svn: 158732
* Improves parsing and semantic analysis for MS __declspec attributes. This ↵Aaron Ballman2012-06-191-37/+143
| | | | | | includes support for the align (which fixes PR12631). llvm-svn: 158717
* Improve the specification of spellings in Attr.td.Alexis Hunt2012-06-192-5/+8
| | | | | | | | | | | | | | | | | Note that this is mostly a structural patch that handles the change from the old spelling style to the new one. One consequence of this is that all AT_foo_bar enum values have changed to not be based off of the first spelling, but rather off of the class name, so they are now AT_FooBar and the like (a straw poll on IRC showed support for this). Apologies for code churn. Most attributes have GNU spellings as a temporary solution until everything else is sorted out (such as a Keyword spelling, which I intend to add if someone else doesn't beat me to it). This is definitely a WIP. I've also killed BaseCheckAttr since it was unused, and I had to go through every attribute anyway. llvm-svn: 158700
* Handle C++11 attribute namespaces automatically.Alexis Hunt2012-06-182-15/+21
| | | | | | | | Now, as long as the 'Namespaces' variable is correct inside Attr.td, the generated code will correctly admit a C++11 attribute only when it has the appropriate namespace(s). llvm-svn: 158661
* [MSExtensions] Add support for __forceinline.Michael J. Spencer2012-06-181-3/+8
| | | | | | __forceinline is a combination of the inline keyword and __attribute__((always_inline)) llvm-svn: 158653
* Extend the error recovery for a template-argument-list terminated by '>>' toRichard Smith2012-06-182-24/+99
| | | | | | | | | also deal with '>>>' (in CUDA), '>=', and '>>='. Fix the FixItHints logic to deal with cases where the token is followed by an adjacent '=', '==', '>=', '>>=', or '>>>' token, where a naive fix-it would result in a differing token stream on a re-lex. llvm-svn: 158652
* Documentation cleanup:James Dennett2012-06-171-43/+65
| | | | | | | * Added \file, \brief and \verbatim...\endverbatim markup, particularly around documentation of subset of the grammars that are being parsed. llvm-svn: 158628
* Recover when correcting an unknown type name to a keyword like "struct".Kaelyn Uhrain2012-06-151-3/+7
| | | | llvm-svn: 158573
* Move isCXXSimpleTypeSpecifier from Parser to Sema and tweak it for wider use.Kaelyn Uhrain2012-06-152-34/+1
| | | | llvm-svn: 158572
* Check the parameter lists and return type of both blocks and lambdasDouglas Gregor2012-06-151-5/+5
| | | | | | | for unexpanded parameter packs. Fixes the crash-on-invalid in PR13117. llvm-svn: 158525
* Documentation cleanup: escape Objective-C @ symbols in Doxygen comments.James Dennett2012-06-151-5/+5
| | | | llvm-svn: 158495
* [ms-inline-asm] The __asm keyword is a statement separator, so multiple asmChad Rosier2012-06-121-0/+5
| | | | | | statements are allowed on the same line. llvm-svn: 158372
* [ms-inline-asm] Cleanup MS style inline assembly parsing.Chad Rosier2012-06-121-9/+46
| | | | | | | | | | Specifically, improve the handling of whitespace, stop saving tokens that are in comments and fix the case where we have a comment followed by a closing brace on the next line. Unfortunately, there's no easy way of testing this code. llvm-svn: 158367
* If parsing a trailing-return-type fails, don't pretend we didn't have one atRichard Smith2012-06-122-6/+6
| | | | | | all. Suppresses follow-on errors mentioned in PR13074. llvm-svn: 158348
* Etch out the code path for MS-style inline assembly.Chad Rosier2012-06-111-33/+52
| | | | llvm-svn: 158325
* Documentation cleanup, fixing Doxygen markup. Mostly this avoids common termsJames Dennett2012-06-111-5/+5
| | | | | | | | | | | | | | such as "protocol" and "expression" being implicitly turned into links to mistakenly-generated Doxygen pages: - Escaping @ symbols when Doxygen would otherwise incorrectly interpret them; - Escaping # symbols when they're not intended as explicit Doxygen link requests, such as when discussing preprocessor directives; - In one odd case, unescaping @ in @__experimental_modules_import, because Doxygen wrote '\@' to the output in that case, causing the example in the description of ImportDecl to be wrong; and - Fixing a typo: @breif -> @brief. llvm-svn: 158299
* PR13064: Store whether an in-class initializer uses direct or copyRichard Smith2012-06-102-12/+13
| | | | | | | initialization, and use that information to produce the right kind of initialization during template instantiation. llvm-svn: 158288
* Whenever we have a BalancedDelimiterTracker, we have a 'nested' scopeDouglas Gregor2012-06-064-7/+79
| | | | | | | where '>' is going to behave as an operator (and not as a '>' closing a template argument list). llvm-svn: 158111
* Remove unused private member variables found by clang's new ↵Benjamin Kramer2012-06-062-17/+11
| | | | | | -Wunused-private-field. llvm-svn: 158086
* Add pedantic warning -Wempty-translation-unit (C11 6.9p1).Jordan Rose2012-06-062-19/+39
| | | | | | | | | | | | | | | | | | | In standard C since C89, a 'translation-unit' is syntactically defined to have at least one "external-declaration", which is either a decl or a function definition. In Clang the latter gives us a declaration as well. The tricky bit about this warning is that our predefines can contain external declarations (__builtin_va_list and the 128-bit integer types). Therefore our AST parser now makes sure we have at least one declaration that doesn't come from the predefines buffer. Also, remove bogus warning about empty source files. This doesn't catch source files that only contain comments, and never fired anyway because of our predefines. PR12665 and <rdar://problem/9165548> llvm-svn: 158085
* objc: position of 'fixit' was off by one.Fariborz Jahanian2012-05-291-1/+1
| | | | | | This patch fixes it. // rdar://11488351 llvm-svn: 157646
* Recognize the MS inheritance attributes and turn them into attributesJohn McCall2012-05-222-4/+17
| | | | | | | | | on the RecordDecl. Persist the MS portability type attributes and ignore them in Sema rather than the parser. Patch by João Matos! llvm-svn: 157288
* objective-c: provide a useful 'fixit' suggestion whenFariborz Jahanian2012-05-211-1/+5
| | | | | | | errornously using commas to separate ObjC message arguments. // rdar://11376372 llvm-svn: 157216
* CXXThisScopeRAII objects aren't free, don't compute one if it's unused.Benjamin Kramer2012-05-172-2/+2
| | | | llvm-svn: 156987
* [libclang/AST] When declaring a local class, don't neglect to set the end ↵Argyrios Kyrtzidis2012-05-161-0/+1
| | | | | | | | | | | location of the DeclStmt node, otherwise libclang will not work for anything inside that class. rdar://10837710 llvm-svn: 156966
* Recover better from a missing 'typename' in a function template definition.Richard Smith2012-05-161-12/+48
| | | | | | | | Disambiguate past such a potential problem, and use the absence of 'typename' to break ties in favor of a parenthesized thingy being an initializer, if nothing else in the declaration disambiguates it as declaring a function. llvm-svn: 156963
* Move the warnings for extra semi-colons under -Wextra-semi. Also, addedRichard Trieu2012-05-164-23/+37
| | | | | | | | a warning for an extra semi-colon after function definitions. Added logic so that a block of semi-colons on a line will only get one warning instead of a warning for each semi-colon. llvm-svn: 156934
* Include the correct conversion context locations for condition expressions.David Blaikie2012-05-161-3/+3
| | | | | | | | | | | | | This improves the conversion diagnostics (by correctly pointing to the loop construct for conversions that may've been caused by the contextual conversion to bool caused by a condition expression) and also causes the NULL conversion warnings to be correctly suppressed when crossing a macro boundary in such a context. (previously, since the conversion context location was incorrect, the suppression could not be performed) Reported by Nico Weber as feedback to r156826. llvm-svn: 156901
* [libclang/AST] Index references of protocols in "@protocol(...)" syntax.Argyrios Kyrtzidis2012-05-161-1/+2
| | | | | | | | | To do that, keep track of the location of the protocol id in the ObjCProtocolExpr AST node. rdar://11190837 llvm-svn: 156890
* Typo.Richard Smith2012-05-151-1/+1
| | | | llvm-svn: 156860
* If we see a declaration which is either missing a type or has a malformed type,Richard Smith2012-05-151-1/+4
| | | | | | | | and the thing we have has a scope specifier, and we're in a context that doesn't allow declaring a qualified name, then the error is a malformed type, not a missing type. llvm-svn: 156856
* Don't use the implicit int rule for error recovery in C++. Instead, try toRichard Smith2012-05-151-5/+54
| | | | | | disambiguate whether the type name was forgotten or mistyped. llvm-svn: 156854
* Recover properly from a redundant 'typename' before a non-nested name. This isRichard Smith2012-05-141-5/+17
| | | | | | | permitted as a Microsoft extension. Patch by William Wilson! (Plus some minor tweaking by me.) llvm-svn: 156786
* Don't crash when using objc boxed expression with parsing error.Argyrios Kyrtzidis2012-05-101-1/+4
| | | | | | rdar://11426994 llvm-svn: 156565
* objective-c. Fixes a 'fixit' where location ofFariborz Jahanian2012-05-091-0/+1
| | | | | | | '*' on objective-c class name was misplaced. // rdar://11311333 llvm-svn: 156517
* Push the knowledge that we are parsing a type-id/type-name further into theRichard Smith2012-05-091-2/+5
| | | | | | | parser, and use it to emit better diagnostics in cases where an identifer can't be looked up as a type name. llvm-svn: 156508
* Stop AltiVec parsing from going down the 'implicit int' codepath as part of itsRichard Smith2012-05-091-1/+6
| | | | | | | normal parse for token sequences like 'vector pixel foo'. This incidentally also fixes a couple of wrong-parse issues. llvm-svn: 156503
* Recover properly if a class member declaration starts with a scope specifierRichard Smith2012-05-092-7/+12
| | | | | | or template-id which can't be parsed. llvm-svn: 156468
* Change how we suppress access control in explicit instantiationsJohn McCall2012-05-073-37/+109
| | | | | | | | | | so that we actually accumulate all the delayed diagnostics. Do this so that we can restore those diagnostics to good standing if it turns out that we were wrong to suppress, e.g. if the tag specifier is actually an elaborated type specifier and not a declaration. llvm-svn: 156291
* Refactor DelayedDiagnostics so that it keeps diagnostics inJohn McCall2012-05-075-10/+157
| | | | | | | separate pools owned by the RAII objects that keep pushing decl state. This gives us quite a bit more flexibility. llvm-svn: 156289
* Add -Wimplicit-fallthrough warning flag, which warns on fallthrough betweenRichard Smith2012-05-031-19/+21
| | | | | | | | | | | | cases in switch statements. Also add a [[clang::fallthrough]] attribute, which can be used to suppress the warning in the case of intentional fallthrough. Patch by Alexander Kornienko! The handling of C++11 attribute namespaces in this patch is temporary, and will be replaced with a cleaner mechanism in a subsequent patch. llvm-svn: 156086
* Revert most of r154844, which was disabled in r155975. Keep around theRichard Smith2012-05-025-174/+15
| | | | | | | refactorings in that revision, and some of the subsequent bugfixes, which seem to be relevant even without delayed exception specification parsing. llvm-svn: 156031
* Replace a ConsumeAnyToken() call with ConsumeToken() when we knowDouglas Gregor2012-05-021-1/+1
| | | | | | | we're looking at a normal token. Tiny positive impact -fsyntax-only time for <rdar://problem/11004361>. llvm-svn: 155988
* Disable our non-standard delayed parsing of exception specifications. DelayingRichard Smith2012-05-021-0/+6
| | | | | | | the parsing of such things appears to be a conforming extension, but it breaks libstdc++4.7's std::pair. llvm-svn: 155975
* A couple of very small tweaks suggested by Doug in reply to r155580 and r155163.Kaelyn Uhrain2012-05-011-2/+1
| | | | llvm-svn: 155870
* PR12688: ParseCXXClassMemberDeclaration's sometimes-null ThisDecl takes anotherRichard Smith2012-04-291-1/+1
| | | | | | | victim. Don't crash if we have a delay-parsed exception specification for a class member which is invalid in a way which precludes building a FunctionDecl. llvm-svn: 155788
* improve error recovery for extra ')'s after a if/switch/while condition. ↵Chris Lattner2012-04-281-0/+10
| | | | | | | | | | | | | | | | | | Before: t.c:3:9: error: expected expression if (x)) { ^ .. which isn't even true - a statement or expression is fine. After: t.c:3:9: error: extraneous ')' after condition, expected a statement if (x)) { ^ This is the second part of PR12595 llvm-svn: 155762
OpenPOWER on IntegriCloud