[PATCH] D41005: Reuse preamble even if an unsaved file does not exist
Nikolai Kosjar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 8 06:17:57 PST 2017
nik created this revision.
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.
Repository:
rC Clang
https://reviews.llvm.org/D41005
Files:
include/clang/Frontend/ASTUnit.h
include/clang/Frontend/PrecompiledPreamble.h
lib/Frontend/ASTUnit.cpp
lib/Frontend/PrecompiledPreamble.cpp
unittests/Frontend/PCHPreambleTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41005.126134.patch
Type: text/x-patch
Size: 5941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171208/18b587b4/attachment-0001.bin>
More information about the cfe-commits
mailing list