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 has been released as part of regular LLVM releases since LLVM 2.6. You
30 <h2 id="build">Building Clang and Working with the Code</h2>
34 <p>If you would like to check out and build Clang, the current procedure is as
53 <li>Checkout Clang:</li>
56 <li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li>
58 <li>Build LLVM and Clang:</li>
66 <li>This builds both LLVM and Clang for debug mode.</li>
67 <li>Note: For subsequent Clang development, you can just do make at the
68 clang directory level.</li>
75 <li>If you intend to work on Clang C++ support, you may need to tell it how
76 to find your C++ standard library headers. If Clang cannot find your
82 hard-coded paths" in <tt>clang/lib/Frontend/InitHeaderSearch.cpp</tt> and
87 <li><tt>clang --help</tt></li>
88 <li><tt>clang file.c -fsyntax-only</tt> (check for correctness)</li>
89 <li><tt>clang file.c -S -emit-llvm -o -</tt> (print out unoptimized llvm code)</li>
90 <li><tt>clang file.c -S -emit-llvm -o - -O3</tt></li>
91 <li><tt>clang file.c -S -O3 -o -</tt> (output native machine code)</li>
96 encounter problems with building Clang, make sure you have the latest SVN
97 version of LLVM. LLVM contains support libraries for Clang that will be updated
98 as well as development on Clang progresses.</p>
100 <h3>Simultaneously Building Clang and LLVM:</h3>
102 <p>Once you have checked out Clang into the llvm source tree it will build along
103 with the rest of <tt>llvm</tt>. To build all of LLVM and Clang together all at
106 <p><em>Note:</em> Observe that Clang is technically part of a separate
107 Subversion repository. As mentioned above, the latest Clang sources are tied to
115 <p>The following details setting up for and building Clang on Windows using
130 (which is essential, if you will be developing for clang).
147 <li>Checkout Clang:</li>
150 <li><tt>svn co http://llvm.org/svn/llvm-project/cfe/trunk clang</tt></li>
170 <li>Build Clang:</li>
173 <li>Build the "clang" project for just the compiler driver and front end, or
179 Hacking on clang - Testing using Visual Studio on Windows</a> for information
183 <p>Note that once you have checked out both llvm and clang, to synchronize
185 llvm and llvm\tools\clang directories, as they are separate repositories.</p>
187 <a name="driver"><h2>Clang Compiler Driver (Drop-in Substitute for GCC)</h2></a>
189 <p>The <tt>clang</tt> tool is the compiler driver and front-end, which is
198 $ <b>clang t.c</b>
203 <p>The 'clang' driver is designed to work as closely to GCC as possible to
205 Clang defaults to gnu99 mode while GCC defaults to gnu89 mode. If you see
207 to clang.</p>
209 <h2>Examples of using Clang</h2>
226 $ <b>clang ~/t.c -E</b>
238 $ <b>clang -fsyntax-only ~/t.c</b>
245 $ <b>clang -fsyntax-only ~/t.c -pedantic</b>
257 Clang specific features which are not exposed through the GCC compatible driver
261 $ <b>clang -cc1 ~/t.c -ast-print</b>
272 $ <b>clang ~/t.c -S -emit-llvm -o -</b>
279 $ <b>clang -fomit-frame-pointer -O3 -S -o - t.c</b> <i># On x86_64</i>