Home | History | Annotate | Download | only in www

Lines Matching full:clang

6   <title>Clang - Getting Started</title>
16 <h1>Getting Started: Building and Running Clang</h1>
18 <p>This page gives you the shortest path to checking out Clang and demos a few
21 involved</a> with the Clang community. If you run into problems, please file
24 <h2 id="download">Release Clang Versions</h2>
26 <p>Clang is released as part of regular LLVM releases. You can download the release versions from <a href="http://llvm.org/releases/">http://llvm.org/releases/</a>.</p>
27 <p>Clang is also provided in all major BSD or GNU/Linux distributions as part of their respective packaging systems. From Xcode 4.2, Clang is the default compiler for Mac OS X.</p>
29 <h2 id="build">Building Clang and Working with the Code</h2>
33 <p>If you would like to check out and build Clang, the current procedure is as
56 <li>Check out Clang:
59 <li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li>
63 <li>Check out extra Clang tools: (optional)
65 <li><tt>cd llvm/tools/clang/tools</tt></li>
66 <li><tt>svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk
87 <li>Build LLVM and Clang:
93 <li>This builds both LLVM and Clang for debug mode.</li>
94 <li>Note: For subsequent Clang development, you can just run
95 <tt>make clang</tt>.</li>
104 <li>If you intend to use Clang's C++ support, you may need to tell it how
105 to find your C++ standard library headers. In general, Clang will detect
108 adjacent to Clang itself. If your configuration fits neither of these
110 to tell Clang where the gcc containing the desired libstdc++ is installed.
114 <li><tt>clang --help</tt></li>
115 <li><tt>clang file.c -fsyntax-only</tt> (check for correctness)</li>
116 <li><tt>clang file.c -S -emit-llvm -o -</tt> (print out unoptimized llvm code)</li>
117 <li><tt>clang file.c -S -emit-llvm -o - -O3</tt></li>
118 <li><tt>clang file.c -S -O3 -o -</tt> (output native machine code)</li>
123 <p>If you encounter problems while building Clang, make sure that your LLVM
124 checkout is at the same revision as your Clang checkout. LLVM's interfaces
128 <h3>Simultaneously Building Clang and LLVM:</h3>
130 <p>Once you have checked out Clang into the llvm source tree it will build along
131 with the rest of <tt>llvm</tt>. To build all of LLVM and Clang together all at
134 <p><em>Note:</em> Observe that Clang is technically part of a separate
135 Subversion repository. As mentioned above, the latest Clang sources are tied to
143 <p>The following details setting up for and building Clang on Windows using
158 (which is essential, if you will be developing for clang).
177 <li>Check out Clang:
180 <li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li>
182 <p><em>Note</em>: Some Clang tests are sensitive to the line endings. Ensure
198 <li>Build Clang:
201 <li>Build the "clang" project for just the compiler driver and front end, or
208 Hacking on clang - Testing using Visual Studio on Windows</a> for information
212 <p>Note that once you have checked out both llvm and clang, to synchronize
214 llvm and llvm\tools\clang directories, as they are separate repositories.</p>
216 <h2 id="driver">Clang Compiler Driver (Drop-in Substitute for GCC)</h2>
218 <p>The <tt>clang</tt> tool is the compiler driver and front-end, which is
227 $ <b>clang t.c</b>
232 <p>The 'clang' driver is designed to work as closely to GCC as possible to
234 Clang defaults to gnu99 mode while GCC defaults to gnu89 mode. If you see
236 to clang.</p>
238 <h2>Examples of using Clang</h2>
255 $ <b>clang ~/t.c -E</b>
267 $ <b>clang -fsyntax-only ~/t.c</b>
274 $ <b>clang -fsyntax-only ~/t.c -pedantic</b>
286 Clang specific features which are not exposed through the GCC compatible driver
290 $ <b>clang -cc1 ~/t.c -ast-print</b>
301 $ <b>clang ~/t.c -S -emit-llvm -o -</b>
308 $ <b>clang -fomit-frame-pointer -O3 -S -o - t.c</b> <i># On x86_64</i>