[clangd] Replay preamble #includes to clang-tidy checks.
authorSam McCall <sam.mccall@gmail.com>
Tue, 20 Nov 2018 10:58:48 +0000 (10:58 +0000)
committerSam McCall <sam.mccall@gmail.com>
Tue, 20 Nov 2018 10:58:48 +0000 (10:58 +0000)
commit991e31612625955033bd8c65c47db37e9636d7a1
treecec3121fde2050e93a5799ae5bce13c330ac2a45
parent2bebc3d0602b407b3f351e782940959da5808f97
[clangd] Replay preamble #includes to clang-tidy checks.

Summary:
This is needed to correctly handle checks that use IncludeInserter,
which is very common.

I couldn't find a totally safe example of a check to enable for testing,
I picked modernize-deprecated-headers which some will probably hate.
We should get configuration working...

This depends on D54691 which ensures our calls to getFile(open=false)
don't break subsequent accesses via the FileManager.

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Differential Revision: https://reviews.llvm.org/D54694

llvm-svn: 347298
clang-tools-extra/clangd/ClangdUnit.cpp
clang-tools-extra/clangd/Diagnostics.cpp
clang-tools-extra/clangd/Headers.cpp
clang-tools-extra/clangd/Headers.h
clang-tools-extra/unittests/clangd/ClangdUnitTests.cpp
clang-tools-extra/unittests/clangd/HeadersTests.cpp