[clangd] Always use preamble (even stale) for code completion
authorIlya Biryukov <ibiryukov@google.com>
Thu, 18 Jan 2018 15:17:00 +0000 (15:17 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Thu, 18 Jan 2018 15:17:00 +0000 (15:17 +0000)
commit295c8e1e2df57c9c85029e256a561b131043b0cd
tree80340054bbe6b598a408ed3d0f463dca7a6db8e4
parent4a8f7533061bdd575677fc3d7c066a7a3a2b372e
[clangd] Always use preamble (even stale) for code completion

Summary:
This improves performance of code completion, because we avoid stating
the files from the preamble and never attempt to parse the files
without using the preamble if it's provided.

However, the change comes at a cost of sometimes providing incorrect
results when doing code completion after making actually considerable
changes to the files used in the preamble or the preamble itself.
Eventually the preamble will get rebuilt and code completion will
be providing the correct results.

Reviewers: bkramer, sammccall, jkorous-apple

Reviewed By: sammccall

Subscribers: klimek, cfe-commits

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

llvm-svn: 322854
clang-tools-extra/clangd/CodeComplete.cpp
clang-tools-extra/clangd/Compiler.cpp
clang-tools-extra/clangd/Compiler.h