@@ -124,20 +124,30 @@ section <pchinternals-chained>`.
124
124
AST File Contents
125
125
-----------------
126
126
127
- Clang's AST files are organized into several different blocks, each of which
128
- contains the serialized representation of a part of Clang's internal
127
+ An AST file produced by clang is an object file container with a ``clangast ``
128
+ (COFF) or ``__clangast `` (ELF and Mach-O) section containing the serialized AST.
129
+ Other target-specific sections in the object file container are used to hold
130
+ debug information for the data types defined in the AST. Tools built on top of
131
+ libclang that do not need debug information may also produce raw AST files that
132
+ only contain the serialized AST.
133
+
134
+ The ``clangast `` section is organized into several different blocks, each of
135
+ which contains the serialized representation of a part of Clang's internal
129
136
representation. Each of the blocks corresponds to either a block or a record
130
137
within `LLVM's bitstream format <http://llvm.org/docs/BitCodeFormat.html >`_.
131
138
The contents of each of these logical blocks are described below.
132
139
133
140
.. image :: PCHLayout.png
134
141
135
- For a given AST file, the `llvm-bcanalyzer
136
- <http://llvm.org/docs/CommandGuide/llvm-bcanalyzer.html> `_ utility can be used
137
- to examine the actual structure of the bitstream for the AST file. This
138
- information can be used both to help understand the structure of the AST file
139
- and to isolate areas where AST files can still be optimized, e.g., through the
140
- introduction of abbreviations.
142
+ The ``llvm-objdump `` utility provides a ``-raw-clang-ast `` option to extract the
143
+ binary contents of the AST section from an object file container.
144
+
145
+ The `llvm-bcanalyzer <http://llvm.org/docs/CommandGuide/llvm-bcanalyzer.html >`_
146
+ utility can be used to examine the actual structure of the bitstream for the AST
147
+ section. This information can be used both to help understand the structure of
148
+ the AST section and to isolate areas where the AST representation can still be
149
+ optimized, e.g., through the introduction of abbreviations.
150
+
141
151
142
152
Metadata Block
143
153
^^^^^^^^^^^^^^
0 commit comments