[PATCH] Verify source files for a module only once during the build

Argyrios Kyrtzidis kyrtzidis at apple.com
Fri Feb 7 09:26:59 PST 2014


On Feb 7, 2014, at 9:21 AM, Jordan Rose <jordan_rose at apple.com> wrote:

> 
> On Feb 7, 2014, at 6:07 , Dmitri Gribenko <gribozavr at gmail.com> wrote:
> 
>> The attached patch allows the build system to optimize source file
>> verification.  The idea is based on the fact that while the project is
>> being built, the source files don't change.  This allows us to verify
>> the module only once during a single build session.  The build system
>> passes a flag, fmodules-skip-verify-if-validated-after=, to inform
>> Clang of the time when the build started (if this flag is not passed,
>> the behavior is not changed).  When Clang verifies the module the
>> first time, it writes out a timestamp file.  Then, when Clang loads
>> the module the second time, it finds a timestamp file, so it can
>> compare the verification timestamp of the module with the time when
>> the build started.  If the verification timestamp is too old, the
>> module is verified again, and the timestamp file is updated.
> 
> The source files usually don't change, but I've certainly edited some during the build once I "know" they don't affect any of the downstream targets. I'm fine with this being unspecified behavior, but will we end up with a crash if things are inconsistent, or just a compiler or linker error?

Most likely a build error about “file was modified since the precompiled header..."

> 
> Jordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140207/a1c3b387/attachment.html>


More information about the cfe-commits mailing list