This is an archive of the discontinued LLVM Phabricator instance.

[Preamble] Reuse preamble even if an unsaved file does not exist
AbandonedPublic

Authored by nik on Nov 14 2018, 5:35 AM.

Details

Reviewers
None
Summary

When a preamble is created an unsaved file not existing on disk is
already part of PrecompiledPreamble::FilesInPreamble. However, when
checking whether the preamble can be re-used, a failed stat of such an
unsaved file invalidated the preamble, which led to pointless and time
consuming preamble regenerations on subsequent reparses.

Do not require anymore that unsaved files should exist on disk.

This avoids costly preamble invalidations depending on timing issues for
the cases where the file on disk might be removed just to be regenerated
a bit later.

It also allows an IDE to provide in-memory files that might not exist on
disk, e.g. because the build system hasn't generated those yet.

Diff Detail

Event Timeline

nik created this revision.Nov 14 2018, 5:35 AM
nik abandoned this revision.Nov 14 2018, 5:38 AM