[cfe-commits] r69569 - in /cfe/trunk/docs: PTHInternals.html UsersManual.html

Chris Lattner sabre at nondot.org
Sun Apr 19 21:37:38 PDT 2009


Author: lattner
Date: Sun Apr 19 23:37:38 2009
New Revision: 69569

URL: http://llvm.org/viewvc/llvm-project?rev=69569&view=rev
Log:
slurp some content from the PTH doc into the user's doc.

Modified:
    cfe/trunk/docs/PTHInternals.html
    cfe/trunk/docs/UsersManual.html

Modified: cfe/trunk/docs/PTHInternals.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/PTHInternals.html?rev=69569&r1=69568&r2=69569&view=diff

==============================================================================
--- cfe/trunk/docs/PTHInternals.html (original)
+++ cfe/trunk/docs/PTHInternals.html Sun Apr 19 23:37:38 2009
@@ -14,73 +14,14 @@
 <!--#include virtual="../menu.html.incl"-->
 
 <div id="content">
-<h1>Pretokenized Headers</h1>
 
-<p> <a href="http://en.wikipedia.org/wiki/Precompiled_header">Precompiled
-headers</a> are a general approach employed by many compilers to reduce
-compilation time. The underlying motivation of the approach is that it is
-common for the same (and often large) header files to be included by
-multiple source files. Consequently, compile times can often be greatly improved
-by caching some of the (redundant) work done by a compiler to process headers.
-Precompiled header files, which represent one of many ways to implement
-this optimization, are literally files that represent an on-disk cache that
-contains the vital information necessary to reduce some (or all) of the work
-needed to process a corresponding header file. While details of precompiled
-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. This first describes the interface
-for using PTH and then briefly elaborates on its design and implementation.</p>
-
-
-<h2>Using Pretokenized Headers with <tt>clang</tt></h2>
-
-<p>The high-level <tt>clang</tt> driver supports an interface to use PTH files
-that is similar to GCC's interface for precompiled headers.</p>
-
-<h3>Generating a PTH File</h3>
-
-<p>To generate a PTH file using <tt>clang</tt>, one invokes <tt>clang</tt> using
-the <b><tt>-x <i><language></i>-header</tt></b> option. This mirrors the
-interface in GCC for generating PCH files:</p>
+<h1>Pretokenized Headers (PTH)</h1>
 
-<pre>
-  $ gcc -x c-header test.h -o test.h.gch
-  $ clang -x c-header test.h -o test.h.pth
-</pre>
-
-<h3>Using a PTH File</h3>
-
-<p>A PTH 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>
-is available; if so, the contents of <tt>test.h</tt> (and the files it includes)
-will be processed from the PTH file. Otherwise, <tt>clang</tt> falls back to
-directly processing the content of <tt>test.h</tt>. This mirrors the behavior of
-GCC.</p>
-
-<p><b>NOTE:</b> <tt>clang</tt> does <em>not</em> automatically used PTH 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
-  $ cat test.c
-  #include "test.h"
-  $ clang test.c -o test
-</pre>
+<p>This document first describes the low-level
+interface for using PTH and then briefly elaborates on its design and
+implementation.  If you are interested in the end-user view, please see the
+<a href="UsersManual.html#precompiledheaders">User's Manual</a>.</p>
 
-<p>In this example, <tt>clang</tt> will not automatically use the PTH 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>
 
 <h2>Using Pretokenized Headers with <tt>clang-cc</tt> (Low-level Interface)</h2>
 

Modified: cfe/trunk/docs/UsersManual.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/UsersManual.html?rev=69569&r1=69568&r2=69569&view=diff

==============================================================================
--- cfe/trunk/docs/UsersManual.html (original)
+++ cfe/trunk/docs/UsersManual.html Sun Apr 19 23:37:38 2009
@@ -180,6 +180,66 @@
 <h3 id="precompiledheaders">Precompiled Headers</h3>
 <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = -->
 
+<p><a href="http://en.wikipedia.org/wiki/Precompiled_header">Precompiled
+headers</a> are a general approach employed by many compilers to reduce
+compilation time. The underlying motivation of the approach is that it is
+common for the same (and often large) header files to be included by
+multiple source files. Consequently, compile times can often be greatly improved
+by caching some of the (redundant) work done by a compiler to process headers.
+Precompiled header files, which represent one of many ways to implement
+this optimization, are literally files that represent an on-disk cache that
+contains the vital information necessary to reduce some of the work
+needed to process a corresponding header file. While details of precompiled
+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 PTH File</h4>
+
+<p>To generate a PTH 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
+</pre>
+
+<h4>Using a PTH File</h4>
+
+<p>A PTH 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>
+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
+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 used PTH 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
+  $ 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
+<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>
 
 
 <!-- ======================================================================= -->





More information about the cfe-commits mailing list