[clangd] Always use the latest preamble
authorHaojian Wu <hokein@google.com>
Fri, 17 Aug 2018 08:15:22 +0000 (08:15 +0000)
committerHaojian Wu <hokein@google.com>
Fri, 17 Aug 2018 08:15:22 +0000 (08:15 +0000)
commit4c0c37df4cccbee18f2a886d0ccb3bc8cc59be6b
treee24c71905aeba025d0ab473fa2ca9e825327cf3d
parente2d47dd1bb0dcae478db891273635672c3dc969e
[clangd] Always use the latest preamble

Summary:
Fix an inconsistent behavior of using `LastBuiltPreamble`/`NewPreamble`
in TUScheduler (see the test for details), AST should always use
NewPreamble. This patch makes LastBuiltPreamble always point to
NewPreamble.

Preamble rarely fails to build, even there are errors in headers, so we
assume it would not cause performace issue for code completion.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 340001
clang-tools-extra/clangd/TUScheduler.cpp
clang-tools-extra/unittests/clangd/XRefsTests.cpp