From: Argyrios Kyrtzidis Date: Mon, 13 Sep 2010 17:48:02 +0000 (+0000) Subject: Update 'docs/PCHInternals.html' about how subexpressions are stored. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86d3ca5317ac777b6c54c633e568926be3dcee47;p=clang Update 'docs/PCHInternals.html' about how subexpressions are stored. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113760 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/PCHInternals.html b/docs/PCHInternals.html index 109d5ed025..d46ae5ceec 100644 --- a/docs/PCHInternals.html +++ b/docs/PCHInternals.html @@ -391,23 +391,23 @@ precompiled header, which contains the serialized representation of 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 +subexpressions of an expression are stored, in reverse order, 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(5)
IntegerLiteral(4)
IntegerLiteral(3)
BinaryOperator(-)
IntegerLiteral(5)
BinaryOperator(+)
STOP

When reading this representation, Clang evaluates each expression -record it encounters, builds the appropriate abstract synax tree node, +record it encounters, builds the appropriate abstract syntax 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