Add an option to allow Clang verify source files for a module only once during

Press ? to show keyboard shortcuts.
Committed
gribozavrFeb 12 2014, 2:33 AM
Parents
rL201223: [ARM] Fix NEON wrongly being enabled with soft-float when targeting…
Branches
Unknown
Tags
Unknown
Description

Add an option to allow Clang verify source files for a module only once during
the build

When Clang loads the module, it verifies the user source files that the module
was built from. If any file was changed, the module is rebuilt. There are two
problems with this:

  1. correctness: we don't verify system files (there are too many of them, and stat'ing all of them would take a lot of time);
  2. performance: the same module file is verified again and again during a single build.

This change 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,
-fbuild-session-timestamp=, to inform Clang of the time when the build started.
The build system also requests to enable this feature by passing
-fmodules-validate-once-per-build-session. If these flags are 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.

rL201224

cfe/trunk/include/clang-c/Index.h

Loading...

cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td

Loading...

cfe/trunk/include/clang/Driver/Options.td

Loading...

cfe/trunk/include/clang/Frontend/Utils.h

Loading...

cfe/trunk/include/clang/Lex/HeaderSearchOptions.h

Loading...

cfe/trunk/include/clang/Serialization/Module.h

Loading...

cfe/trunk/lib/Driver/Tools.cpp

Loading...

cfe/trunk/lib/Frontend/CompilerInstance.cpp

Loading...

cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Loading...

cfe/trunk/lib/Serialization/ASTReader.cpp

Loading...

cfe/trunk/lib/Serialization/ModuleManager.cpp

Loading...

cfe/trunk/test/Driver/modules.m

Loading...

cfe/trunk/tools/c-index-test/c-index-test.c

Loading...

cfe/trunk/tools/libclang/CMakeLists.txt

Loading...

cfe/trunk/tools/libclang/libclang.exports

Loading...

Add Comment