From: Ted Kremenek Date: Thu, 9 Apr 2009 18:17:39 +0000 (+0000) Subject: More cleanups. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7fd6b004bcab31e3d6a07a1e5e936f8e793aa68;p=clang More cleanups. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68718 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/PTHInternals.html b/docs/PTHInternals.html index 3f0927338f..c18ce4b884 100644 --- a/docs/PTHInternals.html +++ b/docs/PTHInternals.html @@ -38,17 +38,26 @@ interface for using PTH and then briefly elaborates on their design and implementation.

-

Using Pretokenized Headers (High-level Interface)

+

Using Pretokenized Headers with clang

-

The high-level interface to generate a PTH file is the same as GCC's:

+

The high-level clang driver supports an interface to use PTH files +that is similar to GCC's interface for precompiled headers.

+ +

Generating a PTH File

+ +

To generate a PTH file using clang, one invokes clang using +the -x lang-header option. This mirrors the interface in GCC for +generating PCH files:

   $ gcc -x c-header test.h -o test.h.gch
   $ clang -x c-header test.h -o test.h.pth
 
-

A PTH file can then be used as a prefix header when a -include -option is passed to clang:

+

Using a PTH File

+ +

A PTH file can then be used as a prefix header when a +-include option is passed to clang:

   $ clang -include test.h test.c -o test
@@ -74,19 +83,19 @@ for headers that are directly included within a source file. For example:

test.h since test.h was included directly in the source file and not specified on the command line using -include.

-

Using Pretokenized Headers (Low-level Interface)

+

Using Pretokenized Headers with clang-cc (Low-level Interface)

The low-level Clang compiler tool, clang-cc, supports three command line options for generating and using PTH files.

-

To generate PTH files using clang-cc, use the option -emit-pth: - -

-  $ clang-cc test.h -emit-pth -o test.h.pth
-
+

To generate PTH files using clang-cc, use the option +-emit-pth: + +

 $ clang-cc test.h -emit-pth -o test.h.pth 

This option is transparently used by clang when generating PTH -files. Similarly, PTH files can be used as prefix headers using the -include-pth option:

+files. Similarly, PTH files can be used as prefix headers using the +-include-pth option:

   $ clang-cc -include-pth test.h.pth test.c -o test.s
@@ -96,7 +105,8 @@ files.  Similarly, PTH files can be used as prefix headers using the -includ
 (or "content" cache) of the source included by the original header
 file. This means that the contents of the PTH file are searched as substitutes
 for any source files that are used by clang-cc to process a
-source file. This is done by specifying the -token-cache option:

+source file. This is done by specifying the -token-cache +option:

   $ cat test.h
@@ -173,7 +183,7 @@ also modifies those pages in memory, incurring the copy-on-write costs. The
 read-only nature of PTH can greatly reduce memory pressure for builds involving
 multiple cores, thus improving overall scalability.

-
  • Fast generation: PTH files can be generated in a small fraction +

  • Fast generation: PTH files can be generated in a small fraction of the time needed to generate GCC's PCH files. Since PTH/PCH generation is a serial operation that typically blocks progress during a build, faster generation time leads to improved processor utilization with parallel builds on