diff options
Diffstat (limited to 'docs/UsersManual.html')
-rw-r--r-- | docs/UsersManual.html | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/docs/UsersManual.html b/docs/UsersManual.html index 3f48c4abe6f9..e7072da9fdf1 100644 --- a/docs/UsersManual.html +++ b/docs/UsersManual.html @@ -431,50 +431,43 @@ headers vary between compilers, precompiled headers have been shown to be a highly effective at speeding up program compilation on systems with very large system headers (e.g., Mac OS/X).</p> -<p>Clang supports an implementation of precompiled headers known as -<em>pre-tokenized headers</em> (PTH). Clang's pre-tokenized headers support most -of same interfaces as GCC's pre-compiled headers (as well as others) but are -completely different in their implementation. If you are interested in how -PTH is implemented, please see the <a href="PTHInternals.html">PTH Internals - document</a>.</p> +<h4>Generating a PCH File</h4> -<h4>Generating a PTH File</h4> - -<p>To generate a PTH file using Clang, one invokes Clang with +<p>To generate a PCH file using Clang, one invokes Clang with the <b><tt>-x <i><language></i>-header</tt></b> option. This mirrors the interface in GCC for generating PCH files:</p> <pre> $ gcc -x c-header test.h -o test.h.gch - $ clang -x c-header test.h -o test.h.pth + $ clang -x c-header test.h -o test.h.pch </pre> -<h4>Using a PTH File</h4> +<h4>Using a PCH File</h4> -<p>A PTH file can then be used as a prefix header when a +<p>A PCH file can then be used as a prefix header when a <b><tt>-include</tt></b> option is passed to <tt>clang</tt>:</p> <pre> $ clang -include test.h test.c -o test </pre> -<p>The <tt>clang</tt> driver will first check if a PTH file for <tt>test.h</tt> +<p>The <tt>clang</tt> driver will first check if a PCH file for <tt>test.h</tt> is available; if so, the contents of <tt>test.h</tt> (and the files it includes) -will be processed from the PTH file. Otherwise, Clang falls back to +will be processed from the PCH file. Otherwise, Clang falls back to directly processing the content of <tt>test.h</tt>. This mirrors the behavior of GCC.</p> -<p><b>NOTE:</b> Clang does <em>not</em> automatically use PTH files +<p><b>NOTE:</b> Clang does <em>not</em> automatically use PCH files for headers that are directly included within a source file. For example:</p> <pre> - $ clang -x c-header test.h -o test.h.pth + $ clang -x c-header test.h -o test.h.cth $ cat test.c #include "test.h" $ clang test.c -o test </pre> -<p>In this example, <tt>clang</tt> will not automatically use the PTH file for +<p>In this example, <tt>clang</tt> will not automatically use the PCH file for <tt>test.h</tt> since <tt>test.h</tt> was included directly in the source file and not specified on the command line using <tt>-include</tt>.</p> @@ -607,6 +600,12 @@ in structures. This is for a few of reasons: one, it is tricky to implement, two, the extension is completely undocumented, and three, the extension appears to be very rarely used.</p> +<p>clang does not support duplicate definitions of a function where one is +inline. This complicates clients of the AST which normally can expect there is +at most one definition for each function. Source code using this feature should +be changed to define the inline and out-of-line definitions in separate +translation units.</p> + <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> <h3 id="c_ms">Microsoft extensions</h3> <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> |