Skip to content

Commit 26686c4

Browse files
committedJul 8, 2015
Update PCHInternals.rst to document PCH wrapped in object file containers.
llvm-svn: 241690
1 parent 2c345a3 commit 26686c4

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed
 

‎clang/docs/PCHInternals.rst

+18-8
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,30 @@ section <pchinternals-chained>`.
124124
AST File Contents
125125
-----------------
126126

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
129136
representation. Each of the blocks corresponds to either a block or a record
130137
within `LLVM's bitstream format <http://llvm.org/docs/BitCodeFormat.html>`_.
131138
The contents of each of these logical blocks are described below.
132139

133140
.. image:: PCHLayout.png
134141

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+
141151

142152
Metadata Block
143153
^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)
Please sign in to comment.