summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
* ParseTemplate.cpp: Prune obsolete descriptions in ↵NAKAMURA Takumi2012-11-141-10/+0
| | | | | | | | | | | | | | | | ParseSingleDeclarationAfterTemplate(), for now. [-Wdocumentation] /// \param TemplateParams if non-NULL, the template parameter lists /// that preceded this declaration. In this case, the declaration is a /// template declaration, out-of-line definition of a template, or an /// explicit template specialization. When NULL, the declaration is an /// explicit template instantiation. /// /// \param TemplateLoc when TemplateParams is NULL, the location of /// the 'template' keyword that indicates that we have an explicit /// template instantiation. llvm-svn: 167982
* ParseTemplate.cpp: Doxygen fix in AnnotateTemplateIdToken(). [-Wdocumentation]NAKAMURA Takumi2012-11-141-1/+1
| | | | llvm-svn: 167908
* Accept and pass arguments to __unknown_anytype in argumentJohn McCall2012-11-142-0/+10
| | | | | | | | | | | | | | | | | | | | | positions of Objective-C methods. It is possible to recover a lot of type information about Objective-C methods from the reflective metadata for their implementations. This information is not rich when it comes to struct types, however, and it is not possible to produce a type in the debugger's round-tripped AST which will really do anything useful during type-checking. Therefore we allow __unknown_anytype in these positions, which essentially disables type-checking for that argument. We infer the parameter type to be the unqualified type of the argument expression unless that expression is an explicit cast, in which case it becomes the type-as-written of that cast. rdar://problem/12565338 llvm-svn: 167896
* Simplify function try/catch scope handling.David Blaikie2012-11-131-3/+3
| | | | | | Based on post-commit review feedback for r167766 by Richard Smith. llvm-svn: 167856
* Fix more try scoping bugs introduced by r167650.David Blaikie2012-11-121-1/+1
| | | | | | | Introduces more clear scoping flags & flag combinations which should hopefully be more understandable. llvm-svn: 167766
* PR14296: function parameter name collisions in function try/catchDavid Blaikie2012-11-101-6/+8
| | | | | | | | | | | | C++11 3.3.3/2 "A parameter name shall not be redeclared in the outermost block of the function definition nor in the outermost block of any handler associated with a function-try-block." It's not totally clear to me whether the "FIXME" case is covered by this, but Richard Smith thinks it probably should be. It's just a bit more involved to fix that case. llvm-svn: 167650
* PR12713 - crash on invalid due to unmatched parens in decltypeDavid Blaikie2012-11-071-2/+2
| | | | llvm-svn: 167547
* Teach Clang parser to reject C++11 attributes that appertain to declaration ↵Michael Han2012-11-061-1/+19
| | | | | | | | | specifiers. We don't support any C++11 attributes that appertain to declaration specifiers so reject the attributes in parser until we support them; this also conforms to what g++ 4.8 is doing. llvm-svn: 167481
* Have the parser initialize Sema before it consumes the firstDouglas Gregor2012-11-052-4/+5
| | | | | | | | token. This is important because the first token could actually be after an #include that triggers a module import, which might use either Sema or the AST consumer before it would have been initialized. llvm-svn: 167423
* Support interleaving of other pragmas with FP_CONTRACT at the beginning of aLang Hames2012-11-031-4/+45
| | | | | | compound statement. llvm-svn: 167363
* Thread safety analysis: Fixed ICE caused by double delete when late parsedDeLesley Hutchins2012-11-022-3/+6
| | | | | | attributes are attached to function declarations nested inside a class method. llvm-svn: 167321
* Change diagnostics for enums with fixed underlying type so in C++98 mode, we ↵Eli Friedman2012-11-021-4/+7
| | | | | | cite C++11. llvm-svn: 167273
* When finding a '(' after '::', emit error with hint to remove '(' and matchingRichard Trieu2012-11-021-1/+44
| | | | | | | ')', if found. Don't crash. Fixes PR11852. llvm-svn: 167268
* If skipping bodies is enabled outside code-completion, just skip the body ↵Argyrios Kyrtzidis2012-10-311-1/+7
| | | | | | | | directly without using tentative parsing. llvm-svn: 167142
* Decouple code-completion for the SkipFunctionBodies frontend option andArgyrios Kyrtzidis2012-10-311-2/+3
| | | | | | add a test to make sure code-completion skips bodies. llvm-svn: 167141
* Fix crash on missing namespace name in namespace alias definition -- PR14085.Nico Weber2012-10-271-0/+6
| | | | | | Patch from Brian Brooks <brooks.brian@gmail.com>! llvm-svn: 166893
* Currently the initial value of Tok is dependent an the stack contentsChris Lattner2012-10-271-0/+1
| | | | | | | | and could cause the Parser to crash on the first ConsumeToken(). Patcy by Bas van den Berg! llvm-svn: 166891
* Reverted back the changes made in 166868 and in 166869Mahesha S2012-10-271-234/+0
| | | | llvm-svn: 166871
* Feature:Mahesha S2012-10-271-0/+235
| | | | | | | | | | | | | | | | | | | | | OpenMP support. Sub-Feature: Support for "#pragma omp ..." registration with Preprocessor. Files Changed/Added: * include/clang/Basic/DiagnosticGroups.td (C) * include/clang/Basic/DiagnosticParseKinds.td (C) * include/clang/Basic/TokenKinds.def (C) * include/clang/Parse/Parser.h (C) * lib/Parse/Parser.cpp (C) Test Cases Changed/Added: * test/Preprocessor/pragma_omp.c (A) * test/Preprocessor/pragma_omp_ignored_warning.c (A) llvm-svn: 166869
* Removed an extra blank line.Mahesha S2012-10-271-1/+0
| | | | llvm-svn: 166867
* In Parser::ParseDecltypeSpecifier, make sure the end location it returnsArgyrios Kyrtzidis2012-10-261-2/+15
| | | | | | | is at the end of parsed tokens when an error occurs, otherwise we'll hit an assertion when trying to annotate the decltype tokens. llvm-svn: 166826
* 'constexpr' and 'friend' are both declaration specifiers. Teach the parser ↵Richard Smith2012-10-251-3/+5
| | | | | | this, for better error recovery. llvm-svn: 166645
* When used in a compound expression FP_CONTRACT should proceed all explicitLang Hames2012-10-211-3/+8
| | | | | | | declarations and statements. Emit an error if the FP_CONTRACT is used later in a compound statement. llvm-svn: 166383
* DR1473: Do not require a space between operator"" and the ud-suffix in aRichard Smith2012-10-201-5/+10
| | | | | | literal-operator-id. llvm-svn: 166373
* DR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.Richard Smith2012-10-171-6/+6
| | | | llvm-svn: 166152
* Fixed FunctionTypeLoc range for trailing return type.Abramo Bagnara2012-10-151-3/+10
| | | | llvm-svn: 165974
* Handle a "#pragma options align" inside a class.Argyrios Kyrtzidis2012-10-121-0/+5
| | | | llvm-svn: 165810
* Fix a crash-on-invalid when parsing a reference to an invalid auto declarationDavid Blaikie2012-10-101-0/+1
| | | | | | | | | auto x((unknown)); int& y = x; would crash because we were not flagging 'x' as an invalid declaration here. llvm-svn: 165675
* People put pragmas in crazy places; add more handling. PR14046.Eli Friedman2012-10-091-0/+20
| | | | | | | I think our general framework for parser pragmas needs a bit more work, but I'm not planning on working on it at the moment. llvm-svn: 165558
* Make sure we allow "#pragma options align=mac68k" in function-local ↵Eli Friedman2012-10-081-0/+5
| | | | | | contexts. <rdar://problem/12453134> llvm-svn: 165462
* Fixed FunctionTypeLoc source range.Abramo Bagnara2012-10-043-48/+74
| | | | llvm-svn: 165259
* Fix scope location when parsing GNU attributes.Michael Han2012-10-041-4/+5
| | | | | | | | For GNU attributes, instead of reusing attribute source location for the scope location, use SourceLocation() since GNU attributes don not have scope tokens. llvm-svn: 165234
* Permanently end the whole "pragma got handled by the parser too early"Eli Friedman2012-10-044-85/+251
| | | | | | | mess by handling all pragmas which the parser touches uniformly. <rdar://problem/12248901>, etc. llvm-svn: 165195
* Improve C++11 attribute parsing.Michael Han2012-10-032-37/+51
| | | | | | | | - General C++11 attributes were previously parsed and ignored. Now they are parsed and stored in AST. - Add support to parse arguments of attributes that in 'gnu' namespace. - Differentiate unknown attributes and known attributes that can't be applied to statements when emitting diagnostic. llvm-svn: 165082
* Add FP_CONTRACT support for clang.Lang Hames2012-10-021-0/+5
| | | | | | | | Clang will now honor the FP_CONTRACT pragma and emit LLVM fmuladd intrinsics for expressions of the form A * B + C (when they occur in a single statement). llvm-svn: 164989
* Fix an edge case of mangling involving the combination of a lambda and typeid.Eli Friedman2012-09-263-3/+6
| | | | | | | | | | | | | typeid (and a couple other non-standard places where we can transform an unevaluated expression into an evaluated expression) is special because it introduces an an expression evaluation context, which conflicts with the mechanism to compute the current lambda mangling context. PR12123. I would appreciate if someone would double-check that we get the mangling correct with this patch. llvm-svn: 164658
* Add the Microsoft __is_interface_class type trait.John McCall2012-09-253-0/+3
| | | | | | Patch by Andy Gibbs! llvm-svn: 164591
* Fix for r163013 regression and further __interface enhancement.John McCall2012-09-251-13/+43
| | | | | | Patch by Andy Gibbs! llvm-svn: 164590
* If the range in a for range statement doesn't have a viable begin/end function,Richard Smith2012-09-201-1/+2
| | | | | | | | | | | | | but can be dereferenced to form an expression which does have viable begin/end functions, then typo-correct the range, even if something else goes wrong with the statement (such as inaccessible begin/end or the wrong type of loop variable). In order to ensure we recover correctly and produce any followup diagnostics in this case, redo semantic analysis on the for-range statement outside of the diagnostic trap, after issuing the typo-correction. llvm-svn: 164323
* If a comma operator is followed by a token which unambiguously indicates theRichard Smith2012-09-182-1/+24
| | | | | | | | start of a statement or the end of a compound-statement, diagnose the comma as a typo for a semicolon. Patch by Ahmed Bougacha! Additional test cases and minor refactoring by me. llvm-svn: 164085
* objective-C: improve on warnings about misplacement of methodFariborz Jahanian2012-09-171-20/+4
| | | | | | argument names. // rdar://12263549 llvm-svn: 164077
* objective-C: issue warning when there is no whitespaceFariborz Jahanian2012-09-171-1/+25
| | | | | | | between objc method parameter name and colon. // rdar://12263549 llvm-svn: 164047
* Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.Dmitri Gribenko2012-09-151-5/+5
| | | | llvm-svn: 163983
* Fix some dead stores which the static analyzer warned about. No functionalityRichard Smith2012-09-141-2/+4
| | | | | | change (the problematic cases in ParseDecl.cpp are currently impossible). llvm-svn: 163920
* Recover properly after a parse error in a static_assert declaration.Richard Smith2012-09-131-3/+4
| | | | llvm-svn: 163826
* Fix a couple of Doxygen issues pointed out by -Wdocumentation.Dmitri Gribenko2012-09-121-2/+2
| | | | llvm-svn: 163722
* Revert "objective-C: warn under a flag if missing argument"Ted Kremenek2012-09-121-14/+3
| | | | | | | We plan on discussing this more, but we shouldn't have it in the compiler in an incomplete state. llvm-svn: 163720
* Revert "objective-C: warn if selector has nothing but bare"Ted Kremenek2012-09-121-7/+2
| | | | | | We plan on discussing this more. llvm-svn: 163719
* objective-C: warn if selector has nothing but bareFariborz Jahanian2012-09-111-2/+7
| | | | | | ':' in its name. // rdar://8366823 llvm-svn: 163650
* objective-C: warn under a flag if missing argumentFariborz Jahanian2012-09-111-3/+14
| | | | | | | name results in unintended selector name. // rdar://12263549 llvm-svn: 163634
OpenPOWER on IntegriCloud