Skip to content
Snippets Groups Projects
Commit 86d3ca53 authored by Argyrios Kyrtzidis's avatar Argyrios Kyrtzidis
Browse files

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
parent 1034170d
No related branches found
No related tags found
No related merge requests found
...@@ -391,23 +391,23 @@ precompiled header, which contains the serialized representation of ...@@ -391,23 +391,23 @@ precompiled header, which contains the serialized representation of
that statement or expression. Each substatement or subexpression that statement or expression. Each substatement or subexpression
within an expression is stored as a separate record (which keeps most within an expression is stored as a separate record (which keeps most
records to a fixed size). Within the precompiled header, the 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 <a that owns those expression, using a form of <a
href="http://en.wikipedia.org/wiki/Reverse_Polish_notation">Reverse href="http://en.wikipedia.org/wiki/Reverse_Polish_notation">Reverse
Polish Notation</a>. For example, an expression <code>3 - 4 + 5</code> Polish Notation</a>. For example, an expression <code>3 - 4 + 5</code>
would be represented as follows:</p> would be represented as follows:</p>
<table border="1"> <table border="1">
<tr><td><code>IntegerLiteral(3)</code></td></tr> <tr><td><code>IntegerLiteral(5)</code></td></tr>
<tr><td><code>IntegerLiteral(4)</code></td></tr> <tr><td><code>IntegerLiteral(4)</code></td></tr>
<tr><td><code>IntegerLiteral(3)</code></td></tr>
<tr><td><code>BinaryOperator(-)</code></td></tr> <tr><td><code>BinaryOperator(-)</code></td></tr>
<tr><td><code>IntegerLiteral(5)</code></td></tr>
<tr><td><code>BinaryOperator(+)</code></td></tr> <tr><td><code>BinaryOperator(+)</code></td></tr>
<tr><td>STOP</td></tr> <tr><td>STOP</td></tr>
</table> </table>
<p>When reading this representation, Clang evaluates each expression <p>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 <i>N</i> and then pushes that expression on to a stack. When a record contains <i>N</i>
subexpressions--<code>BinaryOperator</code> has two of them--those subexpressions--<code>BinaryOperator</code> has two of them--those
expressions are popped from the top of the stack. The special STOP expressions are popped from the top of the stack. The special STOP
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment