[clangd] Fix an assertion failure in background index.
authorHaojian Wu <hokein@google.com>
Fri, 14 Dec 2018 12:39:08 +0000 (12:39 +0000)
committerHaojian Wu <hokein@google.com>
Fri, 14 Dec 2018 12:39:08 +0000 (12:39 +0000)
commitd5a78e6e594bcf8dc7502fb5cb7396c0936eb224
tree44774c2b9d6604ed73509fb3cf45dca922feff69
parent813af0d2831d5ece986a06d8e407156f941fafae
[clangd] Fix an assertion failure in background index.

Summary:
When indexing a file which contains an uncompilable error, we will
trigger an assertion failure -- the IndexFileIn data is not set, but we
access them in the backgound index.

Reviewers: kadircet

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 349144
clang-tools-extra/clangd/index/Background.cpp
clang-tools-extra/unittests/clangd/BackgroundIndexTests.cpp