HomePhabricator

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

Description

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

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.

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

Details

Committed
nikMay 21 2019, 12:26 AM
Differential Revision
D41005: Reuse preamble even if an unsaved file does not exist
Parents
rL361225: [clang-tidy] New option for misc-throw-by-value-catch-by-reference
Branches
Unknown
Tags
Unknown