From: Douglas Gregor Date: Wed, 3 Jun 2009 21:41:31 +0000 (+0000) Subject: Document the integration points for precompiled headers X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0084ead1f867b745d13121b2560441e355cb347b;p=clang Document the integration points for precompiled headers git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72809 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/PCHInternals.html b/docs/PCHInternals.html index 7c0c1403fa..74ef403808 100644 --- a/docs/PCHInternals.html +++ b/docs/PCHInternals.html @@ -33,7 +33,8 @@
  • Method Pool Block
  • - +
  • Precompiled Header Integration Points
  • +

    Using Precompiled Headers with clang-cc

    @@ -393,7 +394,59 @@ values to the offset of the selector within the on-disk hash table, and will be used when de-serializing an Objective-C method declaration (or other Objective-C construct) that refers to the selector.

    -

    +

    Precompiled Header Integration Points

    + +

    The "lazy" deserialization behavior of precompiled headers requires +their integration into several completely different submodules of +Clang. For example, lazily deserializing the declarations during name +lookup requires that the name-lookup routines be able to query the +precompiled header to find entities within the PCH file.

    + +

    For each Clang data structure that requires direct interaction with +the precompiled header logic, there is an abstract class that provides +the interface between the two modules. The PCHReader +class, which handles the loading of a precompiled header, inherits +from all of these abstract classes to provide lazy deserialization of +Clang's data structures. PCHReader implements the +following abstract classes:

    + +
    +
    StatSysCallCache
    +
    This abstract interface is associated with the + FileManager class, and is used whenever the file + manager is going to perform a stat() system call.
    + +
    ExternalSLocEntrySource
    +
    This abstract interface is associated with the + SourceManager class, and is used whenever the + source manager needs to load the details + of a file, buffer, or macro instantiation.
    + +
    IdentifierInfoLookup
    +
    This abstract interface is associated with the + IdentifierTable class, and is used whenever the + program source refers to an identifier that has not yet been seen. + In this case, the precompiled header implementation searches for + this identifier within its identifier table + to load any top-level declarations or macros associated with that + identifier.
    + +
    ExternalASTSource
    +
    This abstract interface is associated with the + ASTContext class, and is used whenever the abstract + syntax tree nodes need to loaded from the precompiled header. It + provides the ability to de-serialize declarations and types + identified by their numeric values, read the bodies of functions + when required, and read the declarations stored within a + declaration context (either for iteration or for name lookup).
    + +
    ExternalSemaSource
    +
    This abstract interface is associated with the Sema + class, and is used whenever semantic analysis needs to read + information from the global method + pool.
    +
    +