Introduce ClangTool::buildASTs, and buildASTFromCode.

These allow clients to retrieve persistent AST objects (ASTUnits) which
can be used in an ad-hoc manner after parsing.

To accommodate this change, the code for processing a CompilerInvocation
using a FrontendAction has been factored out to FrontendActionFactory, and
a new base class, ToolAction, has been introduced, allowing the tool to do
arbitrary things with each CompilerInvocation.  This change was necessary
because ASTUnit does not use the FrontendAction interface directly.

This change also causes the FileManager in ClangTool to use shared ownership.
This will become necessary because ASTUnit takes shared ownership of
FileManager (ClangTool's FileManager is currently unused by ASTUnit; this
is a FIXME).  As shown in the tests, any client of ToolInvocation will
need to be modified to use shared ownership for FileManager.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194164 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: Add /FS as an ignored flag

CMake-generated Makefiles include this cl flag which can be safely ignored
until we get PDB server support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194165 91177308-0d34-0410-b5e6-96231b3b80d8
[build] Update runtime library and tests to work with relocatable SDKs on OS X 10.9.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194168 91177308-0d34-0410-b5e6-96231b3b80d8
This patch modified ExeBasename as clang-cl.exe to match the preceding comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194170 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: Hide ignored flags

We don't want to them to appear in the help text for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194174 91177308-0d34-0410-b5e6-96231b3b80d8
Update \param in ToolInvocation() corresponding to r194164. [-Wdocumentation]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194175 91177308-0d34-0410-b5e6-96231b3b80d8
Work around an MSVC 2013 miscompile with the Redeclarable class.  Fixes PR16606

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194176 91177308-0d34-0410-b5e6-96231b3b80d8
Disable a tooling test on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194178 91177308-0d34-0410-b5e6-96231b3b80d8
clang-format: Separate line-merging logic into its own class.

No functional changes (intended).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194179 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: Hide ignored joined flags as well

This is an addendum to r194174.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194180 91177308-0d34-0410-b5e6-96231b3b80d8
[-fms-extensions] Add support for __FUNCDNAME__

Summary:
Similar to __FUNCTION__, MSVC exposes the name of the enclosing mangled
function name via __FUNCDNAME__.  This implementation is very naive and
unoptimized, it is expected that __FUNCDNAME__ would be used rarely in
practice.

Reviewers: rnk, rsmith, thakis

CC: cfe-commits, silvas

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194181 91177308-0d34-0410-b5e6-96231b3b80d8
Add the fact that Clang too is planning to start using C++11 (in some
limited ways) after the next release. See the lengthy discussions (which
are on-going) and the corresponding commit to LLVM's release notes.
Nothing is actually changing at this point, this is just further
spreading the plan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194184 91177308-0d34-0410-b5e6-96231b3b80d8
This patch implements capturing of variables within generic lambdas.

Both Richard and I felt that the current wording in the working paper needed some tweaking - Please see http://llvm-reviews.chandlerc.com/D2035 for additional context and references to core-reflector messages that discuss wording tweaks.

What is implemented is what we had intended to specify in Bristol; but, recently felt that the specification might benefit from some tweaking and fleshing.  

As a rough attempt to explain the semantics: If a nested lambda with a default-capture names a variable within its body, and if the enclosing full expression that contains the name of that variable is instantiation-dependent - then an enclosing lambda that is capture-ready (i.e. within a non-dependent context) must capture that variable, if all intervening nested lambdas can potentially capture that variable if they need to, and all intervening parent lambdas of the capture-ready lambda can and do capture the variable.      

Of note, 'this' capturing is also currently underspecified in the working paper for generic lambdas.  What is implemented here is if the set of candidate functions in a nested generic lambda includes both static and non-static member functions (regardless of viability checking - i.e. num and type of parameters/arguments) - and if all intervening nested-inner lambdas between the capture-ready lambda and the function-call containing nested lambda can capture 'this' and if all enclosing lambdas of the capture-ready lambda can capture 'this', then 'this' is speculatively captured by that capture-ready lambda.

Hopefully a paper for the C++ committee (that Richard and I had started some preliminary work on) is forthcoming. 

This essentially makes generic lambdas feature complete, except for known bugs. The more prominent ones (and the ones I am currently aware of) being:
  - generic lambdas and init-captures are broken - but a patch that fixes this is already in the works ...
  - nested variadic expansions such as:
    auto K = [](auto ... OuterArgs) {
      vp([=](auto ... Is) {
          decltype(OuterArgs) OA = OuterArgs;
          return 0;
        }(5)...);
      return 0;
    };
    auto M = K('a', ' ', 1, " -- ", 3.14); 
   currently cause crashes.  I think I know how to fix this (since I had done so in my initial implementation) - but it will probably take some work and back & forth with Doug and Richard.

A warm thanks to all who provided feedback - and especially to Doug Gregor and Richard Smith for their pivotal guidance: their insight and prestidigitation in such matters is boundless!

Now let's hope this commit doesn't upset the buildbot gods ;)

Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194188 91177308-0d34-0410-b5e6-96231b3b80d8
Update cxx_dr_status.html to match current cwg issue list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194189 91177308-0d34-0410-b5e6-96231b3b80d8
Unbreak the Clang -Werror build by removing some unused variables

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194190 91177308-0d34-0410-b5e6-96231b3b80d8
RewriteBuffer: Remove an unused typedef

This hasn't been used for some time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194191 91177308-0d34-0410-b5e6-96231b3b80d8
Tests for DR150 - DR165.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194192 91177308-0d34-0410-b5e6-96231b3b80d8
Mark generic lambdas, and thus C++14, as complete. Add commented-out stub for C++17.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194194 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed bug in return type of __builtin_va_start().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194197 91177308-0d34-0410-b5e6-96231b3b80d8
Ubuntu has published its Saucy release. 'Trusty Tahr' dev has just started. Add its support in Clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194198 91177308-0d34-0410-b5e6-96231b3b80d8