Mercurial > hg > CbC > CbC_llvm
comparison tools/clang/docs/PCHInternals.rst @ 95:afa8332a0e37 LLVM3.8
LLVM 3.8
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 13 Oct 2015 17:48:58 +0900 |
parents | 95c75e76d11b |
children | 1172e4bd9c6f |
comparison
equal
deleted
inserted
replaced
84:f3e34b893a5f | 95:afa8332a0e37 |
---|---|
122 section <pchinternals-chained>`. | 122 section <pchinternals-chained>`. |
123 | 123 |
124 AST File Contents | 124 AST File Contents |
125 ----------------- | 125 ----------------- |
126 | 126 |
127 Clang's AST files are organized into several different blocks, each of which | 127 An AST file produced by clang is an object file container with a ``clangast`` |
128 contains the serialized representation of a part of Clang's internal | 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 representation. Each of the blocks corresponds to either a block or a record | 136 representation. Each of the blocks corresponds to either a block or a record |
130 within `LLVM's bitstream format <http://llvm.org/docs/BitCodeFormat.html>`_. | 137 within `LLVM's bitstream format <http://llvm.org/docs/BitCodeFormat.html>`_. |
131 The contents of each of these logical blocks are described below. | 138 The contents of each of these logical blocks are described below. |
132 | 139 |
133 .. image:: PCHLayout.png | 140 .. image:: PCHLayout.png |
134 | 141 |
135 For a given AST file, the `llvm-bcanalyzer | 142 The ``llvm-objdump`` utility provides a ``-raw-clang-ast`` option to extract the |
136 <http://llvm.org/docs/CommandGuide/llvm-bcanalyzer.html>`_ utility can be used | 143 binary contents of the AST section from an object file container. |
137 to examine the actual structure of the bitstream for the AST file. This | 144 |
138 information can be used both to help understand the structure of the AST file | 145 The `llvm-bcanalyzer <http://llvm.org/docs/CommandGuide/llvm-bcanalyzer.html>`_ |
139 and to isolate areas where AST files can still be optimized, e.g., through the | 146 utility can be used to examine the actual structure of the bitstream for the AST |
140 introduction of abbreviations. | 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 Metadata Block | 152 Metadata Block |
143 ^^^^^^^^^^^^^^ | 153 ^^^^^^^^^^^^^^ |
144 | 154 |
145 The metadata block contains several records that provide information about how | 155 The metadata block contains several records that provide information about how |