From: Douglas Gregor
The metadata block contains several records that provide information about how the precompiled header was built. This metadata is primarily used to validate the use of a precompiled header. For -example, a precompiled header built for x86 (32-bit) cannot be used -when compiling for x86-64 (64-bit). The metadata block contains +example, a precompiled header built for a 32-bit x86 target cannot be used +when compiling for a 64-bit x86 target. The metadata block contains information about:
ForStmt
,
CallExpr
, etc.) has a corresponding record type in the
precompiled header, which contains the serialized representation of
-that statement or expression.
+that statement or expression. Each substatement or subexpression
+within an expression is stored as a separate record (which keeps most
+records to a fixed size). Within the precompiled header, the
+subexpressions of an expression are stored prior to the expression
+that owns those expression, using a form of Reverse
+Polish Notation. For example, an expression 3 - 4 + 5
+would be represented as follows:
+
+IntegerLiteral(3) |
IntegerLiteral(4) |
BinaryOperator(-) |
IntegerLiteral(5) |
BinaryOperator(+) |
STOP |
When reading this representation, Clang evaluates each expression
+record it encounters, builds the appropriate abstract synax tree node,
+and then pushes that expression on to a stack. When a record contains N
+subexpressions--BinaryOperator
has two of them--those
+expressions are popped from the top of the stack. The special STOP
+code indicates that we have reached the end of a serialized expression
+or statement; other expression or statement records may follow, but
+they are part of a different expression.