blob: d237ca4c14fa41261f09ddd1f8e71cf229eb562a [file] [log] [blame]
Mikhail Glushenkova606d1f2008-11-25 21:38:38 +00001=pod
2
3=head1 NAME
4
5llvmc - The LLVM Compiler Driver (WIP)
6
7=head1 SYNOPSIS
8
9B<llvmc> [I<options>] I<filenames...>
10
11=head1 DESCRIPTION
12
13B<llvmc> is a configurable driver for invoking other LLVM (and non-LLVM) tools
14in order to compile, optimize and link software for multiple languages. For
15those familiar with FSF's B<gcc> tool, it is very similar. Please note that
16B<llvmc> is considered an experimental tool.
17
18=head1 OPTIONS
19
Mikhail Glushenkovdbb61d12008-11-26 13:40:08 +000020=head2 Built-in Options
21
22LLVMC has some built-in options that can't be overridden in the
23configuration libraries.
24
Mikhail Glushenkova606d1f2008-11-25 21:38:38 +000025=over
26
Mikhail Glushenkova606d1f2008-11-25 21:38:38 +000027=item B<-o> I<filename>
28
Mikhail Glushenkovdbb61d12008-11-26 13:40:08 +000029Output file name.
30
31=item B<-x> I<language>
32
33Specify the language of the following input files until the next B<-x>
34option.
35
36=item B<-load> I<plugin_name>
37
38Load the specified plugin DLL. Example:
39S<-load $LLVM_DIR/Release/lib/LLVMCSimple.so>.
40
41=item B<-v> or B<--verbose>
42
43Enable verbose mode, i.e. print out all executed commands.
44
Mikhail Glushenkovf8c430b2009-01-09 16:16:27 +000045=item B<--check-graph>
46
Mikhail Glushenkov4ad0d572009-03-27 12:58:29 +000047Check the compilation for common errors like mismatched output/input language
48names, multiple default edges and cycles. Because of plugins, these checks can't
49be performed at compile-time. Exit with code zero if no errors were found, and
50return the number of found errors otherwise. Hidden option, useful for debugging
51LLVMC plugins.
Mikhail Glushenkovf8c430b2009-01-09 16:16:27 +000052
Mikhail Glushenkovdbb61d12008-11-26 13:40:08 +000053=item B<--view-graph>
54
Mikhail Glushenkov4ad0d572009-03-27 12:58:29 +000055Show a graphical representation of the compilation graph and exit. Requires that
56you have I<dot> and I<gv> programs installed. Hidden option, useful for
57debugging LLVMC plugins.
Mikhail Glushenkovdbb61d12008-11-26 13:40:08 +000058
59=item B<--write-graph>
60
Mikhail Glushenkov4ad0d572009-03-27 12:58:29 +000061Write a I<compilation-graph.dot> file in the current directory with the
62compilation graph description in Graphviz format (identical to the file used by
63the B<--view-graph> option). The B<-o> option can be used to set the output file
64name. Hidden option, useful for debugging LLVMC plugins.
Mikhail Glushenkovdbb61d12008-11-26 13:40:08 +000065
66=item B<--save-temps>
67
Mikhail Glushenkov294f5072009-06-25 18:20:44 +000068Write temporary files to the current directory and do not delete them on
69exit. This option can also take an argument: the I<--save-temps=obj> switch will
70write files into the directory specified with the I<-o> option. The
71I<--save-temps=cwd> and I<--save-temps> switches are both synonyms for the
72default behaviour.
Mikhail Glushenkovdbb61d12008-11-26 13:40:08 +000073
Mikhail Glushenkov792f1822009-07-09 19:39:16 +000074=item B<--temp-dir> I<directory>
75
Mikhail Glushenkov09826e32009-07-11 19:27:40 +000076Store temporary files in the given directory. This directory is deleted on exit
77unless I<--save-temps> is specified. If I<--save-temps=obj> is also specified,
78I<--temp-dir> is given the precedence.
Mikhail Glushenkov792f1822009-07-09 19:39:16 +000079
Duncan Sands7e7ae5a2010-02-18 14:08:13 +000080=item B<-help>
Mikhail Glushenkovdbb61d12008-11-26 13:40:08 +000081
82Print a summary of command-line options and exit.
83
Duncan Sands7e7ae5a2010-02-18 14:08:13 +000084=item B<-help-hidden>
Mikhail Glushenkovdbb61d12008-11-26 13:40:08 +000085
86Print a summary of command-line options and exit. Print help even for
87options intended for developers.
88
89=item B<--version>
90
91Print version information and exit.
92
Mikhail Glushenkov1421b7b2009-01-21 13:14:02 +000093=item B<@>I<file>
94
95Read command-line options from I<file>. The options read are inserted
96in place of the original @I<file> option. If I<file> does not exist, or
97cannot be read, then the option will be treated literally, and not
98removed.
99
100Options in I<file> are separated by whitespace. A whitespace character
101may be included in an option by surrounding the entire option in
102either single or double quotes. Any character (including a backslash)
103may be included by prefixing the character to be included with a
104backslash. The file may itself contain additional @I<file> options;
105any such options will be processed recursively.
106
107
Mikhail Glushenkovdbb61d12008-11-26 13:40:08 +0000108=back
109
Mikhail Glushenkov1421b7b2009-01-21 13:14:02 +0000110
Mikhail Glushenkovdbb61d12008-11-26 13:40:08 +0000111=head2 Control Options
112
113By default, LLVMC is built with some standard configuration libraries
114that define the following options:
115
116=over
Mikhail Glushenkova606d1f2008-11-25 21:38:38 +0000117
Mikhail Glushenkov24dc52d2008-12-07 16:48:07 +0000118=item B<-clang>
119
120Use Clang instead of llvm-gcc.
121
Mikhail Glushenkovdaae1242008-12-12 02:34:56 +0000122=item B<-opt>
123
Mikhail Glushenkov4ad0d572009-03-27 12:58:29 +0000124Enable optimization passes with B<opt>. To pass options to the B<opt> program
125use the B<-Wo,> option.
Mikhail Glushenkovdaae1242008-12-12 02:34:56 +0000126
Mikhail Glushenkova606d1f2008-11-25 21:38:38 +0000127=item B<-I> I<directory>
128
Mikhail Glushenkov18518602009-12-01 05:59:55 +0000129Add a directory to the header file search path.
Mikhail Glushenkova606d1f2008-11-25 21:38:38 +0000130
131=item B<-L> I<directory>
132
Mikhail Glushenkov18518602009-12-01 05:59:55 +0000133Add I<directory> to the library search path.
134
135=item B<-F> I<directory>
136
137Add I<directory> to the framework search path.
Mikhail Glushenkova606d1f2008-11-25 21:38:38 +0000138
139=item B<-l>I<name>
140
141Link in the library libI<name>.[bc | a | so]. This library should
142be a bitcode library.
143
Mikhail Glushenkov18518602009-12-01 05:59:55 +0000144=item B<-framework> I<name>
145
146Link in the library libI<name>.[bc | a | so]. This library should
147be a bitcode library.
148
Mikhail Glushenkova606d1f2008-11-25 21:38:38 +0000149=item B<-emit-llvm>
150
Mikhail Glushenkov18518602009-12-01 05:59:55 +0000151Output LLVM bitcode (with B<-c>) or assembly (with B<-S>) instead of native
152object (or assembly). If B<-emit-llvm> is given without either B<-c> or B<-S>
153it has no effect.
Mikhail Glushenkova606d1f2008-11-25 21:38:38 +0000154
Mikhail Glushenkov24dc52d2008-12-07 16:48:07 +0000155=item B<-Wa>
156
157Pass options to assembler.
158
159=item B<-Wl>
160
161Pass options to linker.
162
Mikhail Glushenkovdaae1242008-12-12 02:34:56 +0000163=item B<-Wo>
164
165Pass options to opt.
166
Mikhail Glushenkov18518602009-12-01 05:59:55 +0000167=item B<-Wllc>
168
169Pass options to llc (code generator).
170
Mikhail Glushenkova606d1f2008-11-25 21:38:38 +0000171=back
172
173=head1 EXIT STATUS
174
Mikhail Glushenkovdbb61d12008-11-26 13:40:08 +0000175If B<llvmc> succeeds, it will exit with code 0. Otherwise, if an
176error occurs, it will exit with a non-zero value. If one of the
177compilation tools returns a non-zero status, pending actions will be
178discarded and B<llvmc> will return the same result code as the failing
179compilation tool.
Mikhail Glushenkova606d1f2008-11-25 21:38:38 +0000180
181=head1 SEE ALSO
182
183L<llvm-gcc|llvmgcc>, L<llvm-g++|llvmgxx>, L<llvm-as|llvm-as>,
184L<llvm-dis|llvm-dis>, L<llc|llc>, L<llvm-link|llvm-link>
185
186=head1 AUTHORS
187
188Maintained by the LLVM Team (L<http://llvm.org>).
189
190=cut