History log of /external/clang/lib/Parse/Parser.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3ea9e33ea25e0c2b12db56418ba3f994eb662c04 08-Apr-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r233350

Change-Id: I12d4823f10bc9e445b8b86e7721b71f98d1df442
/external/clang/lib/Parse/Parser.cpp
0e2c34f92f00628d48968dfea096d36381f494cb 23-Mar-2015 Stephen Hines <srhines@google.com> Update aosp/master clang for rebase to r230699.

Change-Id: I6a546ab3d4ae37119eebb735e102cca4f80ab520
/external/clang/lib/Parse/Parser.cpp
176edba5311f6eff0cad2631449885ddf4fbc9ea 01-Dec-2014 Stephen Hines <srhines@google.com> Update aosp/master Clang for rebase to r222490.

Change-Id: Ic557ac55e97fbf6ee08771c7b7c3594777b0aefd
/external/clang/lib/Parse/Parser.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/lib/Parse/Parser.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/Parse/Parser.cpp
03e463e293f5ecf62cb8c807d00edb9fbb1f99d7 16-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196212:
------------------------------------------------------------------------
r196212 | alp | 2013-12-02 22:13:01 -0800 (Mon, 02 Dec 2013) | 22 lines

Emit an extension warning when changing system header tokens

clang converts keywords to identifiers for compatibility with various system
headers such as GNU libc.

Implement a -Wkeyword-compat extension warning to diagnose those cases. The
warning is on by default but will generally be ignored in system headers. It
can however be enabled globally to aid standards conformance testing.

This also changes the __uptr keyword avoidance from r195710 to no longer
special-case system headers, bringing it in line with other similar workarounds
in clang.

Implementation returns bool for symmetry with token annotation functions.

Some examples:

warning: keyword '__is_pod' will be treated as an identifier for the remainder of the translation unit [-Wkeyword-compat]
struct __is_pod

warning: keyword '__uptr' will be treated as an identifier here [-Wkeyword-compat]
union w *__uptr;
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@197359 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
f0cc19f43d5e05dbd22d00faca8c093b7005be3f 19-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195163:
------------------------------------------------------------------------
r195163 | rsmith | 2013-11-19 14:47:36 -0800 (Tue, 19 Nov 2013) | 5 lines

PR9547: If we're parsing a simple-declaration that contains a tag definition,
and we see an ill-formed declarator that would probably be well-formed if the
tag definition were just missing a semicolon, use that as the diagnostic
instead of producing some other mysterious error.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
f2b87508c744d6581200fa6521f0924b7f3c0e9f 18-Nov-2013 Benjamin Kramer <benny.kra@googlemail.com> Make helper function static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
8fe2475a4b4c00475709c13d43eb9a57cce87cbc 18-Nov-2013 Alexey Bataev <a.bataev@hotmail.com> Replaced bool parameters in SkipUntil function with single bit-based parameter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
26297f57634994b4ae47a0774c372d6944265bb2 15-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> When we hit a #include directive that maps to a module import, emit a token
representing the module import rather than making the module immediately
visible. This serves two goals:
* It avoids making declarations in the module visible prematurely, if we
walk past the #include during a tentative parse, for instance, and
* It gives a diagnostic (although, admittedly, not a very nice one) if
a header with a corresponding module is included anywhere other than
at the top level.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
32b5ca012c42d418c9ff0d4175b17f174459e187 01-Nov-2013 Faisal Vali <faisalv@yahoo.com> Support return type deduction for templates in -fdelayed-template-parsing (microsoft) mode

Please see http://llvm-reviews.chandlerc.com/D2053 for discussion and Richard's stamp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
645526c3e42170e356f792b1bc0ac2acb65c26c4 23-Oct-2013 David Majnemer <david.majnemer@gmail.com> Parse: Disable delayed template parsing for constexpr functions

Commit r191484 treated constexpr function templates as normal function
templates with respect to delaying their parsing. However, this is
unnecessarily restrictive because there is no compatibility concern with
constexpr, MSVC doesn't support it.

Instead, simply disable delayed template parsing for constexpr function
templates. This largely reverts the changes made in r191484 but keeps
it's unit test.

This fixes PR17661.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d661d50118716e9695af5a893a2df45e87a6b3c8 22-Oct-2013 Chandler Carruth <chandlerc@gmail.com> Revert r193073 and the attempt to fix it in r193170.

This patch wasn't reviewed, and isn't correctly preserving the behaviors
relied upon by QT. I don't have a direct example of fallout, but it
should go through the standard code review process. For example, it
should never have removed the QT test case that was added when fixing
those users.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
fb90266d8bb5a977de45d07e702277f4cb54d74e 21-Oct-2013 Serge Pavlov <sepavloff@gmail.com> Fix to PR8880 (clang dies processing a for loop).

Due to statement expressions supported as GCC extension, it is possible
to put 'break' or 'continue' into a loop/switch statement but outside its
body, for example:

for ( ; ({ if (first) { first = 0; continue; } 0; }); )

Such usage must be diagnosed as an error, GCC rejects it. To recognize
this and similar patterns the flags BreakScope and ContinueScope are
temporarily turned off while parsing condition expression.

Differential Revision: http://llvm-reviews.chandlerc.com/D1762


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7121bdb91b86f6053765bda18dd0a8a118929ace 18-Oct-2013 David Majnemer <david.majnemer@gmail.com> [-fms-extensions] Permit 'override' in C++98 and 'sealed' as a synonym for 'final'

Summary: Some MS headers use these features.

Reviewers: rnk, rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1948

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5eed7e00b4ac8d589ca83e126dafa8767e8a0358 15-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Tidy up and improve error recovery for C++11 attributes in bad places. Based on
a patch by Michael Han.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
67ac9989e3ec53174b524ab8bc7d08185346cace 04-Sep-2013 David Majnemer <david.majnemer@gmail.com> Parser: support Microsoft syntax for 'typename typedef'

Summary:
Transform the token sequence for:
typename typedef T U;

to:
typename T typedef U;

Raise a diagnostic when this happens but only if we succeeded handling
the typename.

Reviewers: rsmith, rnk

Reviewed By: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1433

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
152b4e4652baedfceba1cd8115515629225e713f 22-Aug-2013 Manuel Klimek <klimek@google.com> Revert "Implement a rudimentary form of generic lambdas."

This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
ecb5819a9e64fb654d46a3b270a286cc570c58ff 22-Aug-2013 Faisal Vali <faisalv@yahoo.com> Implement a rudimentary form of generic lambdas.

Specifically, the following features are not included in this commit:
- any sort of capturing within generic lambdas
- nested lambdas
- conversion operator for captureless lambdas
- ensuring all visitors are generic lambda aware


As an example of what compiles:

template <class F1, class F2>
struct overload : F1, F2 {
using F1::operator();
using F2::operator();
overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
};

auto Recursive = [](auto Self, auto h, auto ... rest) {
return 1 + Self(Self, rest...);
};
auto Base = [](auto Self, auto h) {
return 1;
};
overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
int num_params = O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

Some implementation notes:

- Add a new Declarator context => LambdaExprParameterContext to
clang::Declarator to allow the use of 'auto' in declaring generic
lambda parameters

- Augment AutoType's constructor (similar to how variadic
template-type-parameters ala TemplateTypeParmDecl are implemented) to
accept an IsParameterPack to encode a generic lambda parameter pack.

- Add various helpers to CXXRecordDecl to facilitate identifying
and querying a closure class

- LambdaScopeInfo (which maintains the current lambda's Sema state)
was augmented to house the current depth of the template being
parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
so that Sema::ActOnLambdaAutoParameter may use it to create the
appropriate list of corresponding TemplateTypeParmDecl for each
auto parameter identified within the generic lambda (also stored
within the current LambdaScopeInfo). Additionally,
a TemplateParameterList data-member was added to hold the invented
TemplateParameterList AST node which will be much more useful
once we teach TreeTransform how to transform generic lambdas.

- SemaLambda.h was added to hold some common lambda utility
functions (this file is likely to grow ...)

- Teach Sema::ActOnStartOfFunctionDef to check whether it
is being called to instantiate a generic lambda's call
operator, and if so, push an appropriately prepared
LambdaScopeInfo object on the stack.

- Teach Sema::ActOnStartOfLambdaDefinition to set the
return type of a lambda without a trailing return type
to 'auto' in C++1y mode, and teach the return type
deduction machinery in SemaStmt.cpp to process either
C++11 and C++14 lambda's correctly depending on the flag.

- various tests were added - but much more will be needed.

A greatful thanks to all reviewers including Eli Friedman,
James Dennett and the ever illuminating Richard Smith. And
yet I am certain that I have allowed unidentified bugs to creep in;
bugs, that I will do my best to slay, once identified!

Thanks!




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
ac32d9044b9c1e7492cef929a322d23ce899d276 07-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR9992: Serialize and deserialize the token sequence for a function template in
-fdelayed-template-parsing mode. Patch by Will Wilson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
ef4579cda09b73e3d4d98af48201da25adc29326 06-Aug-2013 Larisse Voufo <lvoufo@google.com> Started implementing variable templates. Top level declarations should be fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d66bf94f527c6bd24089615ee3a0b74a2ec35310 25-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Avoid recursions when the parser finds out that it has too many brackets.

BalancedDelimiterTracker::diagnoseOverflow calls P.SkipUntil, and before this
patch P.SkipUnti is recursive, causing problems on systems with small stacks.
This patch fixes it by making P.SkipUnti non recursive when just looking for
eof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3e3d20b2b26a885fcae855bb0b02dbc42d7c5739 03-Jul-2013 Bill Schmidt <wschmidt@linux.vnet.ibm.com> "bool" should be a context-sensitive keyword in Altivec mode.

PR16456 reported that Clang implements a hybrid between AltiVec's
"Keyword and Predefine Method" and its "Context Sensitive Keyword
Method," where "bool" is always a keyword, but "vector" and "pixel"
are context-sensitive keywords. This isn't permitted by the AltiVec
spec. For consistency with gcc, this patch implements the Context
Sensitive Keyword Method for bool, and stops treating true and false
as keywords in Altivec mode.

The patch removes KEYALTIVEC as a trigger for defining these keywords
in include/clang/Basic/TokenKinds.def, and adds logic for "vector
bool" that mirrors the existing logic for "vector pixel." The test
case is taken from the bug report.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a7ff62f9443efa3b13a28a1e566d4625b15b8553 04-Jun-2013 Aaron Ballman <aaron@aaronballman.com> Adding support for MSVC #pragma detect_mismatch functionality by emitting a FAILIFMISMATCH linker command into the object file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3b7deda7137e62810a810ce25b062927a9fc7c71 24-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [modules] If we hit a failure while loading a PCH/module, abort parsing instead of trying to continue in an invalid state.

Also don't let libclang create a PCH with such an error.

Fixes rdar://13953768

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
6af701f29be43e49a25ab098c79940ae4cbb69c7 13-May-2013 Alexey Bataev <a.bataev@hotmail.com> OpenMP threadprivate with qualified names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181683 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3190ca922d3743137e15fe0c525c04b177b9983b 08-May-2013 Reid Kleckner <reid@kleckner.net> Forward #pragma comment(lib/linker) through as flags metadata

Summary:
Most of this change is wiring the pragma all the way through from the
lexer, parser, and sema to codegen. I considered adding a Decl AST node
for this, but it seemed too heavyweight.

Mach-O already uses a metadata flag called "Linker Options" to do this
kind of auto-linking. This change follows that pattern.

LLVM knows how to forward the "Linker Options" metadata into the COFF
.drectve section where these flags belong. ELF support is not
implemented, but possible.

This is related to auto-linking, which is http://llvm.org/PR13016.

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D723

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7adf79a620cb7fbde0608e21727425930676b7db 06-May-2013 Reid Kleckner <reid@kleckner.net> Move PragmaCommentHandler to lib/Parse in preparation for calling Sema

Summary:
No functionality change. The existing tests for this pragma only verify
that we can preprocess it.

Reviewers: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D751

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181246 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
ec64244f5939fa81596fbeddad966cca4b4a4c51 13-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Parsing support for thread_local and _Thread_local. We give them the same
semantics as __thread for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c640058aa7f224a71ce3b1d2601d84e1b57f82d3 22-Mar-2013 Alexey Bataev <a.bataev@hotmail.com> OpenMP threadprivate directive parsing and semantic analysis

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
684aa73192d92850a926870be62a1787eb5b7ed9 22-Feb-2013 Michael Han <fragmentshaders@gmail.com> [Sema] Semantic analysis for empty-declaration and attribute-declaration.

Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain
to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these
attributes can be sema checked just as attributes attached to "normal" declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9e738cc9d4b4655c44dadeb22f3a314daf43b995 22-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,
to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting
levels for parentheses, brackets and braces.

Some code with heavy macro use exceeds the default limit of 256, but we don't
want to increase it generally to avoid stack overflow on stack-constrained
systems.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
6b3d3e54c003b03f16e235ad2ff49e95587bbf92 20-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Process and handle attributes on conditions and for loop variables. Process and
diagnose attributes on alias declarations, using directives, and attribute
declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175649 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3a2b7a18a4504f39e3ded0d2b5749c5c80b8b9b5 28-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Finish semantic analysis for [[carries_dependency]] attribute.

This required plumbing through a new flag to determine whether a ParmVarDecl is
actually a parameter of a function declaration (as opposed to a function
typedef etc, where the attribute is prohibited). Weirdly, this attribute (just
like [[noreturn]]) cannot be applied to a function type, just to a function
declaration (and its parameters).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
cd8ab51a44e80625d84126780b0d85a7732e25af 17-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 semantics for [[noreturn]] attribute. This required splitting
it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their
semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as
affecting the function type, whereas [[noreturn]] does not).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
cfa88f893915ceb8ae4ce2f17c46c24a4d67502f 12-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
898dd70865e42962fbeba346f7abcdc937664e2b 09-Jan-2013 Hal Finkel <hfinkel@anl.gov> Remove the unused Parser::ParseTranslationUnit function

Parser::ParseTranslationUnit is now dead because the loop over
ParseTopLevelDecl is in ParseAST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4e24f0f711e2c9fde79f19fa1c80deaab3f3b356 02-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few nearby 'C++0x' comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171372 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
80ad52f327b532bded5c5b0ee38779d841c6cd35 02-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> s/CPlusPlus0x/CPlusPlus11/g


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
20af49a7c5bdb6cca5f4d6586106ef1ce8579311 29-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Minor cleanup.

DS parameter has a default (null) value anyway, so there's no need for an
if/else here.
Patch by Nikola Smiljanić.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
1b257afbae854c6817f26b7d61c4fed8ff7aebad 11-Dec-2012 Douglas Gregor <dgregor@apple.com> Use @import rather than @__experimental_modules_import, since the
latter is rather a mess to type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> 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
/external/clang/lib/Parse/Parser.cpp
f88836d949e42452167d312e57a1425b3859d36b 27-Nov-2012 Nico Weber <nicolasweber@gmx.de> 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
/external/clang/lib/Parse/Parser.cpp
97f8461a2c553f68a258612d2322e4281c3f0915 17-Nov-2012 Andy Gibbs <andyg1001@hotmail.co.uk> 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
/external/clang/lib/Parse/Parser.cpp
b578aee665aad5ed1a46a26217c730fdfbfc8c2e 07-Nov-2012 David Blaikie <dblaikie@gmail.com> 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
/external/clang/lib/Parse/Parser.cpp
c7be10245e78bf38694b26f289880edefb9f16e9 06-Nov-2012 Douglas Gregor <dgregor@apple.com> 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
/external/clang/lib/Parse/Parser.cpp
25893e0930c1241c3fdafc6f1b8661443bb19692 31-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> 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
/external/clang/lib/Parse/Parser.cpp
2b970e9d70768802984f2cf1885e73643c17e0c2 27-Oct-2012 Chris Lattner <sabre@nondot.org> 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
/external/clang/lib/Parse/Parser.cpp
286d6236850ed3710822e659afdfdf08a315716b 27-Oct-2012 Mahesha S <mahesha.llvm@gmail.com> 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
/external/clang/lib/Parse/Parser.cpp
68de140b5d1df4c21cbf5ef1be2abcbfbc835cb5 27-Oct-2012 Mahesha S <mahesha.llvm@gmail.com> 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
/external/clang/lib/Parse/Parser.cpp
9595c7e2533c836537dc300e75d059c29feb7094 04-Oct-2012 Eli Friedman <eli.friedman@gmail.com> 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
/external/clang/lib/Parse/Parser.cpp
4b0824229b96d024a96f3c7dd75ab70652c05c5b 18-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> If a comma operator is followed by a token which unambiguously indicates the
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5354e77e60e82828c7c2361f5c688c2667ab59cc 24-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Now that ASTMultiPtr is nothing more than a array reference, make it a MutableArrayRef.

This required changing all get() calls to data() and using the simpler constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162501 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4e28d9e2ba9ce237549b45cfd4136ec6536d1325 24-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove ASTOwningVector, it doesn't own anything and provides no value over SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3fe198bf0d6118c7b080c17c3bb28d7c84e458b9 23-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Rip out remnants of move semantic emulation and smart pointers in Sema.

These were nops for quite a while and only lead to confusion. ASTMultiPtr
now behaves like a proper dumb array reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
70517ca5c07c4b41ff8662b94ee22047b0299f8c 23-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix a bunch of -Wdocumentation warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
0576681bac125be07f77f66b02a3dba2c3a24557 18-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers and
nested names as id-expressions, using the annot_primary_expr annotation, where
possible. This removes some redundant lookups, and also allows us to
typo-correct within tentative parsing, and to carry on disambiguating past an
identifier which we can determine will fail lookup as both a type and as a
non-type, allowing us to disambiguate more declarations (and thus offer
improved error recovery for such cases).

This also introduces to the parser the notion of a tentatively-declared name,
which is an identifier which we *might* have seen a declaration for in a
tentative parse (but only if we end up disambiguating the tokens as a
declaration). This is necessary to correctly disambiguate cases where a
variable is used within its own initializer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162159 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
e6b3fea007e25842d6523043b17f7dde8c4d0107 11-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> Removed an unused function I added a while back.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9e5df312551bc92f0a6c908288effef2e2ed0ee7 10-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C++: dalyed parsing of ctors with member
initializer list defined inside an objc class
implementation. wip


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161699 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
2eb362b50f34296c39d5ec3e5e1bd6a2c9a5877e 10-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C++: delayed parsing of member function with
function-try-block occuring in objc's implementation
block. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
be1d4ecb6885872f9d4e02d3afafdc9532eeb350 10-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C++: Delayed parsing of most common
member functions defined inside an objc class
implementation. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
eab9d6f9065b042d39fbaf9842c9d8cc968dd6d0 23-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add diagnostics for comma at end of enum and for extra semicolon at namespace
scope to -Wc++11-extensions. Move extra semicolon after member function
definition diagnostic out of -pedantic, since C++ allows a single semicolon
there. Keep it in -Wextra-semi, though, since it's still questionable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b67e7fc607671ef3df64de63c38545197e9992b2 22-Jul-2012 Francois Pichet <pichet2000@gmail.com> Allow the parser to recover gracefully if a typename is used to introduce a decltype type.
In Microsoft mode, we emit a warning instead of an error.

This fixes a couple of errors when parsing the MSVC 11 RC headers with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
69b5e952c56f95673064ad1815a240e0fb595865 13-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Move helper class into an anonymous namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
94f29f4bf5d6b49dd1b7fc16cfa1521adc0c71c0 09-Jul-2012 Jordan Rose <jordan_rose@apple.com> Better parser recovery in Objective-C containers.

Previously it was possible to get an infinite-loop-on-invalid with a namespace
decl within @interface. Since 'namespace' is normally a safe place to retry
top-level parsing, we just didn't consume the token.

This adds a flag that tracks whether we have temporarily left Objective-C
scope to parse a C-like declaration, and uses that to better recover from
parse problems by stopping at possible method declarations and at @end. To
fix the original problem, we do /not/ stop at 'namespace' when in an
Objective-C @interface or @protocol context (but still do in @implementation).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
8a10d9fcb5a207a519be95ff9281c3536f79cf03 06-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> Added a new memberfor Parser, to be used soon
for doing delayed parsing of c++ method defined in
objc class implementations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
39700f81c5b42e6be93be10275602915f872fc86 05-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c++ parsing. Turn off delayed parsing
of out-of-line c++ method definition which happens
to be inside an objc class implementation
until I can figure out how to do it. This is to fix
a broken project.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3b5f9dc024232fe3bde347f6b52155ff7f55a232 04-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> Obj-C++11 parser: fix broken parsing of c-function
defined in class implementations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
cda104171088d721f627420962fc940d69c313b4 04-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> Obj-C++11 parser: turn off buffering of
c-function defined in objc class
implementation for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
6c89eafc90f5c51a0bf185a993961170aee530c2 03-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: just as we have done for method definitions,
c-functions declared in implementation should have their
parsing delayed until the end so, they can access forward
declared private methods. // rdar://10387088


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159626 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
0963017dcbc32176c79a251c3ab23bc35ac784e5 28-Jun-2012 Douglas Gregor <dgregor@apple.com> Support the use of "=delete" and "=default" with delayed template
parsing. Fixes <rdar://problem/11700604>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
2edf0a2520313cde900799b1eb9bd11c9c776afe 23-Jun-2012 Sean Hunt <scshunt@csclub.uwaterloo.ca> Clean up a large number of C++11 attribute parse issues, including parsing
attributes in more places where we didn't and catching a lot more issues.

This implements nearly every aspect of C++11 attribute parsing, except for:
- Attributes are permitted on explicit instantiations inside the declarator
(but not preceding the decl-spec)
- Attributes are permitted on friend declarations of functions.
- Multiple instances of the same attribute in an attribute-list (e.g.
[[noreturn, noreturn]], not [[noreturn]] [[noreturn]] which is conforming)
are allowed.
The first two are marked as expected-FIXME in the test file and the latter
is probably a defect and is currently untested.

Thanks to Richard Smith for providing the lion's share of the testcases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
056e2c30050a94141150ba561268d90b4d18e378 20-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Unbreak GCC build: GCC doesn't like clang::Parser::CommentHandler and class clang::CommentHandler to have same name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
aa0cd85838f2a024e589ea4e8c2094130065af21 20-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Structured comment parsing, first step.

* Retain comments in the AST
* Serialize/deserialize comments
* Find comments attached to a certain Decl
* Expose raw comment text and SourceRange via libclang


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c86c40b912e53fb11ff8f745ed616035b8b7259c 06-Jun-2012 Douglas Gregor <dgregor@apple.com> Whenever we have a BalancedDelimiterTracker, we have a 'nested' scope
where '>' is going to behave as an operator (and not as a '>' closing
a template argument list).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
facde171ae4b8926622a1bffa833732a06f1875b 06-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove unused private member variables found by clang's new -Wunused-private-field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d73ef135ba029db59c0b5649e6117845d9e39600 06-Jun-2012 Jordan Rose <jordan_rose@apple.com> Add pedantic warning -Wempty-translation-unit (C11 6.9p1).

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>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4b0e6f1da341510c1ad83eaf4c836f3134d0156a 16-May-2012 Richard Trieu <rtrieu@google.com> Move the warnings for extra semi-colons under -Wextra-semi. Also, added
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
23756776eadfd8bbddf5d120d4c191ef9e50d209 15-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Recover properly from a redundant 'typename' before a non-nested name. This is
permitted as a Microsoft extension. Patch by William Wilson! (Plus some minor
tweaking by me.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
83a22ecbf52c06b4ee364f3fadcdb0abaf2dabf6 09-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Recover properly if a class member declaration starts with a scope specifier
or template-id which can't be parsed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
fb5825dca4e95fee463fdeaddb8b729294fb4d10 02-May-2012 Douglas Gregor <dgregor@apple.com> Replace a ConsumeAnyToken() call with ConsumeToken() when we know
we're looking at a normal token. Tiny positive impact -fsyntax-only
time for <rdar://problem/11004361>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155988 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
8bb21d32e9ccc9d9c221506dff26acafa8724cca 28-Apr-2012 Chris Lattner <sabre@nondot.org> switch some uses of ExpectAndConsume(tok::semi to use ExpectAndConsumeSemi. This allows
us to improve this diagnostic (telling us to insert another ")":

t.c:2:19: error: expected ';' at end of declaration
int x = 4+(5-12));
^
;
to:
t.c:2:19: error: extraneous ')' before ';'
int x = 4+(5-12));
^

...telling us to remove the ")". This is PR12595. There are more uses of ExpectAndConsumeSemi
that could be switched over, but I don't hit them on a daily basis :)





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
26d6023cb0d343bf8fc8836f97d39709bbd4afa0 26-Apr-2012 Chad Rosier <mcrosier@apple.com> Typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
13bb701f2f876356400a34b0917a417c66b5d70d 14-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> Parser: Don't manage TemplateAnnotationIds in a delayed cleanup pool.

Instead, make it the allocation function's responsibility to add them
to a list and clear it when a top-level decl is finished.

This plugs leakage of TemplateAnnotationIds. DelayedCleanupPool is
ugly and unused, remove it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
6a91d385618ea4d28236c496f540a26877c95525 12-Apr-2012 Erik Verbruggen <erikjv@me.com> Added a flag to the parser to skip method bodies.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
eb52f86a62db523e3c993686b3ed92c55d59d53c 09-Apr-2012 David Blaikie <dblaikie@gmail.com> Fix bugs found by -Wconstant-conversion improvements currently under review.

Specifically, using a an integer outside [0, 1] as a boolean constant seems to
be an easy mistake to make with things like "x == a || b" where the author
intended "x == a || x == b".

The bug caused by calling SkipUntil with three token kinds was also identified
by a VC diagnostic & reported by Francois Pichet as review feedback for my
commit r154163. I've included test cases to verify the error recovery that was
broken/poorly implemented due to this bug.

The other fix (lib/Sema/SemaExpr.cpp) seems like that code was never actually
reached in any of Clang's tests & is related to Objective C features I'm not
familiar with, so I've not been able to construct a test case for it. Perhaps
someone else can.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154325 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b031eab1c07fa2c5bd74c7e92f7c938bf3304729 07-Apr-2012 David Blaikie <dblaikie@gmail.com> Remove "parse error" in favor of more descriptive diagnostics.

In a few cases clang emitted a rather content-free diagnostic: 'parse error'.
This change replaces two actual cases (template parameter parsing and K&R
parameter declaration parsing) with more specific diagnostics and removes a
third dead case of this in the BalancedDelimiterTracker (the ctor already
checked the invariant necessary to ensure that the diag::parse_error was never
actually used).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
e55329d6834647ba0e06f8a319e5d84c77310035 16-Mar-2012 Axel Naumann <Axel.Naumann@cern.ch> From Vassil Vassilev:
Enable incremental parsing by the Preprocessor,
where more code can be provided after an EOF.
It mainly prevents the tearing down of the topmost lexer.
To be used like this:
PP.enableIncrementalProcessing();
while (getMoreSource()) {
while (Parser.ParseTopLevelDecl(ADecl)) {...}
}
PP.enableIncrementalProcessing(false);


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d78ef5b941ce2937228b010e8443f92025f9d683 08-Mar-2012 Douglas Gregor <dgregor@apple.com> Streamline BalancedDelimiterTracker, by eliminating the duplicate
paren/brace/bracket tracking (the Consume* functions already did it),
removing the use of ConsumeAnyToken(), and moving the hot paths inline
with the error paths out-of-line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
99831e4677a7e2e051af636221694d60ba31fcdb 06-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> User-defined literals: reject string and character UDLs in all places where the
grammar requires a string-literal and not a user-defined-string-literal. The
two constructs are still represented by the same TokenKind, in order to prevent
a combinatorial explosion of different kinds of token. A flag on Token tracks
whether a ud-suffix is present, in order to prevent clients from needing to look
at the token's spelling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
32ad2ee2618745ce3da51c2ae066ed5f21157c07 01-Mar-2012 Ted Kremenek <kremenek@apple.com> Change @import to @__experimental_modules_import. We are not ready to commit to a particular syntax for modules,
and don't have time to push it forward in the near future.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
aa5ab26ed93382b812147f532dcbf4afb5494040 24-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Handle "#pragma GCC visibility" in a few more places. Switch over "#pragma pack" to use the same handling that gcc does. Fixes <rdar://problem/10871094> and <rdar://problem/10893316>.

(Hopefully, common usage of these pragmas isn't irregular enough to break our current handling. Doug has ideas for a more crazy approach if necessary.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151307 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5f3c163b7b19a0c7e02509a0984ee1256bca890d 18-Feb-2012 David Chisnall <csdavec@swan.ac.uk> Implement #pragma redefine_extname.

This fixes PR5172 and allows clang to compile C++ programs on Solaris using the system headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c24a2335677f3d1bd2cab1019ac445d650f52123 16-Feb-2012 DeLesley Hutchins <delesley@google.com> Allow thread safety attributes on function definitions.
For compatibility with gcc, clang will now parse gcc attributes on
function definitions, but issue a warning if the attribute is not a
thread safety attribute. Warning controlled by -Wgcc-compat.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
849639d8b548519cc5a00c0c9253f0c0d525060d 07-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make parsing of objc @implementations more robust.

Parsing of @implementations was based on modifying global state from
the parser; the logic for late parsing of methods was spread in multiple places
making it difficult to have a robust error recovery.

-it was difficult to ensure that we don't neglect parsing the lexed methods.
-it was difficult to setup the original objc container context for parsing the lexed methods
after completing ParseObjCAtImplementationDeclaration and returning to top level context.

Enhance parsing of @implementations by centralizing it in Parser::ParseObjCAtImplementationDeclaration().
ParseObjCAtImplementationDeclaration now returns only after an @implementation is fully parsed;
all the data and logic for late parsing of methods is now in one place.

This allows us to provide code-completion for late parsed methods with mis-matched braces.
rdar://10775381

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
66581d41527628d4b37f7b05c288f77be7415d7d 06-Feb-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Added source location for the template keyword in DependentTemplateSpecializationTypeLoc nodes (DTSTLoc).

The new info is propagated to TSTLoc on template instantiation, getting rid of 3 FIXMEs in TreeTransform.h and another one Parser.cpp.

Simplified code in TypeSpecLocFiller visitor methods for DTSTLoc and DependentNameTypeLoc by removing what now seems to be dead code (adding corresponding assertions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c5b2e58840748145d1706c1d1481369d1863fabf 29-Jan-2012 Douglas Gregor <dgregor@apple.com> Implement code completion support for module import declarations, e.g.,

@import <complete with module names here>

or

@import std.<complete with submodule names here>

Addresses <rdar://problem/10710117>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
e4b92761b43ced611c417ae478568610f1ad7b1e 27-Jan-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Added source location for the template keyword in AST template-id expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
fad03b75e0297546c5d12ec420b5b79d5b7baa2a 27-Jan-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Avoid redundant NNS qualification in constructor/destructor names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
426fc94ed3bce15b55c43692537e3833388f0352 26-Jan-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix our handling of #pragma GCC visibility.
Now the lexer just produces a token and the parser is the one responsible for
activating it.
This fixes problem like the one pr11797 where the lexer and the parser were not
in sync. This also let us be more strict on where in the file we accept
these pragmas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
fcaf27e185695bdf755e202aeba9632e0a8ef3c6 19-Jan-2012 Richard Trieu <rtrieu@google.com> Extend the error of invalid token after declarations to include fixits for
!=, %=, ^=, &=, *=, -=, |=, /=, <<=, <=, >=, and >>= to =.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d6c7c67313634b317a0d63c32be0511a121bb33d 18-Jan-2012 Richard Trieu <rtrieu@google.com> Change the error when a '+=' follows a declaration to suggest a fixit to '=' instead of just suggesting a ';'.

Old error:
plusequaldeclare1.cc:3:8: error: expected ';' at end of declaration
int x += 6;
^
;

New error:
plusequaldeclare1.cc:3:9: error: invalid '+=' at end of declaration; did you
mean '='?
int x += 6;
^~
=



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7530c034c0c71a64c5a9173206d9742ae847af8b 17-Jan-2012 David Blaikie <dblaikie@gmail.com> Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
883692ebd421c40b44e2c2665e5f54dade5621bc 17-Jan-2012 Nico Weber <nicolasweber@gmx.de> Improve diagnostics for dangling '}'.

Fixes PR6484. Patch from Jason Switzer!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7984de35644701c0d94336da7f2215d4c26d9f5b 13-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:

- If the declarator is at the start of a line, and the previous line contained
another declarator and ended with a comma, then that comma was probably a
typo for a semicolon:

int n = 0, m = 1, l = 2, // k = 5;
myImportantFunctionCall(); // oops!

- If removing the parentheses would correctly initialize the object, then
produce a note suggesting that fix.

- Otherwise, if there is a simple initializer we can suggest which performs
value-initialization, then provide a note suggesting a correction to that
initializer.

Sema::Declarator now tracks the location of the comma prior to the declarator in
the declaration, if there is one, to facilitate providing the note. The code to
determine an appropriate initializer from the -Wuninitialized warning has been
factored out to allow use in both that and -Wvexing-parse.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c13a34b690d2dc2a03c2fea75a0a1438636c19ce 03-Jan-2012 Douglas Gregor <dgregor@apple.com> Eliminate the uglified keyword __import_module__ for importing
modules. This leaves us without an explicit syntax for importing
modules in C/C++, because such a syntax needs to be discussed
first. In Objective-C/Objective-C++, the @import syntax is used to
import modules.

Note that, under -fmodules, C/C++ programs can import modules via the
#include mechanism when a module map is in place for that header. This
allows us to work with modules in C/C++ without committing to a syntax.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5948ae1021122164b22f74353bb7fe325a64f616 03-Jan-2012 Douglas Gregor <dgregor@apple.com> Introduce a non-uglified syntax for module imports in Objective-C:

@import identifier [. identifier]* ;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
bd9482d859a74bf2c45ef8b8aedec61c0e1c8374 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Eliminate ObjCForwardProtocolDecl, which is redundant now that
ObjCProtocolDecl modules forward declarations properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147415 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d7c56e1114bfe7d461786903bb720d2c6efc05a1 29-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Change the diagnostics which said 'accepted as an extension' to instead say
'is an extension'. The former is inappropriate and confusing when building with
-Werror/-pedantic-errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9241057266d3460392cbb7fec6ec942d3330ece3 23-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Pass context and access to Parser::ParseExplicitInstantiation() for
good parser error recovery and for not crashing.

We still have a accepts-invalid-code bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
0db9f4dad563a335641f5b9d4a42504d638b6c85 17-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> In Parser::SkipUntil do not stop at '@' unconditionally.

Stopping at '@' was originally intended to avoid skipping an '@' at the @interface context
when doing parser recovery, but we should not stop at all '@' tokens because they may be part
of expressions (e.g. in @"string", @selector(), etc.), so in most cases we will want to skip them.

This commit caused 'test/Parser/method-def-in-class.m' to fail for the cases where we tried to
recover from unmatched angle bracket but IMO it is not a big deal to not have good recovery
from such broken code and the way we did recovery would not always work anyway (e.g. if there was '@'
in an expression).

The case that rdar://7029784 is about still passes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
e1fca502e7f1349e9b4520a4ca9a02413bcf2b14 08-Dec-2011 Francois Pichet <pichet2000@gmail.com> Remove unused parameter from the LateParsedTemplatedFunction constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
42d6d0c91ab089cb252ab2f91c16d4557f458a2c 04-Dec-2011 David Blaikie <dblaikie@gmail.com> Support decltype in nested-name-specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7f422287a2ee7e515beb715f1f8915e9331469ee 02-Dec-2011 Ted Kremenek <kremenek@apple.com> Diagnose use of wide string literal in 'asm' instead of crashing. Fixes <rdar://problem/10465079>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3d3589db579f7695667b913c5043dd264ebe546f 30-Nov-2011 Douglas Gregor <dgregor@apple.com> Switch the module-loading interfaces and parser from a simple
top-level module name to a module path (e.g., std.vector). We're still
missing a number of pieces for this actually to do something.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
2fea2242fe7e7c37df1e96316616febeaf4e29eb 29-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix leaking of LexedMethod objects created for caching objc method definitions tokens
for late parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
45fa560c72441069d9e4eb1e66efd87349caa552 07-Nov-2011 Douglas Gregor <dgregor@apple.com> When we notice that a member function is defined with "= delete" or "=
default", make a note of which is used when creating the
initial declaration. Previously, we would wait until later to handle
default/delete as a definition, but this is too late: when adding the
declaration, we already treated the declaration as "user-provided"
when in fact it was merely "user-declared".

Fixes PR10861 and PR10442, along with a bunch of FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
efaa93aaa2653f4eb40e6a22e504a448da94aaf8 07-Nov-2011 Douglas Gregor <dgregor@apple.com> Tighten up the conditions under which we consider ourselves to be
entering the context of a nested-name-specifier. Fixes
<rdar://problem/10397846>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
65019acfc46ffb191fac4e781ac0c4b8d0c8434e 25-Oct-2011 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in the name that guards a
Microsoft __if_exists/__if_not_exists statement. Also note that we
weren't traversing DeclarationNameInfo *at all* within the
RecursiveASTVisitor, which would be rather fatal for variadic
templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3896fc5d4daaf003e451e797e37de57dd8cf9cd5 25-Oct-2011 Douglas Gregor <dgregor@apple.com> Rework Microsoft __if_exists/__if_not_exists parsing and semantic
analysis to separate dependent names from non-dependent names. For
dependent names, we'll behave differently from Visual C++:

- For __if_exists/__if_not_exists at class scope, we'll just warn
and then ignore them.
- For __if_exists/__if_not_exists in statements, we'll treat the
inner statement as a compound statement, which we only instantiate
in templates where the dependent name (after instantiation)
exists. This behavior is different from VC++, but it's as close as
we can get without encroaching ridiculousness.

The latter part (dependent statements) is not yet implemented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b57791e5b40afa6691063c83d0e95c416fb19fde 21-Oct-2011 Douglas Gregor <dgregor@apple.com> Treat the Microsoft/Borland keyword "__except" as a context-sensitive
keyword, because both libstdc++ and libc++ use "__except" as an
identifier. Fixes <rdar://problem/10322555>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9324583ad2afd09db8c9967cd05c4fa44bac9555 20-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> 'extern template' is a C++11 feature. Add an Extension for C++98 (this matches
gcc's behaviour), and a -Wc++98-compat-pedantic warning for C++11.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7fe6208c3fa91f835813bb78236ef5c2bbf81053 15-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement -Wc++98-compat warnings for the parser.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4a8dfb511e8f84b2e38b7a86d8ddf05ac1e1a41b 12-Oct-2011 Douglas Gregor <dgregor@apple.com> Introduce BalancedDelimiterTracker, to better track open/close
delimiter pairs and detect when we exceed the implementation limit for
nesting depth, from Aaron Ballman!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
fac9467d1676dc05761e12e41e13e01a3a3da52b 11-Oct-2011 Kaelyn Uhrain <rikka@google.com> Add typo correction for type names.

The main motivation was to do typo correction in C++ "new" statements,
though picking it up in other places where type names are expected was
pretty much a freebie.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
2c712f50cd56eaf3662989b556e9c6b1e8fcd11a 11-Oct-2011 Kaelyn Uhrain <rikka@google.com> Move some bool flags out of function parameter lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
2246368b1061ef48e00bfc95d519d4393dff9926 27-Sep-2011 Bill Wendling <isanbard@gmail.com> Revert r140589. It was causing failures during llvm compilation:

llvm[1]: Compiling CommandLine.cpp for Debug+Asserts build
if /Users/void/llvm/llvm-opt.obj/Release+Asserts/bin/clang++ -I/Users/void/llvm/llvm.obj/include -I/Users/void/llvm/llvm.obj/lib/Support -I/Users/void/llvm/llvm.src/include -I/Users/void/llvm/llvm.src/lib/Support -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -g -fno-exceptions -fno-common -Woverloaded-virtual -Wcast-qual -m64 -Wall -W -Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp" -MT "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.o" -MT "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d" /Users/void/llvm/llvm.src/lib/Support/CommandLine.cpp -o /Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.o ; \
then /bin/mv -f "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp" "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d"; else /bin/rm "/Users/void/llvm/llvm.obj/lib/Support/Debug+Asserts/CommandLine.d.tmp"; exit 1; fi
In file included from /Users/void/llvm/llvm.src/lib/Support/CommandLine.cpp:25:
/Users/void/llvm/llvm.src/include/llvm/Support/system_error.h:690:14: error: unknown type name 'make_error_condition'; did you mean 'error_condition'?
{*this = make_error_condition(_e);}
^~~~~~~~~~~~~~~~~~~~
error_condition
...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
93476ddd9ce490f9c08d78b640efad812cb019d1 27-Sep-2011 Kaelyn Uhrain <rikka@google.com> Add typo correction for the type name in C++ "new" statements

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
62ec1f2fd7368542bb926c04797fb07023547694 17-Sep-2011 Francois Pichet <pichet2000@gmail.com> Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag.

Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
e97179c675b341927807c718be215c8d1aab8acb 08-Sep-2011 Douglas Gregor <dgregor@apple.com> Implement the Objective-C 'instancetype' type, which is an alias of
'id' that can be used (only!) via a contextual keyword as the result
type of an Objective-C message send. 'instancetype' then gives the
method a related result type, which we have already been inferring for
a variety of methods (new, alloc, init, self, retain). Addresses
<rdar://problem/9267640>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7d100872341f233c81e1d7b72b40457e62c36862 04-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support code-completion for C++ inline methods and ObjC buffering methods.

Previously we would cut off the source file buffer at the code-completion
point; this impeded code-completion inside C++ inline methods and,
recently, with buffering ObjC methods.

Have the code-completion inserted into the source buffer so that it can
be buffered along with a method body. When we actually hit the code-completion
point the cut-off lexing or parsing.

Fixes rdar://10056932&8319466

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
65030af6526748ce11534e92f0ccefc44091ba13 31-Aug-2011 Douglas Gregor <dgregor@apple.com> Switch __import__ over to __import_module__, so we don't conflict with
existing practice with Python extension modules. Not that Python
extension modules should be using a double-underscored identifier
anyway, but...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
95ed7784a335aca53b0c6e952cf31a4cfb633360 27-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: Treat top-level objective-c declarations
, such as list of forward @class decls, in a DeclGroup
node. Deal with its consequence throught clang. This
is in preparation for more Sema work ahead. // rdar://8843851.
Feel free to reverse if it breaks something important
and I am unavailable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
6aa52ec6b969faabf3764baf79d89810b8249a7e 27-Aug-2011 Douglas Gregor <dgregor@apple.com> Introduce support for a simple module import declaration, which
loads the named module. The syntax itself is intentionally hideous and
will be replaced at some later point with something more
palatable. For now, we're focusing on the semantics:
- Module imports are handled first by the preprocessor (to get macro
definitions) and then the same tokens are also handled by the parser
(to get declarations). If both happen (as in normal compilation),
the second one is redundant, because we currently have no way to
hide macros or declarations when loading a module. Chris gets credit
for this mad-but-workable scheme.
- The Preprocessor now holds on to a reference to a module loader,
which is responsible for loading named modules. CompilerInstance is
the only important module loader: it now knows how to create and
wire up an AST reader on demand to actually perform the module load.
- We search for modules in the include path, using the module name
with the suffix ".pcm" (precompiled module) for the file name. This
is a temporary hack; we hope to improve the situation in the
future.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
f09530f88ece49993f1b72271b0417574e897956 25-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> Reverse r138567 until a buildbot failure is investigated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d8e987bee9d39f9131e9be319483265fd894c108 25-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> objc -arse: Use DeclGroup for forward class declarations;
as in @class foo, bar. More cleanup to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9735c5e60027b26a809df19677ff16a4d13f1321 22-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> objc - Simplify switing objc decl context by using
a context switching object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a28948f34817476d02412fa204cae038e228c827 22-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> Restore patch I reversed in r138040. Known buildbot
failures are resolved.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
e6f07f538fd0eddd6c087fcc01d4e4ff19129c71 19-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> Revers r138040. Need to look at a few buildbot failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3dbf2f5f00cfc8b25318c119c0d39f4a49d15ebe 19-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: Bring objective-c handling of decl context
to modernity. Instead of passing down individual
context objects from parser to sema, establish decl
context in parser and have sema access current context
as needed. I still need to take of Doug's comment for
minor cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5cee1195584fa8672253139c86e922daeda69b9e 27-Jul-2011 Douglas Gregor <dgregor@apple.com> Add support for C++0x unicode string and character literals, from Craig Topper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c261c76812a256c98cf3309c92f77e7ce1e8848b 05-Jul-2011 Douglas Gregor <dgregor@apple.com> Some documentation fixes for the parser, from John Freeman

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
25a767651d14db87aa03dd5fe3e011d877dd4100 22-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce DelayedCleanupPool useful for simplifying clean-up of certain resources that, while their
lifetime is well-known and restricted, cleaning them up manually is easy to miss and cause a leak.

Use it to plug the leaking of TemplateIdAnnotation objects. rdar://9634138.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7a614d8380297fcd2bc23986241905d97222948c 11-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement support for C++11 in-class initialization of non-static data members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
563a645de82231a55e221fe655b7188bf8369662 25-May-2011 Francois Pichet <pichet2000@gmail.com> Add support for Microsoft __if_exists, __if_not_exists extension at class scope.

Example:

typedef int TYPE;
class C {
__if_exists(TYPE) {
TYPE a;
}
__if_not_exists(TYPE) {
this will never be parsed.
}
};


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132052 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
cd10dec673680fd18a2e5a27646173780c059d32 24-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement explicit specialization of explicitly-defaulted constructors.
The general out-of-line case (including explicit instantiation mostly
works except that the definition is being lost somewhere between the AST
and CodeGen, so the definition is never emitted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131933 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
e4246a633b13197634225971b25df0cbdcec0c5d 12-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Properly parse the 'default' and 'delete' keywords.

They are actually grammatically considered definitions and parsed
accordingly.

This fixes the outstanding bugs regarding defaulting functions after
their declarations.

We now really nicely diagnose the following construct (try it!)

int foo() = delete, bar;

Still todo: Defaulted functions other than default constructors
Test cases (including for the above construct)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
f986038beed360c031de8654cfba43a5d3184605 07-May-2011 Francois Pichet <pichet2000@gmail.com> Add support for _if_exists and __if_not_exists at namespace/global scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
28bbe4b8acc338476fe0825769b41fb32b423c72 28-Apr-2011 John Wiegley <johnw@boostpro.com> Parsing/AST support for Structured Exception Handling

Patch authored by Sohail Somani.

Provide parsing and AST support for Windows structured exception handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3b887354b1b667c97d070ddc67b5354353c4c07b 27-Apr-2011 Douglas Gregor <dgregor@apple.com> Extend Sema::ClassifyName() to support C++, ironing out a few issues
in the classification of template names and using declarations. We now
properly typo-correct the leading identifiers in statements to types,
templates, values, etc. As an added bonus, this reduces the number of
lookups required for disambiguation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130288 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
62c9258f4a71569a66d805fc7776526a2c76b34e 25-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Recognize gcc's ms_struct pragma (and ignore for now).
This is wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a5d318ad4ad3a110b3abb34f765e69b76f7c0bcd 24-Apr-2011 Francois Pichet <pichet2000@gmail.com> Downgrade unnecessary "typename" from error to warning in Microsoft mode.
This fixes 1 error when parsing MSVC 2008 headers with clang.

Must "return true;" even if it is a warning because the rest of the code path assumes that SS is set to something. The parser will get back on its feet and continue parsing the rest of the declaration correctly so it is not a problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d4a0caf78e7c18e7aca65fbfd799a6c024ff51fb 23-Apr-2011 Francois Pichet <pichet2000@gmail.com> Correctly emit a diagnostic for multiple templated function definitions in -flate-template-parsing mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
8387e2a41eef6fa17fb140a18c29b6eee9dd2b8a 23-Apr-2011 Francois Pichet <pichet2000@gmail.com> Add -fdelayed-template-parsing option. Using this option all templated function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.

Using this flag is necessary for compatibility with Microsoft template code.
This also provides some parsing speed improvement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c6eb44b321c543c5bcf28727228a0cceced57e2e 15-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> C1X: implement static asserts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4147d307086cf024a40a080e2bf379e9725f6f41 27-Mar-2011 Francois Pichet <pichet2000@gmail.com> Improve recovery (error + fix-it) when parsing type dependent template name without the "template" keyword.

For example:
typename C1<T>:: /*template*/ Iterator<0> pos;

Also the error is downgraded to an ExtWarn in Microsoft mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b53e417ba487f4193ef3b0485b420e0fdae643a2 26-Mar-2011 Douglas Gregor <dgregor@apple.com> Extend the new 'availability' attribute with support for an
'unavailable' argument, which specifies that the declaration to which
the attribute appertains is unavailable on that platform.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
0b7e678a11ece4288dc01aebb5b17e5eef8f8d2d 24-Mar-2011 John McCall <rjmccall@apple.com> Insomniac refactoring: change how the parser allocates attributes so that
AttributeLists do not accumulate over the lifetime of parsing, but are
instead reused. Also make the arguments array not require a separate
allocation, and make availability attributes store their stuff in
augmented memory, too.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
0a0d2b179085a52c10402feebeb6db8b4d96a140 23-Mar-2011 Douglas Gregor <dgregor@apple.com> Implement a new 'availability' attribute, that allows one to specify
which versions of an OS provide a certain facility. For example,

void foo()
__attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));

says that the function "foo" was introduced in 10.2, deprecated in
10.4, and completely obsoleted in 10.6. This attribute ties in with
the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that
we want to deploy back to Mac OS X 10.1). There are several concrete
behaviors that this attribute enables, as illustrated with the
function foo() above:

- If we choose a deployment target >= Mac OS X 10.4, uses of "foo"
will result in a deprecation warning, as if we had placed
attribute((deprecated)) on it (but with a better diagnostic)
- If we choose a deployment target >= Mac OS X 10.6, uses of "foo"
will result in an "unavailable" warning (in C)/error (in C++), as
if we had placed attribute((unavailable)) on it
- If we choose a deployment target prior to 10.2, foo() is
weak-imported (if it is a kind of entity that can be weak
imported), as if we had placed the weak_import attribute on it.

Naturally, there can be multiple availability attributes on a
declaration, for different platforms; only the current platform
matters when checking availability attributes.

The only platforms this attribute currently works for are "ios" and
"macosx", since we already have -mxxxx-version-min flags for them and we
have experience there with macro tricks translating down to the
deprecated/unavailable/weak_import attributes. The end goal is to open
this up to other platforms, and even extension to other "platforms"
that are really libraries (say, through a #pragma clang
define_system), but that hasn't yet been designed and we may want to
shake out more issues with this narrower problem first.

Addresses <rdar://problem/6690412>.

As a drive-by bug-fix, if an entity is both deprecated and
unavailable, we only emit the "unavailable" diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
614f96a7cf94805c2d336639300b62dc2f54e9e0 22-Mar-2011 Ted Kremenek <kremenek@apple.com> Migrate 'PrettySTackTraceParserEntry' object out of Parser, and have it constructed within ParseAST. This avoids double crashes
during crash recovery.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c9977d09a2de7f7d2245973413d4caf86c736640 16-Mar-2011 Douglas Gregor <dgregor@apple.com> Make sure that we always pop a function's scope *before* we call
ActOnFinishFunctionBody/ActOnBlockStmtExpr. This way, we ensure that
we diagnose undefined labels before the jump-scope checker gets run,
since the jump-scope checker requires (as its invariant) that all of
the GotoStmts be wired up correctly.

Fixes PR9495.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
21e006e51a7f9889f55f5bc7b3ca8b50d17571ec 03-Mar-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed source range for FileScopeAsmDecl. Others source range fixes will follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
059101f922de6eb765601459925f4c8914420b23 02-Mar-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source-location information into dependent
template specialization types. This also required some parser tweaks,
since we were losing track of the nested-name-specifier's source
location information in several places in the parser. Other notable
changes this required:

- Sema::ActOnTagTemplateIdType now type-checks and forms the
appropriate type nodes (+ source-location information) for an
elaborated-type-specifier ending in a template-id. Previously, we
used a combination of ActOnTemplateIdType and
ActOnTagTemplateIdType that resulted in an ElaboratedType wrapped
around a DependentTemplateSpecializationType, which duplicated the
keyword ("class", "struct", etc.) and nested-name-specifier
storage.

- Sema::ActOnTemplateIdType now gets a nested-name-specifier, which
it places into the returned type-source location information.

- Sema::ActOnDependentTag now creates types with source-location
information.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9e876876afc13aa671cc11a17c19907c599b9ab9 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Reinstate the introduction of source-location information for
nested-name-speciciers within elaborated type names, e.g.,

enum clang::NestedNameSpecifier::SpecifierKind

Fixes in this iteration include:

(1) Compute the type-source range properly for a dependent template
specialization type that starts with "template template-id ::", as
in a member access expression

dep->template f<T>::f()

This is a latent bug I triggered with this change (because now we're
checking the computed source ranges for dependent template
specialization types). But the real problem was...

(2) Make sure to set the qualifier range on a dependent template
specialization type appropriately. This will go away once we push
nested-name-specifier locations into dependent template
specialization types, but it was the source of the
valgrind errors on the buildbots.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
2786864406af0f3ec65b300675c6f3c809c22fd7 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Revert r126748, my second attempt at nested-name-specifier source
location information for elaborated types. *sigh*


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
be38c5f5d8fa7c43c52fafddee054b8fe8c2b964 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Reinstate r126737, extending the generation of type-source location
information for qualifier type names throughout the parser to address
several problems.

The commit message from r126737:

Push nested-name-specifier source location information into elaborated
name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind".

Aside from the normal changes, this also required some tweaks to the
parser. Essentially, when we're looking at a type name (via
getTypeName()) specifically for the purpose of creating an annotation
token, we pass down the flag that asks for full type-source location
information to be stored within the returned type. That way, we retain
source-location information involving nested-name-specifiers rather
than trying to reconstruct that information later, long after it's
been lost in the parser.

With this change, test/Index/recursive-cxx-member-calls.cpp is showing
much improved results again, since that code has lots of
nested-name-specifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126748 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
44cd9f9d686dfdb9ad16113c41c2dca1da35a646 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Revert r126737, the most recent nested-name-specifier location change, for buildbot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126746 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
239cbb023c8da689e7722f7146914eed9755e368 01-Mar-2011 Douglas Gregor <dgregor@apple.com> Push nested-name-specifier source location information into elaborated
name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind".

Aside from the normal changes, this also required some tweaks to the
parser. Essentially, when we're looking at a type name (via
getTypeName()) specifically for the purpose of creating an annotation
token, we pass down the flag that asks for full type-source location
information to be stored within the returned type. That way, we retain
source-location information involving nested-name-specifiers rather
than trying to reconstruct that information later, long after it's
been lost in the parser.

With this change, test/Index/recursive-cxx-member-calls.cpp is showing
much improved results again, since that code has lots of
nested-name-specifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
aa2187de137e5b809dcbbe14f3b61ae907a3d8aa 28-Feb-2011 Douglas Gregor <dgregor@apple.com> When we encounter a dependent template name within a
nested-name-specifier, e.g.,

T::template apply<U>::

represent the dependent template name specialization as a
DependentTemplateSpecializationType, rather than a
TemplateSpecializationType with a dependent TemplateName.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a02411e4d58b1730bea2a990822858ecc31e8eb1 27-Feb-2011 Douglas Gregor <dgregor@apple.com> Eliminate a silly little Parse/Sema dance when parsing typename
specifiers such as

typename T::template apply<U>

Previously, we would turn T::template apply<U> into a
TemplateSpecializationType. Then, we'd reprocess that
TemplateSpecializationType and turn it into either a
TemplateSpecializationType wrapped in an ElaboratedType (when we could
resolve "apply" to a template declaration) or a
DependentTemplateSpecializationType. We now produce the same ASTs but
without generating the intermediate TemplateSpecializationType.

The end goal here is to avoid generating TemplateSpecializationTypes
with dependent template-names, ever. We're not there yet.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c34348a7ef1a6b3f92a644a227953800cd1f9947 24-Feb-2011 Douglas Gregor <dgregor@apple.com> Retain complete source-location information for C++
nested-name-specifiers throughout the parser, and provide a new class
(NestedNameSpecifierLoc) that contains a nested-name-specifier along
with its type-source information.

Right now, this information is completely useless, because we don't
actually store the source-location information anywhere in the
AST. Call this Step 1/N.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
55edca9d7d6a50cbda6f036b05a0cb8d42f5a010 23-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Better parser recovery when method is
errornously defined inside an objc class.
// rdar://7029784


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
f315fa81eef1977b3457fd7a7d4639e060fe7278 14-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: add support for __kernel, kernel keywords and EXTENSION,
FP_CONTRACT pragmas. Patch originally by ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
321b8179afaf803dcc56b2a19f7b0891a03c92c8 14-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Move support for "#pragma STDC FP_CONTRACT" to Parser; add Sema actions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125474 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
bf36e25224b959595af84337339103ebc542ff8c 09-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Parse: add support for parsing CUDA kernel calls

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
1e52dfc648ce0b25ef57ae29ef1b4337d80011ef 08-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Support for objextive-c++ use of property-dot syntax as receiver
in liu of a class method getter.
// rdar://8962253


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
758afbcc86ef15f8d433f5f87db1495e50effeb3 04-Feb-2011 Douglas Gregor <dgregor@apple.com> Fix a crash-on-invalid where we were trying to parse C++ constructs in
C, then hitting an assertion because C code shouldn't try to parse
optional nested-name-specifiers. Fixes PR9137.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124860 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7eeb4ec11043d4860361348f2b19299d957d47a9 20-Jan-2011 Anders Carlsson <andersca@mac.com> Lazily initialize the 'final' and 'override' contextual keywords as suggested by Doug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b918d0f5d8f147e1e26c34e6cf42a79af2d2ec41 17-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Convert "#pragma unused(...)" into tokens for the parser.
This allows us to cache a "#pragma unused" that occurs inside an inline C++ member function.
Fixes rdar://8829590&8770988.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
1f3b6fdabbb10779a473d6315154d7325ce20aea 17-Jan-2011 Anders Carlsson <andersca@mac.com> Begin work on supporting "N3206: Override control: Eliminating Attributes", from

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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3437f1f1294499d4ef306c1089fcb3e29ec2aa68 03-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Speed up code-completion by skipping function bodies.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7f040a9d817cd1c72b565e92abff473510bf9e1d 24-Dec-2010 John McCall <rjmccall@apple.com> Refactor how we collect attributes during parsing, and add slots for attributes
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122535 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
075f8f1b6bed4d1b224c74f87508534cc6392ce6 10-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added ParenType type node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7306ebfacfa51ba5270fd20f162f62d2ed813485 01-Dec-2010 Douglas Gregor <dgregor@apple.com> Not content to implement just "extern" explicit template
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9c4eb1f3438370355f51dc8c62f2ca4803e3338d 19-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactoring.
Move ErrorTrap from clang/Sema to clang/Basic as DiagnosticErrorTrap and use it in Scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
33e4e70c8c0a17e0ccb7465d96556b077a68ecb1 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactoring of Diagnostic class.

-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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119730 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
334d47e92e9f241576fdeb7477b69a03136ba854 11-Oct-2010 Francois Pichet <pichet2000@gmail.com> Add parsing support for Microsoft attributes. MS attributes will just be skipped and not inserted into the AST for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a6eb5f81d13bacac01faff70a947047725b4413f 08-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When we encounter a '==' in a context expecting a '=', assume the user made a typo:

t.c:1:7: error: invalid '==' at end of declaration; did you mean '='?
int x == 0;
^~
=

Implements rdar://8488464.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c5be7b0fc804d8e6f87298ec03c94d8cccd74f29 28-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> vla expressions used in __typeof__ must be evaluated.
Fixes rdar://8476159.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
0fbda68b50ce17d7ad36ef7a5ed77518a5cd272e 15-Sep-2010 Douglas Gregor <dgregor@apple.com> Implement bracket insertion for Objective-C instance message sends as
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
837b1a37116cf4e64f8bb7db34982dee1fba7647 07-Sep-2010 John McCall <rjmccall@apple.com> Improve error recovery when we see ':' and expect a ';'.
I, at least, make this typo all the time.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9ba23b4ceacd77cd264501690a7a9e94184ef71b 07-Sep-2010 Douglas Gregor <dgregor@apple.com> Improve recovery when there is a stray ']' or ')' before the ';' at
the end of a statement. Fixes <rdar://problem/6896493>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
88e64ca96d6c00c6f3bd43772cd325bede795d2a 31-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Enable inline namespaces in C++03 as an extension.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d078e641450bbc5a20df8d3b54f87b27e398acb3 28-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Parser support for inline namespaces

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
f312b1ea179f1c44371f9ee0cd0bc006f612de11 27-Aug-2010 John McCall <rjmccall@apple.com> One who seeks knowledge learns something new every day.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c1a3e5e73859ece9f106ae9d84c78bef4111956a 25-Aug-2010 Douglas Gregor <dgregor@apple.com> Initialize the translation-unit scope before lexing the first
token. The first token might be something that ends up triggering code
completion, which in turn requires a valid Scope. Test case forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
55817afdf9d453a443262a733f6caf6692dca118 25-Aug-2010 Douglas Gregor <dgregor@apple.com> Introduce a preprocessor code-completion hook for contexts where we
expect "natural" language and should not provide any completions,
e.g., comments, string literals, #error.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
f29c5233085a5af795c3c01b94d319e5b3235d56 25-Aug-2010 Douglas Gregor <dgregor@apple.com> Implement code completion for preprocessor expressions and in macro
arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
1fbb447e9d43c2c676e94081fbfee7eb6cbe933b 24-Aug-2010 Douglas Gregor <dgregor@apple.com> Implement preprocessor code completion where a macro name is expected,
e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname>
expression in a preprocessor conditional.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111954 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9 24-Aug-2010 Douglas Gregor <dgregor@apple.com> Introduce basic code-completion support for preprocessor directives,
e.g., after a "#" we'll suggest #if, #ifdef, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
09a63c97b95eb4dc6fd6b2323929e8cf12af03ff 24-Aug-2010 Douglas Gregor <dgregor@apple.com> Parse all kinds of declarations as part of a linkage-specification,
from Francois Pichet! Fixes PR7754.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
60d7b3a319d84d688752be3870615ac0f111fb16 24-Aug-2010 John McCall <rjmccall@apple.com> OwningExprResult -> ExprResult. This patch brought to you by
M-x query-replace-regexp
\(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b3d8748e797c6c2f1dc01186c8eeb3b1b5fe970c 24-Aug-2010 John McCall <rjmccall@apple.com> Abstract out passing around types and kill off ActionBase.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9ae2f076ca5ab1feb3ba95629099ec2319833701 24-Aug-2010 John McCall <rjmccall@apple.com> Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d226f65006733ed7f709c3174f22ce33391cb58f 21-Aug-2010 John McCall <rjmccall@apple.com> DeclPtrTy -> Decl *



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
19510856727e0e14a3696b2a72c35163bff2a71f 20-Aug-2010 John McCall <rjmccall@apple.com> Another step in the process of making the parser depend on Sema:
- 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
e6b1bb6e7fe906d164637ca33503b8fafdbc99e5 11-Aug-2010 Douglas Gregor <dgregor@apple.com> Once code completion has completed, pass a "completion context" on to
the code-completion consumer. The consumer can use this information to
augument, filter, or display the code-completion results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7c15353ccaed24f2df932571166bf305c1b98b6d 06-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Template keyword should not be ignored building a QualifiedTemplateName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
aa8b0d19244a6e7e8e5798fcc6aef003c274d3e0 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Implement #pragma GCC visibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
cbb98edd530787c2ac019e437e7c599df8004ba7 31-Jul-2010 Daniel Dunbar <daniel@zuster.org> Parser: Add support for #pragma align, which is just another spelling of #pragma
options align.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9b36c3f0de0105e903130bbda3c4aea7d792c0af 13-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Modify the pragma handlers to accept and use StringRefs instead of 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9fc1873a3da0af8ef91e4f1927f3540f9af2038f 12-Jul-2010 Chris Lattner <sabre@nondot.org> revert a hunk of code that Argiris added in r106213, which is the
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
004659a56916f2f81ede507c12516c146d6c0df3 12-Jul-2010 Chris Lattner <sabre@nondot.org> Fix PR7617 by not entering ParseFunctionDefinition when
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()
^
;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c82daefa3062721e98947e08193cd81b4e9df915 12-Jul-2010 Chris Lattner <sabre@nondot.org> add a const qualifier, refactor some code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
23c94dbb6631fecdb55ba401aa93722803d980c6 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Move the "current scope" state from the Parser into Action. This
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
36d36806f1972f7ec1d2a3f59155187278c56508 17-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make sure parens/braces/brackets are correctly balanced.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
1a15dae8be2b28e02b6639aa92b832465c5be420 17-Jun-2010 Douglas Gregor <dgregor@apple.com> Fix the recently-added warning about 'typename' and 'template'
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106161 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
861800c676004eabed5927f0552620d06c80a40a 27-May-2010 Daniel Dunbar <daniel@zuster.org> Parse: Add support for '#pragma options align'.

Also, fix a source location bug with the rparen in #pragma pack.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
dc8453422bec3bbf70c03920e01498d75783d122 25-May-2010 Douglas Gregor <dgregor@apple.com> Improve code completion in failure cases in two ways:
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.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
1fd6d44d7ca97631497551bbf98866263143d706 22-May-2010 Douglas Gregor <dgregor@apple.com> Improve parser recovery when we encounter a dependent template name
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104406 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
aec0371e62be013a2e6466688ccf6a7460880262 21-May-2010 John McCall <rjmccall@apple.com> Propagate access specifiers to anonymous union members nested within classes.
Fixes <rdar://problem/7987650>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104376 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d6ca8da0f5a4115813055729faaa5128e994806d 10-Apr-2010 John McCall <rjmccall@apple.com> Diagnose misordered initializers in constructor templates immediately instead of
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
edc287751a4b05e3b4d8ff2b38fa30c5b59a548b 08-Apr-2010 Jeffrey Yasskin <jyasskin@google.com> Fix some redundant errors by changing CXXScopeSpec::isSet calls into
isNotEmpty calls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
849b243d4065f56742a4677d6dc8277609a151f8 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Reinstate my CodeModificationHint -> FixItHint renaming patch, without
the C-only "optimization".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
275313cbb0847f1f117f60d144d113804d4fa42d 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d0ebe080eee7c37e73754068b47fd90cc506e128 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Rename CodeModificationHint to FixItHint, since we've been using the
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c6fbbedb3e90ff2f04828c36fd839e01468679f5 19-Mar-2010 Douglas Gregor <dgregor@apple.com> Remove the capture, serialization, and deserialization of comment
ranges as part of the ASTContext. This code is not and was never used,
but contributes ~250k to the size of the Cocoa.h precompiled
header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d6d4fcf7fd2cdb8c75e6feb5ab1a7132784e96e1 02-Mar-2010 Douglas Gregor <dgregor@apple.com> Unbreak the build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9ea9bdbc14374f7bacdb50d3e52c664ff12150ff 02-Mar-2010 Douglas Gregor <dgregor@apple.com> Keep an explicit stack of function and block scopes, each element of
which has the label map, switch statement stack, etc. Previously, we
had a single set of maps in Sema (for the function) along with a stack
of block scopes. However, this lead to funky behavior with nested
functions, e.g., in the member functions of local classes.

The explicit-stack approach is far cleaner, and we retain a 1-element
cache so that we're not malloc/free'ing every time we enter a
function. Fixes PR6382.

Also, tweaked the unused-variable warning suppression logic to look at
errors within a given Scope rather than within a given function. The
prior code wasn't looking at the right number-of-errors count when
dealing with blocks, since the block's count would be deallocated
before we got to ActOnPopScope. This approach works with nested
blocks/functions, and gives tighter error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9ba6166f4a78722e7df8ffbd64eb788bfdf2764a 26-Feb-2010 John McCall <rjmccall@apple.com> Fix an assertion-on-error during tentative constructor parsing by
propagating error conditions out of the various annotate-me-a-snowflake
routines. Generally (but not universally) removes redundant diagnostics
as well as, you know, not crashing on bad code. On the other hand,
I have just signed myself up to fix fiddly parser errors for the next
week. Again.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
33efe2f088ae40b5129fe4ab021912e80129e155 23-Feb-2010 Richard Pennington <rich@pennware.com> Retain attributes for K&R style parameter declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
1e37765c9257ef1d051f54a674eaa964bdba9693 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Clean up ownership of 'AttributeList' objects in Parser. Apparently
we would just leak them all over the place, with no clear ownership of
these objects at all. AttributeList objects would get leaked on both
error and non-error paths.

Note: I introduced the usage of llvm::OwningPtr<AttributeList> to
manage these objects, which is particularly useful for methods with
multiple return sites. In at least one method I used them even when
they weren't strictly necessary because it clarified the ownership
semantics and made the code easier to read. Should the excessive
'take()' and 'reset()' calls become a performance issue we can always
re-evaluate.

Note+1: I believe I have not introduced any double-frees, but it would
be nice for someone to review this.

This fixes <rdar://problem/7635046>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
39d67117f896c6e2faa727671ef64b3c04b0e3fe 08-Feb-2010 Sebastian Redl <sebastian.redl@getdesigned.at> When placing an annotation token over an existing annotation token, make sure that the new token's range extends to the end of the old token. Assert that in AnnotateCachedTokens. Fixes PR6248.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
63a011378d4b9483ce24400c163cb8d65ea096a5 07-Feb-2010 Douglas Gregor <dgregor@apple.com> Fix assertion failure when parsing linkage specifications (PR5921),
from Keir Mierle!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
82287d19ded35248c4ce6a425ce74116a13ce44e 05-Feb-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> First stage of adding AltiVec support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
841d5e607f81bf5627e47d0c62ead29f28b5b0c2 26-Jan-2010 John McCall <rjmccall@apple.com> Fixit to remove 'volatile' in file-scope 'asm volatile'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7a6ae743b2ecfdfadadf7df53b569a9a3871a8fd 25-Jan-2010 John McCall <rjmccall@apple.com> Warn on top-level 'asm volatile' (instead of misparsing it).
"Fixes" rdar://problem/7574870



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
046c2277dcbcc8eb89dbb5b1b8c5226b7cb81635 18-Jan-2010 Chris Lattner <sabre@nondot.org> allow the HandlerComment callback to push tokens into the
preprocessor. This could be used by an OpenMP implementation
or something. Patch by Abramo Bagnara!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b6ac2451bfed36206c5cec7217372c4299f67f2b 13-Jan-2010 Douglas Gregor <dgregor@apple.com> Whenever completing ordinary names for an Objective-C source, also
provide completions for @ keywords. Previously, we only provided
@-completions after an @ was actually typed, which is useful but
probably not the common case.

Also, make sure a few Objective-C 2.0 completions only show up when
Objective-C 2.0 support is enabled (the default).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
0efc2c1716be4f1c5f1343cad3b047e74861f030 13-Jan-2010 Douglas Gregor <dgregor@apple.com> Reimplement constructor declarator parsing to cope with template-ids
that name constructors, the endless joys of out-of-line constructor
definitions, and various other corner cases that the previous hack
never imagined. Fixes PR5688 and tightens up semantic analysis for
constructor names.

Additionally, fixed a problem where we wouldn't properly enter the
declarator scope of a parenthesized declarator. We were entering the
scope, then leaving it when we saw the ")"; now, we re-enter the
declarator scope before parsing the parameter list.

Note that we are forced to perform some tentative parsing within a
class (call it C) to tell the difference between

C(int); // constructor

and

C (f)(int); // member function

which is rather unfortunate. And, although it isn't necessary for
correctness, we use the same tentative-parsing mechanism for
out-of-line constructors to improve diagnostics in icky cases like:

C::C C::f(int); // error: C::C refers to the constructor name, but
// we complain nicely and recover by treating it as
// a type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93322 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
01dfea02d1da297e8b53db8eea3d3cc652acda8d 11-Jan-2010 Douglas Gregor <dgregor@apple.com> Improve code completion by introducing patterns for the various C and
C++ grammatical constructs that show up in top-level (namespace-level)
declarations, member declarations, template declarations, statements,
expressions, conditions, etc. For example, we now provide a pattern
for

static_cast<type>(expr)

when we can have an expression, or

using namespace identifier;

when we can have a using directive.

Also, improves the results of code completion at the beginning of a
top-level declaration. Previously, we would see value names (function
names, global variables, etc.); now we see types, namespace names,
etc., but no values.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
ae03cb5a84d13c7a0d4b21865bd63aabd18120d2 19-Dec-2009 John McCall <rjmccall@apple.com> Teach TryAnnotateTypeOrScopeToken to deal with already-annotated
scope specifiers. Fix a tentative parsing bug that came up in LLVM.
Incidentally fixes some random FIXMEs in an existing testcase.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
08d92ecf6e5b1fd23177a08c2312b58d63d863db 10-Dec-2009 Chris Lattner <sabre@nondot.org> refactor the 'ColonIsSacred' argument to ParseOptionalCXXScopeSpecifier
to be a bool in Parser that is twiddled by the ColonProtectionRAIIObject
class. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d167ca0d26e43292b8b9e8d5300d92784ae0e27d 10-Dec-2009 Chris Lattner <sabre@nondot.org> rename ExtensionRAIIObject.h -> RAIIObjectsForParser.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91008 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3acd9aaa4ddd14afecb4f1c02ca6f585a6d51849 09-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a bogus error when declaring an extern "C" array.
(fixes radar 7457109).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
bd87c0bd2358498eae71c6cb24e57d2c884c74aa 07-Dec-2009 Chris Lattner <sabre@nondot.org> fix a crash on invalid I found when working on something unrelated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5d1c6198cfe55f8de025902c621c0721b640ff60 06-Dec-2009 Chris Lattner <sabre@nondot.org> simplify logic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
29d9c1adfadf65e2d847d44bec37746844b9e0e3 06-Dec-2009 Chris Lattner <sabre@nondot.org> remove some extraneous syntax: sourceloc implicitly converts to sourcerange.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
bbd37c62e34db3f5a95c899723484a76c71d7757 21-Nov-2009 Sean Hunt <rideau3@gmail.com> Added rudimentary C++0x attribute support.
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
- align() - semantics believed to be conformant to n3000, except for
redeclarations and what entities it may apply to
- final - semantics believed to be conformant to CWG issue 817's proposed
wording, except for redeclarations
- noreturn - semantics believed to be conformant to n3000, except for
redeclarations
- carries_dependency - currently ignored (this is an optimization hint)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
314b97f8c564b465af605efaee23f91ec18a982b 10-Nov-2009 Douglas Gregor <dgregor@apple.com> Improve parsing of template arguments to lay the foundation for
handling template template parameters properly. This refactoring:

- Parses template template arguments as id-expressions, representing
the result of the parse as a template name (Action::TemplateTy)
rather than as an expression (lame!).

- Represents all parsed template arguments via a new parser-specific
type, ParsedTemplateArgument, which stores the kind of template
argument (type, non-type, template) along with all of the source
information about the template argument. This replaces an ad hoc
set of 3 vectors (one for a void*, which was either a type or an
expression; one for a bit telling whether the first was a type or
an expression; and one for a single source location pointing at
the template argument).

- Moves TemplateIdAnnotation into the new Parse/Template.h. It never
belonged in the Basic library anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
54abf7d4fa3123b8324c09d2a4dfb789fd818403 04-Nov-2009 John McCall <rjmccall@apple.com> Change our basic strategy for avoiding deprecation warnings when the decl use
appears in a deprecated context. In the new strategy, we emit the warnings
as usual unless we're currently parsing a declaration, where "declaration" is
restricted to mean a decl group or a few special cases in Objective C. If
we *are* parsing a declaration, we queue up the deprecation warnings until
the declaration has been completely parsed, and then emit them only if the
decl is not deprecated.
We also standardize the bookkeeping for deprecation so as to avoid special cases.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
ca1bdd7c269a2390d43c040a60511edd017ee130 04-Nov-2009 Douglas Gregor <dgregor@apple.com> Implement support for parsing dependent template-ids that refer to
overloaded operators, e.g.,

p->template operator+<T>()




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
014e88d94ff83e3aad4e33b16413a2d1817ec208 04-Nov-2009 Douglas Gregor <dgregor@apple.com> Parsing and semantic analysis for template-ids that name overloaded
operators, e.g.,

operator+<int>

which now works in declarators, id-expressions, and member access
expressions. This commit only implements the non-dependent case, where
we can resolve the template-id to an actual declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
6c94a6d77f456f23ecd4c2061e6413786b5e6571 03-Nov-2009 John McCall <rjmccall@apple.com> Silence a warning by giving Parser::FieldCallback a virtual destructor, and
anchor the vtable to Parser.cpp for good measure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d8ac05753dc4506224d445ff98399c01da3136e5 03-Nov-2009 John McCall <rjmccall@apple.com> Reorganize the parsing of decl groups / function definitions so that
declarators are parsed primarily within a single function (at least for
these cases). Remove some excess diagnostics arising during parse failures.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9fa31dd71e0414e2ca905380e2f8d42710b22c82 17-Oct-2009 Daniel Dunbar <daniel@zuster.org> Don't crash when dumping pretty stack traces, if the current tok is an
annotation token.
- I'm not sure what the best thing to print is, for now we just print the token
location and 'at annotation token'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
791215b7a24666912c0b71175d2ca5ba082f666e 21-Sep-2009 Douglas Gregor <dgregor@apple.com> Code completion for ordinary names when we're starting a declaration, expression, or statement

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
45f965581935791a018df829a14dff53c1dd8f47 04-Sep-2009 Douglas Gregor <dgregor@apple.com> Parse extern templates, pass that information all the way to Sema,
then drop it on the floor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
2dd078ae50ff7be1fb25ebeedde45e9ab691a4f0 03-Sep-2009 Douglas Gregor <dgregor@apple.com> Rewrite of our handling of name lookup in C++ member access expressions, e.g.,

x->Base::f

We no longer try to "enter" the context of the type that "x" points
to. Instead, we drag that object type through the parser and pass it
into the Sema routines that need to know how to perform lookup within
member access expressions.

We now implement most of the crazy name lookup rules in C++
[basic.lookup.classref] for non-templated code, including performing
lookup both in the context of the type referred to by the member
access and in the scope of the member access itself and then detecting
ambiguities when the two lookups collide (p1 and p4; p3 and p7 are
still TODO). This change also corrects our handling of name lookup
within template arguments of template-ids inside the
nested-name-specifier (p6; we used to look into the scope of the
object expression for them) and fixes PR4703.

I have disabled some tests that involve member access expressions
where the object expression has dependent type, because we don't yet
have the ability to describe dependent nested-name-specifiers starting
with an identifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
495c35d291da48c4f5655bbb54d15128ddde0d4d 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Improve support for out-of-line definitions of nested templates and
their members, including member class template, member function
templates, and member classes and functions of member templates.

To actually parse the nested-name-specifiers that qualify the name of
an out-of-line definition of a member template, e.g.,

template<typename X> template<typename Y>
X Outer<X>::Inner1<Y>::foo(Y) {
return X();
}

we need to look for the template names (e.g., "Inner1") as a member of
the current instantiation (Outer<X>), even before we have entered the
scope of the current instantiation. Since we can't do this in general
(i.e., we should not be looking into all dependent
nested-name-specifiers as if they were the current instantiation), we
rely on the parser to tell us when it is parsing a declaration
specifier sequence, and, therefore, when we should consider the
current scope specifier to be a current instantiation.

Printing of complicated, dependent nested-name-specifiers may be
somewhat broken by this commit; I'll add tests for this issue and fix
the problem (if it still exists) in a subsequent commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b13bc41a8b0e2d8b7f7d824d5836ce5ae0b8ae5f 25-Aug-2009 Douglas Gregor <dgregor@apple.com> Eliminate a GCC warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c3058338075a2132e057f1249a13b55a81fe021c 25-Aug-2009 Douglas Gregor <dgregor@apple.com> Keep track of the template parameter depth properly when we have
member templates declared inside other templates. This allows us to
match out-of-line definitions of member function templates within
class templates to the declarations within the class template. We
still can't handle out-of-line definitions for member class templates,
however.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a1d71aea847a50b3acbd187d2ae9e5c1ead0f4e2 24-Aug-2009 Douglas Gregor <dgregor@apple.com> Top-level semicolons are allowed in C++0x. Fixes PR4755.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
fec54013fcd0eb72642741584ca04c1bc292bef8 03-Aug-2009 John McCall <rjmccall@apple.com> Refactor methods on DeclSpec to take a diagnostic& parameter, and reflect this
elsewhere. Very slightly decouples DeclSpec users from knowing the exact
diagnostics to report, and makes it easier to provide different diagnostics in
some places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5c15fe1f59a08c6e2215f99a3b251e14c73b36e2 31-Jul-2009 John McCall <rjmccall@apple.com> sp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
393612e6c7727f1fee50039254d9f434364cc0b2 22-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to accomodate Doug's comment on default
destruction of base/members for each destructor AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
560de45ccbf21c5e4dbeef3fc49f932e499cc181 16-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Added ASTs to destructor decl AST for default destruction of object's
base/members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
0849d38128536b0b33377d91bf02d005308319ef 14-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Build AST for default ctor-initializer when constructor has
out of line definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
2e22253e03e175144aeb9d13350a12fd83f858be 02-Jul-2009 Douglas Gregor <dgregor@apple.com> Add support for retrieving the Doxygen comment associated with a given
declaration in the AST.

The new ASTContext::getCommentForDecl function searches for a comment
that is attached to the given declaration, and returns that comment,
which may be composed of several comment blocks.

Comments are always available in an AST. However, to avoid harming
performance, we don't actually parse the comments. Rather, we keep the
source ranges of all of the comments within a large, sorted vector,
then lazily extract comments via a binary search in that vector only
when needed (which never occurs in a "normal" compile).

Comments are written to a precompiled header/AST file as a blob of
source ranges. That blob is only lazily loaded when one requests a
comment for a declaration (this never occurs in a "normal" compile).

The indexer testbed now supports comment extraction. When the
-point-at location points to a declaration with a Doxygen-style
comment, the indexer testbed prints the associated comment
block(s). See test/Index/comments.c for an example.

Some notes:
- We don't actually attempt to parse the comment blocks themselves,
beyond identifying them as Doxygen comment blocks to associate them
with a declaration.
- We won't find comment blocks that aren't adjacent to the
declaration, because we start our search based on the location of
the declaration.
- We don't go through the necessary hops to find, for example,
whether some redeclaration of a declaration has comments when our
current declaration does not. Similarly, we don't attempt to
associate a \param Foo marker in a function body comment with the
parameter named Foo (although that is certainly possible).
- Verification of my "no performance impact" claims is still "to be
done".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3c9028a5e8dfb120c0d917849a1f79c091a98b88 27-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Fix screwup with my previous patch which broke tests. (The patch is
making sure we return true when annotating a function template with
explicit template arguments, but not when we don't annotate anything.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
8060ed55d6ec003af072d10d92df772c7b9b8475 27-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Fix a crash with constructs like x<false>() in C++. No testcase because
it doesn't actually work yet; we just error out a bit more gracefully.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c8e27cc402043ec86c1698c09e4ee9e415b16207 26-Jun-2009 Chris Lattner <sabre@nondot.org> fix PR4452, a crash on invalid. The error recovery is still terrible in this case
but at least we don't crash :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
52591bf224b2c43e2b00e265bb8599a620081925 24-Jun-2009 Douglas Gregor <dgregor@apple.com> Make sure that the template parameter lists get from the parser down to ActOnFunctionDeclarator for function template definitions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9991479ad5dde617168cc1e4b18425cdbbfd9fa9 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Add parser support for #pragma weak.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
6569d68745c8213709740337d2be52b031384f58 28-May-2009 Douglas Gregor <dgregor@apple.com> Reimplement much of the way that we track nested classes in the
parser. Rather than placing all of the delayed member function
declarations and inline definitions into a single bucket corresponding
to the top-level class, we instead mirror the nesting structure of the
nested classes and place the delayed member functions into their
appropriate place. Then, when we actually parse the delayed member
function declarations, set up the scope stack the same way as it was
when we originally saw the declaration, so that we can find, e.g.,
template parameters that are in scope.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4d9a16f36d3b768672d50e6d02000f982ae448d7 13-May-2009 Douglas Gregor <dgregor@apple.com> Implement parsing for explicit instantiations of class templates, e.g.,

template class X<int>;

This also cleans up the propagation of template information through
declaration parsing, which is used to improve some diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
709131972f67190edd310ef72bd5e8c9a7764823 12-May-2009 Douglas Gregor <dgregor@apple.com> Parser::ParseDeclarationOrFunctionDefinition no longer needs to accept
template parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
1426e534b4fca6a05b1120d634aae46be79ca17c 12-May-2009 Douglas Gregor <dgregor@apple.com> Refactor the parsing of declarations so that template declarations can
parse just a single declaration and provide a reasonable diagnostic
when the "only one declarator per template declaration" rule is
violated. This eliminates some ugly, ugly hackery where we used to
require thatn the layout of a DeclGroup of a single element be the
same as the layout of a single declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d3a413d3b8eb39bcee5944bc545d9997c1abe492 26-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement function-try-blocks. However, there's a very subtle bug that I can't track down.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
97144fc41a9419bf6d74fc9450e8ef3f6e11f7e0 02-Apr-2009 Chris Lattner <sabre@nondot.org> fix a FIXME, providing accurate source range info for DeclStmt's. The end
of the range is now the ';' location. For something like this:

$ cat t2.c

#define bool int
void f(int x, int y) {
bool b = !x && y;
}

We used to produce:
$ clang-cc t2.c -ast-dump
typedef char *__builtin_va_list;

void f(int x, int y)
(CompoundStmt 0x2201f10 <t2.c:3:22, line:5:1>
(DeclStmt 0x2201ef0 <line:2:14> <----
0x2201a20 "int b =
(BinaryOperator 0x2201ed0 <line:4:10, col:16> 'int' '&&'
(UnaryOperator 0x2201e90 <col:10, col:11> 'int' prefix '!'
(DeclRefExpr 0x2201c90 <col:11> 'int' ParmVar='x' 0x2201a50))
(DeclRefExpr 0x2201eb0 <col:16> 'int' ParmVar='y' 0x2201e10))")


Now we produce:

$ clang-cc t2.c -ast-dump
typedef char *__builtin_va_list;

void f(int x, int y)
(CompoundStmt 0x2201f10 <t2.c:3:22, line:5:1>
(DeclStmt 0x2201ef0 <line:2:14, line:4:17> <------
0x2201a20 "int b =
(BinaryOperator 0x2201ed0 <col:10, col:16> 'int' '&&'
(UnaryOperator 0x2201e90 <col:10, col:11> 'int' prefix '!'
(DeclRefExpr 0x2201c90 <col:11> 'int' ParmVar='x' 0x2201a50))
(DeclRefExpr 0x2201eb0 <col:16> 'int' ParmVar='y' 0x2201e10))")



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68288 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a3a835149ed4b183e3b009a1f94a6123779d696b 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Add some more code modification hints

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68261 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9b3064b55f3c858923734e8b1c9831777fc22554 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Add code modification hints to various parsing-related diagnostics.

Plus, reword a extension warnings to avoid talking about "ISO C" when
the extension might also be available in C++ or C++0x.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68257 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
31a19b6989bbf326d2de5ae12e712e2a65ca9c34 01-Apr-2009 Douglas Gregor <dgregor@apple.com> Make parsing a semantic analysis a little more robust following Sema
failures that involve malformed types, e.g., "typename X::foo" where
"foo" isn't a type, or "std::vector<void>" that doens't instantiate
properly.

Similarly, be a bit smarter in our handling of ambiguities that occur
in Sema::getTypeName, to eliminate duplicate error messages about
ambiguous name lookup.

This eliminates two XFAILs in test/SemaCXX, one of which was crying
out to us, trying to tell us that we were producing repeated error
messages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
1734317845d60307d474b5da8a8d33adbaf5e723 01-Apr-2009 Douglas Gregor <dgregor@apple.com> Parsing, semantic analysis, and template instantiation for typename
specifiers that terminate in a simple-template-id, e.g.,

typename MetaFun::template apply<T1, T2>

Also, implement template instantiation for dependent
nested-name-specifiers that involve unresolved identifiers, e.g.,

typename T::type::type





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c45c232440dfafedca1a3773b904fb42609b1b19 31-Mar-2009 Douglas Gregor <dgregor@apple.com> Parsing and AST representation for dependent template names that occur
within nested-name-specifiers, e.g., for the "apply" in

typename MetaFun::template apply<T1, T2>::type

At present, we can't instantiate these nested-name-specifiers, so our
testing is sketchy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7532dc66648cfe7432c9fe66dec5225f0ab301c6 31-Mar-2009 Douglas Gregor <dgregor@apple.com> Improve the representation of template names in the AST. This
representation handles the various ways in which one can name a
template, including unqualified references ("vector"), qualified
references ("std::vector"), and dependent template names
("MetaFun::template apply").

One immediate effect of this change is that the representation of
nested-name-specifiers in type names for class template
specializations (e.g., std::vector<int>) is more accurate. Rather than
representing std::vector<int> as

std::(vector<int>)

we represent it as

(std::vector)<int>

which more closely follows the C++ grammar.

Additionally, templates are no longer represented as declarations
(DeclPtrTy) in Parse-Sema interactions. Instead, I've introduced a new
OpaquePtr type (TemplateTy) that holds the representation of a
TemplateName. This will simplify the handling of dependent
template-names, once we get there.






git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68074 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
23c4b1883b13dc17484b7214091b73f3ba29096e 29-Mar-2009 Chris Lattner <sabre@nondot.org> hoist checks for ; and in out of ParseInitDeclaratorListAfterFirstDeclarator
into ParseSimpleDeclaration, and improve a diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68009 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
682bf92db408a6cbc3d37b5496a99b6ef85041ec 29-Mar-2009 Chris Lattner <sabre@nondot.org> Push DeclGroup much farther throughout the compiler. Now the various
productions (except the already broken ObjC cases like @class X,Y;) in
the parser that can produce more than one Decl return a DeclGroup instead
of a Decl, etc.

This allows elimination of the Decl::NextDeclarator field, and exposes
various clients that should look at all decls in a group, but which were
only looking at one (such as the dumper, printer, etc). These have been
fixed.

Still TODO:

1) there are some FIXME's in the code about potentially using
DeclGroup for better location info.
2) ParseObjCAtDirectives should return a DeclGroup due to @class etc.
3) I'm not sure what is going on with StmtIterator.cpp, or if it can
be radically simplified now.
4) I put a truly horrible hack in ParseTemplate.cpp.

I plan to bring up #3/4 on the mailing list, but don't plan to tackle
#1/2 in the short term.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b28317a8e5e0e2953d1e5406d753d6c3c7f1e7d2 28-Mar-2009 Chris Lattner <sabre@nondot.org> Introduce a new OpaquePtr<N> struct type, which is a simple POD wrapper for a
pointer. Its purpose in life is to be a glorified void*, but which does not
implicitly convert to void* or other OpaquePtr's with a different UID.

Introduce Action::DeclPtrTy which is a typedef for OpaquePtr<0>. Change the
entire parser/sema interface to use DeclPtrTy instead of DeclTy*. This
makes the C++ compiler enforce that these aren't convertible to other opaque
types.

We should also convert ExprTy, StmtTy, TypeTy, AttrTy, BaseTy, etc,
but I don't plan to do that in the short term.

The one outstanding known problem with this patch is that we lose the
bitmangling optimization where ActionResult<DeclPtrTy> doesn't know how to
bitmangle the success bit into the low bit of DeclPtrTy. I will rectify
this with a subsequent patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d57959af02b4af695276f4204443afe6e5d86bd8 28-Mar-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of parsing, semantic analysis, and template
instantiation for C++ typename-specifiers such as

typename T::type

The parsing of typename-specifiers is relatively easy thanks to
annotation tokens. When we see the "typename", we parse the
typename-specifier and produce a typename annotation token. There are
only a few places where we need to handle this. We currently parse the
typename-specifier form that terminates in an identifier, but not the
simple-template-id form, e.g.,

typename T::template apply<U, V>

Parsing of nested-name-specifiers has a similar problem, since at this
point we don't have any representation of a class template
specialization whose template-name is unknown.

Semantic analysis is only partially complete, with some support for
template instantiation that works for simple examples.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3507369940bfb269551bfa1fec812481f60e3552 27-Mar-2009 Douglas Gregor <dgregor@apple.com> Simplify CXXScopeSpec a lot. No more weird SmallVector-like hacks here

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5aeccdbb4bdc94e48c04cacc59fa812af32109b2 26-Mar-2009 Anders Carlsson <andersca@mac.com> Handle parsing of templates in member declarations. Pass the AccessSpecifier all the way down to ActOnClassTemplate.

Doug, Sebastian: Plz review! :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a7b3521ef52d983bd0e7fa562bb9ef1393f14634 25-Mar-2009 Anders Carlsson <andersca@mac.com> Improve handling of base initializers. We now parse initializers in out of line decls, such as:

class C {
C() { }

int a;
};

C::C() : a(10) { }

We also diagnose when initializers are used on declarations that aren't constructors:

t.cpp:1:10: error: only constructors take base initializers
void f() : a(10) { }
^

Doug and/or Sebastian: I'd appreciate a review, especially the nested-name-spec test results (from the looks of it we now match gcc in that test.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67672 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4726d03ab3abce41911c31d1354a18f1258cae4d 23-Mar-2009 Ted Kremenek <kremenek@apple.com> Implement '#pragma unused'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
e4e5b054b4917f0ee493bb2fda5b1ec749bfb9a1 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Introduce a representation for types that we referred to via a
qualified name, e.g.,

foo::x

so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.

The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in

::foo::bar::x

The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).

The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).

Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
511d7aba3b12853fdb88729a0313b80a60eab8ad 11-Mar-2009 Anders Carlsson <andersca@mac.com> Add parser support for static_assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
ddcbc0a72a04a5ae2493088f1437200a9ea480b1 05-Mar-2009 Chris Lattner <sabre@nondot.org> fix eof check


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66149 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
0102c30896c83f70cf6b6519fd5c674cb981c0b5 05-Mar-2009 Chris Lattner <sabre@nondot.org> When the parser is live, print out the location and spelling of its current token.
For example:

Stack dump:
0. Program arguments: clang t.cpp
1. t.cpp:4:8: current parser token: ';'
2. t.cpp:3:1: parsing struct/union/class body 'x'
Abort

It is weird that the parser is always "underneath" any parse context
actions, but the parser is created first.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
40e9bc84a2ab49fc33c2b1a95c6674ab2b820e9e 05-Mar-2009 Chris Lattner <sabre@nondot.org> Simplify the interface to ParseFunctionStatementBody to not take
locations that are the current tok loc. Note that inline C++ methods
have a big fixme that could cause a crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
2a327d11a07dfbdf20910cebbae38910eda111fd 27-Feb-2009 Chris Lattner <sabre@nondot.org> cleanup


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b2fb6de9070fea9abc56c8e8d5469066e964cefe 27-Feb-2009 Douglas Gregor <dgregor@apple.com> Clean up and document code modification hints.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65641 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
51a75d0cc7651753399efdc3176feaee6214c3ca 27-Feb-2009 Chris Lattner <sabre@nondot.org> change a diagnostic message from something pedantically correct but
useless to something more vague but hopefully more clear.
rdar://6624173


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4b2d3f7bcc4df31157df443af1b80bcaa9b58bba 26-Feb-2009 Douglas Gregor <dgregor@apple.com> Introduce code modification hints into the diagnostics system. When we
know how to recover from an error, we can attach a hint to the
diagnostic that states how to modify the code, which can be one of:

- Insert some new code (a text string) at a particular source
location
- Remove the code within a given range
- Replace the code within a given range with some new code (a text
string)

Right now, we use these hints to annotate diagnostic information. For
example, if one uses the '>>' in a template argument in C++98, as in
this code:

template<int I> class B { };
B<1000 >> 2> *b1;

we'll warn that the behavior will change in C++0x. The fix is to
insert parenthese, so we use code insertion annotations to illustrate
where the parentheses go:

test.cpp:10:10: warning: use of right-shift operator ('>>') in template
argument will require parentheses in C++0x
B<1000 >> 2> *b1;
^
( )


Use of these annotations is partially implemented for HTML
diagnostics, but it's not (yet) producing valid HTML, which may be
related to PR2386, so it has been #if 0'd out.

In this future, we could consider hooking this mechanism up to the
rewriter to actually try to fix these problems during compilation (or,
after a compilation whose only errors have fixes). For now, however, I
suggest that we use these code modification hints whenever we can, so
that we get better diagnostics now and will have better coverage when
we find better ways to use this information.

This also fixes PR3410 by placing the complaint about missing tokens
just after the previous token (rather than at the location of the next
token).




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
39a8de10c18365bde7062d8959b7ed525449c561 25-Feb-2009 Douglas Gregor <dgregor@apple.com> Implement parsing of nested-name-specifiers that involve template-ids, e.g.,

std::vector<int>::allocator_type

When we parse a template-id that names a type, it will become either a
template-id annotation (which is a parsed representation of a
template-id that has not yet been through semantic analysis) or a
typename annotation (where semantic analysis has resolved the
template-id to an actual type), depending on the context. We only
produce a type in contexts where we know that we only need type
information, e.g., in a type specifier. Otherwise, we create a
template-id annotation that can later be "upgraded" by transforming it
into a typename annotation when the parser needs a type. This occurs,
for example, when we've parsed "std::vector<int>" above and then see
the '::' after it. However, it means that when writing something like
this:

template<> class Outer::Inner<int> { ... };

We have two tokens to represent Outer::Inner<int>: one token for the
nested name specifier Outer::, and one template-id annotation token
for Inner<int>, which will be passed to semantic analysis to define
the class template specialization.

Most of the churn in the template tests in this patch come from an
improvement in our error recovery from ill-formed template-ids.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
55f6b14230c94272efbbcdd89a92224c8db9f225 09-Feb-2009 Douglas Gregor <dgregor@apple.com> Start processing template-ids as types when the template-name refers
to a class template. For example, the template-id 'vector<int>' now
has a nice, sugary type in the type system. What we can do now:

- Parse template-ids like 'vector<int>' (where 'vector' names a
class template) and form proper types for them in the type system.
- Parse icky template-ids like 'A<5>' and 'A<(5 > 0)>' properly,
using (sadly) a bool in the parser to tell it whether '>' should
be treated as an operator or not.

This is a baby-step, with major problems and limitations:
- There are currently two ways that we handle template arguments
(whether they are types or expressions). These will be merged, and,
most likely, TemplateArg will disappear.
- We don't have any notion of the declaration of class template
specializations or of template instantiations, so all template-ids
are fancy names for 'int' :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
ab197baec16bacade82325fb274cf6b992ac5d8a 09-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement Declarator::getSourceRange().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
76ad2e85575722e8a38a2bd4648ab4304d9fcd24 05-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Put the invalid flag of OwningResult into the Action pointer.
This shrinks OwningResult by one pointer. Since it is no longer larger than OwningPtr, merge the two.
This leads to simpler client code and speeds up my benchmark by 2.7%.
For some reason, this exposes a previously hidden bug, causing a regression in SemaCXX/condition.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
aaba5e346dffdbad5d1c42765a89e4a7afb0da67 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Basic representation of C++ class templates, from Andrew Sutton.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b696ea3a0693798daeafd896d77f0b8f1fec3cc5 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Diagnose ambiguities in getTypeName. Fixes http://llvm.org/bugs/show_bug.cgi?id=3475

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
500d3297d2a21edeac4d46cbcbe21bc2352c2a28 29-Jan-2009 Chris Lattner <sabre@nondot.org> move library-specific diagnostic headers into library private dirs. Reduce
redundant #includes. Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b43a50ff1b0b171ece84425b0ad83a9a31f038fa 28-Jan-2009 Steve Naroff <snaroff@apple.com> Name change (isTypeName->getTypeName).
Since it doesn't return a bool, is shouldn't be prefixed with 'is'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
20c6b3b85e186cd52d5d99489132d71d498159eb 27-Jan-2009 Chris Lattner <sabre@nondot.org> Split the single monolithic DiagnosticKinds.def file into one
.def file for each library. This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.

Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
be109b3e768b70f9efb106d25d6b5a2c72c5a9b8 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Handle any undeclared parameters in a K&R-style function with a
special action, inside function prototype scope. This avoids confusion
when we try to inject these parameters into the scope of the function
body before the function itself has been added to the surrounding
scope. Fixes <rdar://problem/6097326>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
f512e82f56671b695a32d019103e62a302838b7e 18-Jan-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Rename move_convert to move_arg and move_res. The new names are less misleading (and shorter).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3218c4bb3b5d7250f12420de6db7ef3e3f805a75 09-Jan-2009 Douglas Gregor <dgregor@apple.com> When we see a reference to a struct, class, or union like "struct X"
that is neither a definition nor a forward declaration and where X has
not yet been declared as a tag, introduce a declaration
into the appropriate scope (which is likely *not* to be the current
scope). The rules for the placement of the declaration differ slightly
in C and C++, so we implement both and test the various corner
cases. This implementation isn't 100% correct due to some lingering
issues with the function prototype scope (for a function parameter
list) not being the same scope as the scope of the function
definition. Testcase is FIXME'd; this probably isn't an important issue.

Addresses <rdar://problem/6484805>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7a0ab5f387722c83e19c7133b46b16988eb19e45 06-Jan-2009 Chris Lattner <sabre@nondot.org> rename MaybeParseCXXScopeSpecifier -> ParseOptionalCXXScopeSpecifier and
MaybeParseTypeSpecifier -> ParseOptionalTypeSpecifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
b31757b68afe06ba442a05775d08fe7aa0f6f889 06-Jan-2009 Chris Lattner <sabre@nondot.org> rename tok::annot_qualtypename -> tok::annot_typename, which is both
shorter and more accurate. The type name might not be qualified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5b4547318bb179fc76f984f0eeaaf615927e795c 05-Jan-2009 Chris Lattner <sabre@nondot.org> remove optimization to avoid looking ahead for cases like ::foo. This
isn't worth the complexity and the code already does a ton of lookahead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
608d1fc9c4db3e3769f03a4f989d7692aefbf073 05-Jan-2009 Chris Lattner <sabre@nondot.org> Rearrange some code in TryAnnotateTypeOrScopeToken to make it
early exit for C and avoid template lookup for C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7452c6fc567ea1799f617395d0fa4c7ed075e5d9 05-Jan-2009 Chris Lattner <sabre@nondot.org> TryAnnotateTypeOrScopeToken and TryAnnotateCXXScopeToken can
only be called when they might be needed now, so make them assert
that their current token is :: or identifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
55a7cefc846765ac7d142a63f773747a20518d71 05-Jan-2009 Chris Lattner <sabre@nondot.org> ParseCXXSimpleTypeSpecifier can only be called on things that are
verified to be simple type specifiers, so there is no need for it
to call TryAnnotateTypeOrScopeToken.

Make MaybeParseCXXScopeSpecifier reject ::new and ::delete with a
hard error now that it may never be transitively called in a
context where these are legal. This allows me to start
disentangling things more.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5e02c47a7085831586344a9728763cb50540c7f7 05-Jan-2009 Chris Lattner <sabre@nondot.org> sink a call to TryAnnotateCXXScopeToken down into the
applicable cases in ParseDeclarationSpecifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a7bc7c880f86bc180684ef032d06df51bcae7a23 05-Jan-2009 Chris Lattner <sabre@nondot.org> my previous patch caused sema to drop the global qualifier, make
sure to pass it down. This makes the code a bit gross, I will clean
it up in subsequent commits.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61650 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
6ec76d45bd3111013c357f16e08720407c2f9ae8 04-Jan-2009 Chris Lattner <sabre@nondot.org> use early exits to reduce nesting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
f780abc21c39cd4731b9e38f2d2d9f7d1510bd7b 30-Dec-2008 Douglas Gregor <dgregor@apple.com> Parser support for C++ using directives, from Piotr Rak

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c4b4e7b8f6ca9b036824e048af49cd2a52b57cdf 24-Dec-2008 Douglas Gregor <dgregor@apple.com> Keep track of template arguments when we parse them. Right now, we don't actually do anything with the template arguments, but they'll be used to create template declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d6fb7ef028d9aa0b3e8943b7bc049c524437b407 18-Dec-2008 Douglas Gregor <dgregor@apple.com> Ultrasimplistic sketch for the parsing of C++ template-ids. This won't
become useful or correct until we (1) parse template arguments
correctly, (2) have some way to turn template-ids into types,
declarators, etc., and (3) have a real representation of templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
798d119415323ebcd029ffe1e0fb442a4ca8adbb 13-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Some utilities for using the smart pointers in Actions, especially Sema. Convert a few functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
20df9b7ab9388b2a488c5b1293cd196b1e073b4e 11-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Convert a big bunch of expression parsers to use smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
61364dddc33383e62cfe3b841dbc0f471280d95b 11-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Convert a number of statement parsers to smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
8935b8b49053122ddd3ab4cd59af0fe5eb9c23cf 10-Dec-2008 Douglas Gregor <dgregor@apple.com> Use a scoped object to manage entry/exit from a parser scope rather than explicitly calling EnterScope/ExitScope

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
effa8d1c97b00a3f53e972b0e61d9aade5ea1c57 10-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Modify the move emulation according to the excellent design of Howard Hinnant. Makes for much nicer syntax when smart pointers are used consistently. Also, start converting internal argument passing of Parser to smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
15faa7fdfb496489dec9470aa5eb699b29ecdacc 09-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Kick out the proof-of-concept ASTOwner and replace it with ASTOwningResult

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7f792faf0cee47fa1ea304bd7a7f502c0e5bbc9a 09-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Lay the groundwork for converting the entire parser-sema chain to smart pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
0e9eabca263e8922bec0e2b38c8670eba9a39a1f 09-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Consistently use smart pointers for stmt and expr nodes in parser local variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60761 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
90b93d6f6961edd8f17e089253d655892adc1ef7 08-Dec-2008 Chris Lattner <sabre@nondot.org> Fix PR3172: if we see an eof or } at the top level, reject it.
This is important because ParseDeclarationOrFunctionDefinition
skips to, but does not consume, an } on error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
72c3f314d92d65c050ee1c07b7753623c044d6c7 05-Dec-2008 Douglas Gregor <dgregor@apple.com> Representation of template type parameters and non-type template
parameters, with some semantic analysis:
- Template parameters are introduced into template parameter scope
- Complain about template parameter shadowing (except in Microsoft mode)

Note that we leak template parameter declarations like crazy, a
problem we'll remedy once we actually create proper declarations for
templates.

Next up: dependent types and value-dependent/type-dependent
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
adcac8824a9cff13f1ef61a69e38c1041cba12ee 02-Dec-2008 Douglas Gregor <dgregor@apple.com> Basic support for parsing templates, from Andrew Sutton

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
cb43d999520f547d682a1ca280ecfedb115ee1fd 02-Dec-2008 Douglas Gregor <dgregor@apple.com> Improve error recovery when parsing a function definition fails

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
44802cc435d5122701e4f1a9354381cff4b171c0 26-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add some comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4bdd91c09fd59e0c154d759288beff300e31e1d0 26-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement some suggestions by Daniel:

-Change Parser::ParseCXXScopeSpecifier to MaybeParseCXXScopeSpecifier
-Remove Parser::isTokenCXXScopeSpecifier and fold it into MaybeParseCXXScopeSpecifier
-Rename Parser::TryAnnotateScopeToken to TryAnnotateCXXScopeToken and only allow it to be called when in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
618e5c04702b156d75aa2636232ef8430912abdc 24-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Remove an empty if and add a reminder for when we implement C++ try-catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
28eb7e992b9a266abb300da25b6d3c1557cec361 24-Nov-2008 Chris Lattner <sabre@nondot.org> make the 'to match this' diagnostic a note.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
3cbfe2c4159e0a219ae660d50625c013aa4afbd0 22-Nov-2008 Chris Lattner <sabre@nondot.org> Split the DiagnosticInfo class into two disjoint classes:
one for building up the diagnostic that is in flight (DiagnosticBuilder)
and one for pulling structured information out of the diagnostic when
formatting and presenting it.

There is no functionality change with this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c19923dda3d28f67aab4726cd40bb07032758383 21-Nov-2008 Douglas Gregor <dgregor@apple.com> Tiny fix to the parsing of linkage-specifications

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
08b2c3743a29a2dddcf72e95f747760e213cdde7 19-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix this:

With this snippet:
void f(a::b);

An assert is hit:
Assertion failed: CachedTokens[CachedLexPos-1].getLocation() == Tok.getAnnotationEndLoc() && "The annotation should be until the most recent cached token", file ..\..\lib\Lex\PPCaching.cpp, line 98

Introduce Preprocessor::RevertCachedTokens that reverts a specific number of tokens when backtracking is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
6898e33d0b28346a4dbe9a666e0e4188fea80460 19-Nov-2008 Chris Lattner <sabre@nondot.org> remove uses of IdentifierInfo::getName()


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
ef708fd4abccf4d21b1f82ab2ab62f6ae7cc1265 18-Nov-2008 Chris Lattner <sabre@nondot.org> remove the last couple obsolete forms of Parser::Diag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
1ab3b96de160e4fbffec2a776e284a48a3bb543d 18-Nov-2008 Chris Lattner <sabre@nondot.org> Change a couple of the Parser::Diag methods to return DiagnosticInfo
and let the clients push whatever they want into the DiagnosticInfo
instead of hard coding a few forms. Also switch various clients to
use Diag(Tok, ...) instead of Diag(Tok.getLocation(), ...) as the
canonical form to simplify the code a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
0a14eee528a901c16f0e288fbc10a3abc1660d87 18-Nov-2008 Chris Lattner <sabre@nondot.org> This reworks some of the Diagnostic interfaces a bit to change how diagnostics
are formed. In particular, a diagnostic with all its strings and ranges is now
packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a
ton of random stuff. This has the benefit of simplifying the interface, making
it more extensible, and allowing us to do more checking for things like access
past the end of the various arrays passed in.

In addition to introducing DiagnosticInfo, this also substantially changes how
Diagnostic::Report works. Instead of being passed in all of the info required
to issue a diagnostic, Report now takes only the required info (a location and
ID) and returns a fresh DiagnosticInfo *by value*. The caller is then free to
stuff strings and ranges into the DiagnosticInfo with the << operator. When
the dtor runs on the DiagnosticInfo object (which should happen at the end of
the statement), the diagnostic is actually emitted with all of the accumulated
information. This is a somewhat tricky dance, but it means that the
accumulated DiagnosticInfo is allowed to keep pointers to other expression
temporaries without those pointers getting invalidated.

This is just the minimal change to get this stuff working, but this will allow
us to eliminate the zillions of variant "Diag" methods scattered throughout
(e.g.) sema. For example, instead of calling:

Diag(BuiltinLoc, diag::err_overload_no_match, typeNames,
SourceRange(BuiltinLoc, RParenLoc));

We will soon be able to just do:

Diag(BuiltinLoc, diag::err_overload_no_match)
<< typeNames << SourceRange(BuiltinLoc, RParenLoc));

This scales better to support arbitrary types being passed in (not just
strings) in a type-safe way. Go operator overloading?!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
2383b7f6aea2cb2bf2b5bfc0ec730f9354fecbbf 18-Nov-2008 Chris Lattner <sabre@nondot.org> Change the diagnostics interface to take an array of pointers to
strings instead of array of strings. This reduces string copying
in some not-very-important cases, but paves the way for future
improvements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
10bd36882406cdf4805e35add1ce2f11ab9ae152 17-Nov-2008 Douglas Gregor <dgregor@apple.com> Eliminate all of the placeholder identifiers used for constructors,
destructors, and conversion functions. The placeholders were used to
work around the fact that the parser and some of Sema really wanted
declarators to have simple identifiers; now, the code that deals with
declarators will use DeclarationNames.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
eb83ecde1a822b1c38cd060a85a08c1ac9f82cf8 08-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement support for C++ nested-name-specifiers ('foo::bar::x') in the Parser side.
No Sema functionality change, just the signatures of the Action/Sema methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
7ad8390f7992ab7f19b1460c5f0b9d96f165c4e9 05-Nov-2008 Douglas Gregor <dgregor@apple.com> Initial implementation of parsing, semantic analysis, and AST-building
for constructor initializations, e.g.,

class A { };
class B : public A {
int m;
public:
B() : A(), m(17) { };
};





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5fd80fada1eeecd279af8333a7f58b86d8df8016 20-Oct-2008 Chris Lattner <sabre@nondot.org> eliminate ObjCPropertyAttrs an corresponding enums, just use
strcmp when needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
8f5421a2cfaff0b5ef93a4116f697ed98ce08828 20-Oct-2008 Chris Lattner <sabre@nondot.org> remove extraneous braces


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
39146d6497ad5e7ca8ef639221e7b3e15d07c888 20-Oct-2008 Chris Lattner <sabre@nondot.org> simplify some other code for __extension__ processing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
c46d1a1f8af67a87689d7db9eaf96027282ccaea 20-Oct-2008 Chris Lattner <sabre@nondot.org> implement a couple fixme's by implementing __extension__ properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
31c286803c60c59d314525e047d0e72f9a1cb55b 20-Oct-2008 Chris Lattner <sabre@nondot.org> fix indentation



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
73a0d889eda0f000a441319e39540509175b8e81 06-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement support for C++ direct initializers in declarations, e.g. "int x(1);".

This is how this kind of initializers appear in the AST:
-The Init expression of the VarDecl is a functional type construction (of the VarDecl's type).
-The new VarDecl::hasCXXDirectInitializer() returns true.

e.g, for "int x(1);":
-VarDecl 'x' has Init with expression "int(1)" (CXXFunctionalCastExpr).
-hasCXXDirectInitializer() of VarDecl 'x' returns true.

A major benefit is that clients that don't particularly care about which exactly form was the initializer can handle both cases without special case code.
Note that codegening works now for "int x(1);" without any changes to CodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
fcdd8fe26de3eee44927600bf1853e21bd90dd84 04-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add Parser support for #pragma pack
- Uses Action::ActOnPragmaPack
- Test case is XFAIL pending verifier fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
246e70f69cb8aeb67225c54690f1c6b25abd5a86 26-Sep-2008 Daniel Dunbar <daniel@zuster.org> Parser support for prefix __attribute__ on @protocol.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a88b509d233d3f42382130c159c05cafa006b3e0 24-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Pass SourceRanges by reference to the various Diag methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
897e7a38c73a28731f8cdbaa4385ca15ab65820c 24-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a Parser::Diag overload that can receive a custom string along with a SourceRange.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
9299f3fa85796613cc787a2062c9562d07c8613e 23-Aug-2008 Chris Lattner <sabre@nondot.org> make sure that ParseAST invokes the action for end of translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a9e8fec80088f4e176d80b84bddddfbc9ab0f548 23-Aug-2008 Chris Lattner <sabre@nondot.org> add action to know about end of translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
5ffb14b7e88e587cd2f78dcc3a966a64108920f0 23-Aug-2008 Chris Lattner <sabre@nondot.org> we already have a handle on the 'in' keyword, don't bother getting two.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
06f548596beef4c0a227a45cba996497f99566c0 23-Aug-2008 Chris Lattner <sabre@nondot.org> minor cleanup, remove finalize method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
662e8b5647adbb1bc9eeceece7b64600cfa87471 15-Aug-2008 Daniel Dunbar <daniel@zuster.org> Change Parser & Sema to use interned "super" for comparions.
- Added as private members for each because it is not clear where to
put the common definition. Perhaps the IdentifierInfos all of these
"pseudo-keywords" should be collected into one place (this would
KnownFunctionIDs and Objective-C property IDs, for example).

Remove Token::isNamedIdentifier.
- There isn't a good reason to use strcmp when we have interned
strings, and there isn't a good reason to encourage clients to do
so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
e4858a65a93fb36c099d8dd2ea0a98e33e77687e 11-Aug-2008 Daniel Dunbar <daniel@zuster.org> More #include cleaning
- Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into
implementation .cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54626 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4fef81d718ca1b91ce2adef52db91a35f86e9bbd 05-Aug-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6124613 a crash on invalid code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a80f8749f2968d19595ca2544114932bf0ca2c11 05-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add more Parser/Sema support for GCC asm-label extension.
- ActOnDeclarator now takes an additional parameter which is the
AsmLabel if used. Its unfortunate that this bubbles up this high,
but we cannot just lump it in as an attribute without mistakenly
*accepting* it as an attribute.
- The actual asm-label itself is, however, encoded as an AsmLabelAttr
on the FunctionDecl.
- Slightly improved parser error recovery on malformed asm-labels.
- CodeGen support still missing...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
844cef32e4359c3e651e4eb84beca0c3e8a727d5 26-Jul-2008 Chris Lattner <sabre@nondot.org> add a new diag helper that takes a range.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
985abd958d83e4f109a15451440f1d008ae45f59 26-Jun-2008 Chris Lattner <sabre@nondot.org> Make Declarator::getDeclSpec() return a const reference to avoid
cases where mutation can introduce bugs. Propagate around 'const'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
4cc18a4d5222e04bd568b1e3e4d86127dbbcdf3f 25-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add parsing support for C++ classes.

Note that Parser::ParseCXXMemberSpecification is temporarily disabled until the Sema support is in place.
Once ParseCXXMemberSpecification is enabled, the Parser/cxx-class.cpp test will pass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
cf28c72980746707e25a833426315187534d41fc 21-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> K&R-style functions not allowed in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a6f0177a864ac478eb9890319f2e8ea03695e91d 19-Jun-2008 Mike Stump <mrs@apple.com> Test commit to see if new account works.

I choose to remove extraneous whitespace at end of lines as a semantic
nop for the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
aec3a1eb215445e63ba5702f8d6b1e0f2e8c27b9 28-May-2008 Chris Lattner <sabre@nondot.org> Fix a couple crashes on invalid input.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
6e33dd5b5cbaddadd54bebe07c8397844365d885 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix the scope of K&R-style argument declarations so that they don't
extend beyond the end of the function.

I'm not completely sure this is the right way to fix this bug, so
someone familiar with the parser should double-check.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
04421087832a031c90bd58f128c7c0e741db8dd2 08-Apr-2008 Chris Lattner <sabre@nondot.org> Add support for C++ default arguments, and rework Parse-Sema
interaction for function parameters, fixing PR2046.

Patch by Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
d658b562e80d6ef7a1118e34ff12802c6e2fcced 05-Apr-2008 Chris Lattner <sabre@nondot.org> Fix handling of implicit int, resolving PR2012 and reverting (and
subsuming) my patch for PR1999.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
a798ebc82627ea9cb7a00da07d2b60f9f2114f69 05-Apr-2008 Chris Lattner <sabre@nondot.org> Step #1 to fixing PR2012: c89 allows declspecs to be completely
missing from function definitions only. If we see a function
definiton with missing declspecs, just fudge in an int.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp
bda0b626e74513950405c27525af87e214e605e2 16-Mar-2008 Chris Lattner <sabre@nondot.org> Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Parse/Parser.cpp