summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
...
* Add source location information to C++ base specifiers.Nick Lewycky2010-07-261-3/+14
| | | | llvm-svn: 109396
* Eliminate the "minimal" and printing parser actions, which only everDouglas Gregor2010-07-263-282/+105
| | | | | | | worked for C anyway. Also kills the -cc1 options -parse-noop and -parse-print-callbacks. llvm-svn: 109392
* atch for implementation of objective-c's -WselectorFariborz Jahanian2010-07-221-1/+2
| | | | | | | warning flag in clang. Little more to do for a PCH issue. Radar 6507158. llvm-svn: 109129
* Fix PR7673 by allowing an empty clobbers section in an ASM statement.Chandler Carruth2010-07-221-8/+10
| | | | llvm-svn: 109087
* tidy up comment.Chris Lattner2010-07-191-2/+1
| | | | llvm-svn: 108676
* BUILD_ARCHIVE is the default for libraries, no need to set it.Chris Lattner2010-07-181-1/+0
| | | | llvm-svn: 108633
* Treat template parameters as part of the declaration-specifiers for theJohn McCall2010-07-162-7/+21
| | | | | | | | purpose of access control. Fixes PR7644. I can't actually find anything directly justifying this, but it seems obvious. llvm-svn: 108521
* When we're performing tentative parsing to determine whether theDouglas Gregor2010-07-151-15/+8
| | | | | | | | | | | | | | | | parser is looking at a declaration or an expression, use a '=' to conclude that we are parsing a declaration. This is wrong. However, our previous approach of finding a comma after the '=' is also wrong, because the ',' could be part of a template-argument-list. So, for now we're going to use the same wrong heuristic as GCC and Visual C++, because less real-world code is likely to be broken this way. I've opened PR7655 to keep track of our wrongness; note also the XFAIL'd test. Fixes <rdar://problem/8193163>. llvm-svn: 108459
* Downgrade the "when type is in parentheses, array cannot have dynamicDouglas Gregor2010-07-131-8/+6
| | | | | | | | | | | | size" error for code like new (int [size]) to a warning, add a Fix-It to remove the parentheses, and make this diagnostic work properly when it occurs in a template instantiation. <rdar://problem/8018245>. llvm-svn: 108242
* Modify the pragma handlers to accept and use StringRefs instead of ↵Argyrios Kyrtzidis2010-07-132-29/+23
| | | | | | | | | | | 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-113-9/+27
| | | | | | | | | | | | | | | | | | | | | 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-112-7/+9
| | | | llvm-svn: 108104
* Support code completion for parameter names in Objective-C methodDouglas Gregor2010-07-081-0/+15
| | | | | | declarations. llvm-svn: 107933
* Introduce a new code-completion point prior to an identifier in theDouglas Gregor2010-07-081-0/+11
| | | | | | | | | | | | selector of an Objective-C method declaration, e.g., given - (int)first:(int)x second:(int)y; this code completion point triggers at the location of "second". It will provide completions that fill out the method declaration for any known method, anywhere in the translation unit. llvm-svn: 107929
* Move the "current scope" state from the Parser into Action. ThisDouglas Gregor2010-07-0211-247/+248
| | | | | | | | | | | | | | 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
* Implement C++ DR481, which clarifies that the scope of templateDouglas Gregor2010-07-011-45/+35
| | | | | | | | | | | | | | | | | parameters starts at the end of the template-parameter rather than at the point where the template parameter name is encounted. For example, given: typedef unsigned char T; template<typename T = T> struct X0 { }; The "T" in the default argument refers to the typedef of "unsigned char", rather than referring to the newly-introduced template type parameter 'T'. Addresses <rdar://problem/8122812>. llvm-svn: 107354
* Partial fix for PR7267 based on comments by John McCall on an earlier patch.Chandler Carruth2010-06-281-0/+22
| | | | | | | | | | | | | | | | | | This is more targeted, as it simply provides toggle actions for the parser to turn access checking on and off. We then use these to suppress access checking only while we parse the template-id (included scope specifier) of an explicit instantiation and explicit specialization of a class template. The specialization behavior is an extension, as it seems likely a defect that the standard did not exempt them as it does explicit instantiations. This allows the very common practice of specializing trait classes to work for private, internal types. This doesn't address instantiating or specializing function templates, although those apparently already partially work. The naming and style for the Action layer isn't my favorite, comments and suggestions would be appreciated there. llvm-svn: 106993
* Add parentheses suggested by gcc.Duncan Sands2010-06-231-2/+2
| | | | llvm-svn: 106668
* improve altivec vector bool/pixel support, patch by Anton YartsevChris Lattner2010-06-231-8/+47
| | | | | | with several tweaks by me. llvm-svn: 106619
* Fix PR7180.Argyrios Kyrtzidis2010-06-221-6/+4
| | | | | | | | | | | For void f( a::b::c ); we would cache the tokens "a::b::" but then we would try to annotate them using the range "a::". Before annotating them with the (invalid) C++ scope spec, set it to the range of "a::b::". llvm-svn: 106536
* When semantic analysis fail to introduce a class or class template,Douglas Gregor2010-06-211-30/+35
| | | | | | | | just skip over the body of the class or class template: it's a semantic disaster that's likely to cause invariants to break. Fixes part of <rdar://problem/8104754>. llvm-svn: 106496
* Cure for Doug's insomnia.Argyrios Kyrtzidis2010-06-191-3/+3
| | | | llvm-svn: 106394
* Implements Sema part of init_priority(priority) attributeFariborz Jahanian2010-06-181-0/+1
| | | | | | (radar 8076356) - wip. llvm-svn: 106322
* Make sure the caching mechanism in Parser::ParseLexedMethodDefs is robust ↵Argyrios Kyrtzidis2010-06-171-4/+16
| | | | | | against the parser reading too few tokens. llvm-svn: 106214
* Make sure parens/braces/brackets are correctly balanced.Argyrios Kyrtzidis2010-06-174-1/+33
| | | | | | | | | | | 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
* Per conversation with Doug, remove two assertions in ParseLexedMethodDefs() thatTed Kremenek2010-06-171-5/+3
| | | | | | didn't indicate violated invariants but that we weren't recovering well. llvm-svn: 106195
* Update CMake build for new attribute changes.Alexis Hunt2010-06-171-1/+1
| | | | llvm-svn: 106188
* When parsing cached C++ method declarations/definitions, save theDouglas Gregor2010-06-161-0/+2
| | | | | | | | "previous token" location at the end of the class definition. This eliminates a badly-placed error + Fix-It when the ';' following a class definition is missing. Fixes <rdar://problem/8066414>. llvm-svn: 106175
* Make the "extra ';' inside a struct or union" diagnostic moreDouglas Gregor2010-06-163-1/+3
| | | | | | precise. Fixes PR7336. llvm-svn: 106170
* When we see a 'template' disambiguator that marks the next identifierDouglas Gregor2010-06-162-45/+46
| | | | | | | | | | | (or operator-function-id) as a template, but the context is actually non-dependent or the current instantiation, allow us to use knowledge of what kind of template it is, e.g., type template vs. function template, for further syntactic disambiguation. This allows us to parse properly in the presence of stray "template" keywords, which is necessary in C++0x and it's good recovery in C++98/03. llvm-svn: 106167
* Fix the recently-added warning about 'typename' and 'template'Douglas Gregor2010-06-163-11/+15
| | | | | | | | | 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
* Add some missing parentheses, from Anton YartsevDouglas Gregor2010-06-161-1/+1
| | | | llvm-svn: 106101
* Allow an asm label specifier on C++ methods, like GCC does.Chris Lattner2010-06-131-2/+11
| | | | | | Patch by David Majnemer! llvm-svn: 105909
* Makefiles: Set Clang CPP compiler flags in a single location, instead of ↵Daniel Dunbar2010-06-081-2/+0
| | | | | | scattered throughout the project Makefiles. llvm-svn: 105638
* Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.Daniel Dunbar2010-06-081-2/+2
| | | | | | - This eliminates most dependencies on how Clang is installed relative to LLVM. llvm-svn: 105637
* Added AccessSpecDecl node.Abramo Bagnara2010-06-051-1/+6
| | | | llvm-svn: 105525
* Properly disambiguate between an elaborated-type-specifier and aDouglas Gregor2010-06-041-2/+31
| | | | | | type-parameter within a template parameter list. Found by inspection. llvm-svn: 105462
* Fix compiler warning about to false -> pointer conversion; patch by Dimitry ↵Daniel Dunbar2010-06-021-1/+1
| | | | | | Andric! llvm-svn: 105328
* Minor tweaks on doug's objc recovery patch: the callerChris Lattner2010-05-312-7/+12
| | | | | | | | | | | | of isSimpleObjCMessageExpression checks the language, so change a dynamic check into an assert. isSimpleObjCMessageExpression is expensive, so only do it in the common case when it is likely to matter: when the [ of the postfix expr starts on a new line. This should avoid doing lookahead for every array expression. llvm-svn: 105229
* When we see the a '[' in a postfix expression in Objective-C, performDouglas Gregor2010-05-312-0/+18
| | | | | | | | | | | | | | | | | | | a simple, quick check to determine whether the expression starting with '[' can only be an Objective-C message send. If so, don't parse it as an array subscript expression. This improves recovery for, e.g., [a method1] [a method2] so that we now produce t.m:10:13: error: expected ';' after expression [a method] ^ instead of some mess about expecting ']'. llvm-svn: 105221
* Don't try to parse class template specializations in C. It can onlyDouglas Gregor2010-05-301-3/+1
| | | | | | lead to heartache. Fixes <rdar://problem/8044088>. llvm-svn: 105178
* Improve parser recovery when we try to parse a call expression but theDouglas Gregor2010-05-301-1/+8
| | | | | | | called function itself is invalid (e.g., because of a semantic error referring to that declaration). Fixes <rdar://problem/8044142>. llvm-svn: 105175
* Teach code completion to adjust its completion priorities based on theDouglas Gregor2010-05-303-0/+22
| | | | | | | | | 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
* Empty enum in c is now error to match gcc's behavior.Fariborz Jahanian2010-05-281-1/+1
| | | | | | (radar 8040068). llvm-svn: 105011
* Roll back r104941.John McCall2010-05-281-1/+0
| | | | llvm-svn: 104990
* Add a new attribute on records, __attribute__((adl_invisible)), and defineJohn McCall2010-05-281-0/+1
| | | | | | | | | | | | the x86-64 __va_list_tag with this attribute. The attribute causes the affected type to behave like a fundamental type when considered by ADL. (x86-64 is the only target we currently provide with a struct-based __builtin_va_list) Fixes PR6762. llvm-svn: 104941
* Don't just skip over the entire tag definition if the parser action didn'tJohn McCall2010-05-281-10/+8
| | | | | | | give us a decl back. Makes -cc1 -parse-noop handle a substantially larger amount of the C++ grammar. llvm-svn: 104940
* 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
* Implement a code-completion hook for the receiver of an Objective-CDouglas Gregor2010-05-271-0/+7
| | | | | | | message. This completion gives better results than just using the "expression" completion, which is effectively what happened before. llvm-svn: 104895
OpenPOWER on IntegriCloud