blob: d088cced0963c87f8559af8a31b57b640681848e [file] [log] [blame]
John Criswell700c82d2003-10-03 13:45:55 +00001<html>
2<title>
3LLVM: llvmgcc tool
4</title>
5
Chris Lattner08a04fd2003-10-07 20:12:05 +00006<body bgcolor=white>
John Criswell700c82d2003-10-03 13:45:55 +00007
8<center>
Chris Lattneraaba10c2003-10-07 19:51:55 +00009<h1>LLVM: <tt>llvmgcc</tt> tool</h1>
John Criswell700c82d2003-10-03 13:45:55 +000010</center>
11<HR>
12
Chris Lattneraaba10c2003-10-07 19:51:55 +000013<h3>NAME</h3>
14<tt>llvmgcc</tt>
John Criswell700c82d2003-10-03 13:45:55 +000015
16<h3>
17SYNOPSIS
18</h3>
19
Chris Lattneraaba10c2003-10-07 19:51:55 +000020<tt>llvmgcc [options] filename</tt>
John Criswell700c82d2003-10-03 13:45:55 +000021<h3>
22DESCRIPTION
23</h3>
24
Chris Lattneraaba10c2003-10-07 19:51:55 +000025The <tt>llvmgcc</tt> command is the LLVM C front end. It is a modified version
26of the <a href="http://gcc.gnu.org">GNU Compiler Collection</a> (GCC) that takes
27C programs and compiles them into LLVM bytecode or assembly language, depending
28upon the options.
John Criswell700c82d2003-10-03 13:45:55 +000029<p>
30
Brian Gaeke102ed5c2003-10-19 18:15:18 +000031Unless the <tt>-S</tt> option is specified, <tt>llvmgcc</tt> will use the
32<a href="gccas.html"><tt>gccas</tt></a> program to perform some optimizations
33and create an LLVM bytecode file. Unless the <tt>-c</tt> option is specified,
34<tt>llvmgcc</tt> will also use the <a href="gccld.html"><tt>gccld</tt></a>
35program to perform further optimizations and link the resulting bytecode
36file(s) with support libraries to create an executable program.
John Criswell700c82d2003-10-03 13:45:55 +000037<p>
38
Chris Lattneraaba10c2003-10-07 19:51:55 +000039Being derived from GCC, llvmgcc has many of GCC's features and accepts most of
40GCC's options. It handles a number of GCC's extensions to the C programming
41language.
John Criswell700c82d2003-10-03 13:45:55 +000042<p>
43
44Below you will find several commonly used options:
45
46<h3>
47OPTIONS
48</h3>
49
50<ul>
51 <li> -S
52 <br>
53 Do not generate an LLVM bytecode file. Rather, compile the source file
54 into an LLVM assembly language file.
55 <p>
56
57 <li> -c
58 <br>
59 Do not generate a linked bytecode executable. Rather, compile the source
60 file into an LLVM bytecode file. This bytecode file can then be linked
61 with other bytecode files later to generate a full LLVM executable.
62 <p>
63
64 <li> -o <i>filename</i>
65 <br>
Chris Lattneraaba10c2003-10-07 19:51:55 +000066 Specify the output file to be <i>filename</i>.
John Criswell700c82d2003-10-03 13:45:55 +000067 <p>
68
69 <li> -I <i>directory</i>
70 <br>
71 Add a directory to the header file search path. This option can be
72 repeated.
73 <p>
74
75 <li> -L <i>directory</i>
76 <br>
77 Add <i>directory</i> to the library search path. This option can be
78 repeated.
79 <p>
80
81 <li> -l<i>name</i>
82 <br>
Chris Lattneraaba10c2003-10-07 19:51:55 +000083 Link in the library lib<i>name</i>.[bc | a | so]. This library should
84 be a bytecode library.
John Criswell700c82d2003-10-03 13:45:55 +000085 <p>
86
87 <li>-Wl,<i>option</i>
88 <br>
Chris Lattneraaba10c2003-10-07 19:51:55 +000089 Pass <i>option</i> to the linker program, <a
90 href="gccld.html"><tt>gccld</tt></a>.
John Criswell700c82d2003-10-03 13:45:55 +000091 <p>
92</ul>
93
94<h3>
95EXIT STATUS
96</h3>
97
Chris Lattneraaba10c2003-10-07 19:51:55 +000098If <tt>llvmgcc</tt> succeeds, it will exit with 0. Otherwise, if an error
99occurs, it will exit with a non-zero value.
John Criswell700c82d2003-10-03 13:45:55 +0000100
101<h3>
102SEE ALSO
103</h3>
Chris Lattneraaba10c2003-10-07 19:51:55 +0000104<A HREF="llvmgxx.html"><tt>llvmg++</tt></A>,
105<A HREF="gccas.html"><tt>gccas</tt></A>,
Brian Gaeke102ed5c2003-10-19 18:15:18 +0000106<A HREF="gccld.html"><tt>gccld</tt></A>,
107and the Info documentation for <tt>gcc</tt>.
John Criswell700c82d2003-10-03 13:45:55 +0000108
109<HR>
Chris Lattner08a04fd2003-10-07 20:12:05 +0000110Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
John Criswell700c82d2003-10-03 13:45:55 +0000111</body>
112</html>
113