HomePhabricator

[clangd] Build index on preamble changes instead of the AST changes

Description

[clangd] Build index on preamble changes instead of the AST changes

Summary:
This is more efficient and avoids data races when reading files that
come from the preamble. The staleness can occur when reading a file
from disk that changed after the preamble was built. This can lead to
crashes, e.g. when parsing comments.

We do not to rely on symbols from the main file anyway, since any info
that those provide can always be taken from the AST.

Reviewers: ioeric, sammccall

Reviewed By: ioeric

Subscribers: malaperle, klimek, javed.absar, MaskRay, jkorous, cfe-commits

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

Details

Committed
ibiryukovMay 24 2018, 8:50 AM
Reviewer
ioeric
Differential Revision
D47272: [clangd] Build index on preamble changes instead of the AST changes
Branches
Unknown
Tags
Unknown