From: Douglas Gregor #define __STDC__ 1
" when we are compiling C
without Microsoft extensions. The predefines buffer itself is stored
within the source manager block, but its
-contents are verified along with the rest of the metadata.Source Manager Block
@@ -274,6 +276,24 @@ the name-lookup and iteration behavior described above:
Statements and expressions are stored in the precompiled header in +both the types and the declarations blocks, because every statement or +expression will be associated with either a type or declaration. The +actual statement and expression records are stored immediately +following the declaration or type that owns the statement or +expression. For example, the statement representing the body of a +function will be stored directly following the declaration of the +function.
+ +As with types and declarations, each statement and expression kind
+in Clang's abstract syntax tree (ForStmt
,
+CallExpr
, etc.) has a corresponding record type in the
+precompiled header, which contains the serialized representation of
+that statement or expression.
The identifier table block contains an on-disk hash table that maps @@ -299,14 +319,36 @@ contains:
mechanism introduces itself into the identifier table as an external lookup source. Thus, when the user program refers to an identifier that has not yet been seen, Clang will perform a lookup into the -on-disk hash table ... FINISH THIS! +identifier table. If an identifier is found, its contents---macro definitions, flags, top-level declarations, etc.---will be deserialized, at which point the correspondingIdentifierInfo
structure will have the same contents it would have after parsing the headers in the precompiled header.
-A separate table provides a mapping from the numeric representation -of identifiers used in the PCH file to the location within the on-disk +
Within the PCH file, the identifiers used to name declarations are represented with an integral value. A separate table provides a mapping from this integral value (the identifier ID) to the location within the on-disk hash table where that identifier is stored. This mapping is used when deserializing the name of a declaration, the identifier of a token, or any other construct in the PCH file that refers to a name.
+The method pool block is represented as an on-disk hash table that
+serves two purposes: it provides a mapping from the names of
+Objective-C selectors to the set of Objective-C instance and class
+methods that have that particular selector (which is required for
+semantic analysis in Objective-C) and also stores all of the selectors
+used by entities within the precompiled header. The design of the
+method pool is similar to that of the identifier
+table: the first time a particular selector is formed during the
+compilation of the program, Clang will search in the on-disk hash
+table of selectors; if found, Clang will read the Objective-C methods
+associated with that selector into the appropriate front-end data
+structure (Sema::InstanceMethodPool
and
+Sema::FactoryMethodPool
for instance and class methods,
+respectively).
As with identifiers, selectors are represented by numeric values +within the PCH file. A separate index maps these numeric selector +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.
+