Lines Matching +full:check +full:- +full:docs +full:- +full:build

1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
5 <META http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>Clang - Getting Started</title>
12 <!--#include virtual="menu.html.incl"-->
22 bugs on <a href="https://github.com/llvm/llvm-project/issues">the LLVM bug tracker</a>.</p>
29 <h2 id="build">Building Clang and Working with the Code</h2>
31 <h3 id="buildNix">On Unix-like Systems</h3>
33 <p>If you would like to check out and build Clang, the current procedure is as
40 <a href="https://llvm.org/docs/GettingStarted.html#requirements">
41 Getting Started with the LLVM System - Requirements</a>.</li>
45 <li>Standard build process uses CMake. Get it at:
50 <li>Check out the LLVM project:
53 <li><tt>git clone https://github.com/llvm/llvm-project.git</tt></li>
56 …<li><tt>git clone --depth=1 https://github.com/llvm/llvm-project.git (using this only the latest v…
59 <li><tt>cd llvm-project</tt></li>
60 <li><tt>git fetch --unshallow</tt></li>
67 <li>Build LLVM and Clang:
69 <li><tt>cd llvm-project</tt></li>
70 <li><tt>mkdir build</tt> (in-tree build is not supported)</li>
71 <li><tt>cd build</tt></li>
73 you need a debug build, switch Release to Debug. See
74 …<a href="https://llvm.org/docs/CMake.html#frequently-used-cmake-variables">frequently used cmake v…
77 …<li><tt>cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm<…
82 Eclipse CDT4, CodeBlocks, Qt-Creator (use the CodeBlocks generator),
84 <a href="https://llvm.org/docs/CMake.html">Building LLVM with CMake</a>
91 well-known GCC installation paths matching the target triple (configured at
92 build time (see <tt>clang --version</tt>); overriden by
93 <tt>--target=</tt>) and use the largest version. If your configuration fits
94 none of the standard scenarios, you can set <tt>--gcc-install-dir=</tt> to
98 <tt>--gcc-triple=$triple</tt>.
100 <li>Try it out (assuming you add llvm/build/bin to your path):
102 <li><tt>clang --help</tt></li>
103 <li><tt>clang file.c -fsyntax-only</tt> (check for correctness)</li>
104 <li><tt>clang file.c -S -emit-llvm -o -</tt> (print out unoptimized llvm code)</li>
105 <li><tt>clang file.c -S -emit-llvm -o - -O3</tt></li>
106 <li><tt>clang file.c -S -O3 -o -</tt> (output native machine code)</li>
111 <li><tt>make check-clang</tt></li>
125 <a href="https://git-scm.com/download">
126 https://git-scm.com/download</a></li>
138 are the oldest and most well-tested way to get these tools. However, the
147 <li>Check out LLVM and Clang:
149 <li><tt>git clone https://github.com/llvm/llvm-project.git</tt></li>
158 <li><tt>cd llvm-project</tt></li>
159 <li><tt>mkdir build</tt> (for building without polluting the source dir)</li>
160 <li><tt>cd build</tt></li>
163 …<tt>cmake -DLLVM_ENABLE_PROJECTS=clang -G "Visual Studio 16 2019" -A x64 -Thost=x64 ..\llvm</tt><b…
164 <tt>-Thost=x64</tt> is required, since the 32-bit linker will run out of memory.
166 <li>To generate x86 binaries instead of x64, pass <tt>-A Win32</tt>.</li>
167 <li>See the <a href="https://www.llvm.org/docs/CMake.html">LLVM CMake guide</a> for
170 <tt>build</tt> directory.
173 <li>Build Clang:
176 <li>Build the "clang" project for just the compiler driver and front end, or
177 the "ALL_BUILD" project to build everything, including tools.</li>
183 Hacking on clang - Testing using Visual Studio on Windows</a> for information
190 <a href="https://ninja-build.org/">Ninja build system</a>. You can use the
192 second build directory next to it for running the tests with these steps:</p>
195 <li>Check out clang and LLVM as described above</li>
206 Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64</tt>
210 <li><tt>mkdir build_ninja</tt> (or <tt>build</tt>, or use your own
216 <li><tt>cmake -GNinja -DLLVM_ENABLE_PROJECTS=clang ..\llvm</tt></li>
217 <li><tt>ninja clang</tt> This will build just clang.</li>
218 <li><tt>ninja check-clang</tt> This will run the clang tests.</li>
221 <h2 id="driver">Clang Compiler Driver (Drop-in Substitute for GCC)</h2>
223 <p>The <tt>clang</tt> tool is the compiler driver and front-end, which is
224 designed to be a drop-in replacement for the <tt>gcc</tt> command. Here are
225 some examples of how to use the high-level driver:
240 weird link-time errors relating to inline functions, try passing -std=gnu89
245 <!-- Thanks to
246 http://shiflett.org/blog/2006/oct/formatting-and-highlighting-php-code-listings
248 tag. -->
260 $ <b>clang ~/t.c -E</b>
272 $ <b>clang -fsyntax-only ~/t.c</b>
279 $ <b>clang -fsyntax-only ~/t.c -pedantic</b>
289 <p>Note, the <tt>-cc1</tt> argument indicates the compiler front-end, and
290 not the driver, should be run. The compiler front-end has several additional
295 $ <b>clang -cc1 ~/t.c -ast-print</b>
306 $ <b>clang ~/t.c -S -emit-llvm -o -</b>
313 $ <b>clang -fomit-frame-pointer -O3 -S -o - t.c</b> <i># On x86_64</i>