Граф коммитов

1908 Коммитов

Автор SHA1 Сообщение Дата
Richard Smith 569cdc82c1 PR14549. Don't assert if we see an incomplete decltype specifier at the end of the file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169688 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-09 04:17:57 +00:00
Argyrios Kyrtzidis 35f3f36cb9 Add a bit on FunctionDecl/ObjCMethodDecl to indicate if there was a body
that was skipped by the parser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169531 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 18:59:10 +00:00
Chad Rosier 15490fd42d [driver, ms-inline asm] MS-Style inline assembly is controlled by the
-fasm-blocks flag, not the -fms-extensions flag.
rdar://12808010

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169422 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-05 21:08:21 +00:00
Chandler Carruth 55fc873017 Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 09:13:33 +00:00
Benjamin Kramer 9852f58f50 Don't include Type.h in DeclarationName.h.
Recursively prune some includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169094 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-01 16:35:25 +00:00
Nico Weber bba91b881c Fix sentence construction-o.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168855 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 05:29:23 +00:00
Michael Han 52b501cd72 Implement C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains to a friend declaration, that declaration shall be a definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168826 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 23:17:40 +00:00
Nico Weber f88836d949 Move PrettyStackTraceParserEntry to ParseAST.cpp
r128056 moved PrettyStackTraceParserEntry construction from Parser.h
to ParseAST.cpp, so there's no need to keep this class in a header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168731 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 21:57:34 +00:00
Michael Han 2e39713a3d Improve diagnostic on C++11 attribute specifiers that appear at wrong syntactic locations around class specifiers.
This change list implemented logic that explicitly detects several combinations of locations where C++11 attribute
specifiers might be incorrectly placed within a class specifier. Previously we emit generic diagnostics like 
"expected identifier" for such cases; now we emit specific diagnostic against the misplaced attributes, this also 
fixed a bug in old code where attributes appear at legitimate locations were incorrectly rejected.

Thanks to Richard Smith for reviewing!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168626 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-26 22:54:45 +00:00
Richard Smith 1a5bd5d680 PR14381: Never skip constexpr function bodies when code-completing. We may need
them in order to parse the rest of the file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168327 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-19 21:13:18 +00:00
Andy Gibbs 97f8461a2c Made the "expected string literal" diagnostic more expressive
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168267 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-17 19:16:52 +00:00
Richard Smith 6f9a445760 PR9903: Recover from a member functon declared with the 'typedef' specifier by
dropping the specifier, just like we do for non-member functions and function
templates declared 'typedef'. Patch by Brian Brooks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168108 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-15 22:54:20 +00:00
NAKAMURA Takumi 5a95d46029 ParseTemplate.cpp: Prune obsolete descriptions in 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167982 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14 21:45:43 +00:00
NAKAMURA Takumi 384d3fc80f ParseTemplate.cpp: Doxygen fix in AnnotateTemplateIdToken(). [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167908 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14 02:21:42 +00:00
John McCall b8a8de316d Accept and pass arguments to __unknown_anytype in argument
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167896 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14 00:49:39 +00:00
David Blaikie e5afdcfd6a Simplify function try/catch scope handling.
Based on post-commit review feedback for r167766 by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167856 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-13 18:51:45 +00:00
David Blaikie 3a9fefed07 Fix more try scoping bugs introduced by r167650.
Introduces more clear scoping flags & flag combinations which should hopefully
be more understandable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167766 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-12 22:25:41 +00:00
David Blaikie c4027c82ad PR14296: function parameter name collisions in function try/catch
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167650 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-10 01:04:23 +00:00
David Blaikie b578aee665 PR12713 - crash on invalid due to unmatched parens in decltype
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167547 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-07 19:08:05 +00:00
Michael Han f64231e9f4 Teach Clang parser to reject C++11 attributes that appertain to declaration 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167481 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06 19:34:54 +00:00
Douglas Gregor c7be10245e Have the parser initialize Sema before it consumes the first
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167423 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-05 23:58:27 +00:00
Lang Hames a60d21d9ff Support interleaving of other pragmas with FP_CONTRACT at the beginning of a
compound statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167363 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-03 22:29:05 +00:00
DeLesley Hutchins 161db02a74 Thread safety analysis: Fixed ICE caused by double delete when late parsed
attributes are attached to function declarations nested inside a class method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167321 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-02 21:44:32 +00:00
Eli Friedman cef3a7bf84 Change diagnostics for enums with fixed underlying type so in C++98 mode, we cite C++11.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167273 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-02 01:34:28 +00:00
Richard Trieu 919b9557b4 When finding a '(' after '::', emit error with hint to remove '(' and matching
')', if found.  Don't crash.
Fixes PR11852.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167268 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-02 01:08:58 +00:00
Argyrios Kyrtzidis 81939a752b If skipping bodies is enabled outside code-completion, just skip the body directly
without using tentative parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167142 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31 17:29:28 +00:00
Argyrios Kyrtzidis 25893e0930 Decouple code-completion for the SkipFunctionBodies frontend option and
add a test to make sure code-completion skips bodies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-31 17:29:22 +00:00
Nico Weber e1bb329744 Fix crash on missing namespace name in namespace alias definition -- PR14085.
Patch from Brian Brooks <brooks.brian@gmail.com>!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166893 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-27 23:44:27 +00:00
Chris Lattner 2b970e9d70 Currently the initial value of Tok is dependent an the stack contents
and could cause the Parser to crash on the first ConsumeToken().

Patcy by Bas van den Berg!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166891 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-27 19:49:20 +00:00
Mahesha S 286d623685 Reverted back the changes made in 166868 and in 166869
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166871 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-27 10:44:42 +00:00
Mahesha S 68de140b5d Feature:
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)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166869 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-27 09:05:45 +00:00
Mahesha S 6a656620f6 Removed an extra blank line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166867 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-27 07:23:58 +00:00
Argyrios Kyrtzidis 1e584697aa In Parser::ParseDecltypeSpecifier, make sure the end location it returns
is at the end of parsed tokens when an error occurs, otherwise we'll hit
an assertion when trying to annotate the decltype tokens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166826 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26 22:53:44 +00:00
Richard Smith 53aec2a277 'constexpr' and 'friend' are both declaration specifiers. Teach the parser this, for better error recovery.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166645 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25 00:00:53 +00:00
Lang Hames 860022ccf7 When used in a compound expression FP_CONTRACT should proceed all explicit
declarations and statements. Emit an error if the FP_CONTRACT is used
later in a compound statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166383 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-21 01:10:01 +00:00
Richard Smith aa9a8ce5d3 DR1473: Do not require a space between operator"" and the ud-suffix in a
literal-operator-id.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166373 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-20 08:41:10 +00:00
Richard Smith d654f2d722 DR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166152 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17 23:31:46 +00:00
Abramo Bagnara ac8ea058fe Fixed FunctionTypeLoc range for trailing return type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165974 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 21:05:46 +00:00
Argyrios Kyrtzidis f4deaef8b8 Handle a "#pragma options align" inside a class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165810 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12 17:39:59 +00:00
David Blaikie 3ea19c8307 Fix a crash-on-invalid when parsing a reference to an invalid auto declaration
auto x((unknown));
  int& y = x;

would crash because we were not flagging 'x' as an invalid declaration here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165675 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10 23:15:05 +00:00
Eli Friedman 8b2bfdda35 People put pragmas in crazy places; add more handling. PR14046.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165558 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 22:46:54 +00:00
Eli Friedman 3ef38eea7c Make sure we allow "#pragma options align=mac68k" in function-local contexts. <rdar://problem/12453134>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165462 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08 23:52:38 +00:00
Abramo Bagnara 59c0a818a7 Fixed FunctionTypeLoc source range.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165259 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 21:42:10 +00:00
Michael Han 45bed131a1 Fix scope location when parsing GNU attributes.
For GNU attributes, instead of reusing attribute source 
location for the scope location, use SourceLocation() since 
GNU attributes don not have scope tokens. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165234 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 16:42:52 +00:00
Eli Friedman 9595c7e253 Permanently end the whole "pragma got handled by the parser too early"
mess by handling all pragmas which the parser touches uniformly.
<rdar://problem/12248901>, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165195 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-04 02:36:51 +00:00
Michael Han 6880f49236 Improve C++11 attribute parsing.
- 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165082 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 01:56:22 +00:00
Lang Hames be9af12888 Add FP_CONTRACT support for clang.
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).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164989 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 04:45:10 +00:00
Eli Friedman 80bfa3d125 Fix an edge case of mangling involving the combination of a lambda and typeid.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164658 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 04:34:21 +00:00
John McCall ea30e2f866 Add the Microsoft __is_interface_class type trait.
Patch by Andy Gibbs!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164591 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-25 07:32:49 +00:00
John McCall e402e72273 Fix for r163013 regression and further __interface enhancement.
Patch by Andy Gibbs!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164590 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-25 07:32:39 +00:00