diff --git a/clang/docs/PCHInternals.html b/clang/docs/PCHInternals.html index d90c446e9f29..ef1dd37b5555 100644 --- a/clang/docs/PCHInternals.html +++ b/clang/docs/PCHInternals.html @@ -63,9 +63,250 @@ with the -include-pch option:
PCH file generation serializes the build when all compilations require the PCH file to be up-to-date. + +Clang's precompiled headers are designed with a compact on-disk +representation, which minimizes both PCH creation time and the time +required to initially load the PCH file. The PCH file itself contains +a serialized representation of Clang's abstract syntax trees and +supporting data structures, stored using the same compressed bitstream +as LLVM's bitcode +file format.
+ +Clang's precompiled headers are loaded "lazily" from disk. When a +PCH file is initially loaded, Clang reads only a small amount of data +from the PCH file to establish where certain important data structures +are stored. The amount of data read in this initial load is +independent of the size of the PCH file, such that a larger PCH file +does not lead to longer PCH load times. The actual header data in the +PCH file--macros, functions, variables, types, etc.--is loaded only +when it is referenced from the user's code, at which point only that +entity (and those entities it depends on) are deserialized from the +PCH file. With this approach, the cost of using a precompiled header +for a translation unit is proportional to the amount of code actually +used from the header, rather than being proportional to the size of +the header itself.