summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-20 04:37:38 +0000
committerChris Lattner <sabre@nondot.org>2009-04-20 04:37:38 +0000
commit5c3074f3cd4c33e30c55e851a3ecf21ebec0769e (patch)
treed0b5ca4e1acb7c34e4331e34d4574e1bee79cefe /docs
parentcf17d9d9c0c0c931478807cc020c8ab1c2cc296a (diff)
slurp some content from the PTH doc into the user's doc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/PTHInternals.html69
-rw-r--r--docs/UsersManual.html60
2 files changed, 65 insertions, 64 deletions
diff --git a/docs/PTHInternals.html b/docs/PTHInternals.html
index 2d2e1e3e1b..832d3b0a97 100644
--- a/docs/PTHInternals.html
+++ b/docs/PTHInternals.html
@@ -14,74 +14,15 @@
<!--#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>
+<h1>Pretokenized Headers (PTH)</h1>
-<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>
+<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>
-<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>&lt;language&gt;</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>
-
-<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>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>
<p>The low-level Clang compiler tool, <tt>clang-cc</tt>, supports three command
diff --git a/docs/UsersManual.html b/docs/UsersManual.html
index 8f8951f87e..cfed51a202 100644
--- a/docs/UsersManual.html
+++ b/docs/UsersManual.html
@@ -180,6 +180,66 @@ other high level options like -c, -g, etc.
<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>&lt;language&gt;</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>
<!-- ======================================================================= -->