7bfc3d71cbac70b036a7f6818dd37722a89bb672
[oota-llvm.git] / docs / CommandGuide / llvmc.pod
1 =pod
2
3 =head1 NAME
4
5 llvmc - The LLVM Compiler Driver (WIP)
6
7 =head1 SYNOPSIS
8
9 B<llvmc> [I<options>] I<filenames...>
10
11 =head1 DESCRIPTION
12
13 B<llvmc> is a configurable driver for invoking other LLVM (and non-LLVM) tools
14 in order to compile, optimize and link software for multiple languages. For
15 those familiar with FSF's B<gcc> tool, it is very similar.  Please note that
16 B<llvmc> is considered an experimental tool.
17
18 =head1 OPTIONS
19
20 =head2 Built-in Options
21
22 LLVMC has some built-in options that can't be overridden in the
23 configuration libraries.
24
25 =over
26
27 =item B<-o> I<filename>
28
29 Output file name.
30
31 =item B<-x> I<language>
32
33 Specify the language of the following input files until the next B<-x>
34 option.
35
36 =item B<-load> I<plugin_name>
37
38 Load the specified plugin DLL. Example:
39 S<-load $LLVM_DIR/Release/lib/LLVMCSimple.so>.
40
41 =item B<-v> or B<--verbose>
42
43 Enable verbose mode, i.e. print out all executed commands.
44
45 =item B<--view-graph>
46
47 Show a graphical representation of the compilation graph. Requires
48 that you have I<dot> and I<gv> programs installed. Hidden option,
49 useful for debugging.
50
51 =item B<--write-graph>
52
53 Write a I<compilation-graph.dot> file in the current directory with
54 the compilation graph description in the Graphviz format. Hidden
55 option, useful for debugging.
56
57 =item B<--save-temps>
58
59 Write temporary files to the current directory and do not delete them
60 on exit. Hidden option, useful for debugging.
61
62 =item B<--help>
63
64 Print a summary of command-line options and exit.
65
66 =item B<--help-hidden>
67
68 Print a summary of command-line options and exit. Print help even for
69 options intended for developers.
70
71 =item B<--version>
72
73 Print version information and exit.
74
75 =back
76
77 =head2 Control Options
78
79 By default, LLVMC is built with some standard configuration libraries
80 that define the following options:
81
82 =over
83
84 =item B<-clang>
85
86 Use Clang instead of llvm-gcc.
87
88 =item B<-opt>
89
90 Enable optimization with B<opt>.
91
92 =item B<-I> I<directory>
93
94 Add a directory to the header file search path.  This option can be
95 repeated.
96
97 =item B<-L> I<directory>
98
99 Add I<directory> to the library search path.  This option can be
100 repeated.
101
102 =item B<-l>I<name>
103
104 Link in the library libI<name>.[bc | a | so].  This library should
105 be a bitcode library.
106
107 =item B<-emit-llvm>
108
109 Make the output be LLVM bitcode (with B<-c>) or assembly (with B<-S>) instead
110 of native object (or assembly).  If B<-emit-llvm> is given without either B<-c>
111 or B<-S> it has no effect.
112
113 =item B<-Wa>
114
115 Pass options to assembler.
116
117 =item B<-Wl>
118
119 Pass options to linker.
120
121 =item B<-Wo>
122
123 Pass options to opt.
124
125 =back
126
127 =head1 EXIT STATUS
128
129 If B<llvmc> succeeds, it will exit with code 0.  Otherwise, if an
130 error occurs, it will exit with a non-zero value. If one of the
131 compilation tools returns a non-zero status, pending actions will be
132 discarded and B<llvmc> will return the same result code as the failing
133 compilation tool.
134
135 =head1 SEE ALSO
136
137 L<llvm-gcc|llvmgcc>, L<llvm-g++|llvmgxx>, L<llvm-as|llvm-as>,
138 L<llvm-dis|llvm-dis>, L<llc|llc>, L<llvm-link|llvm-link>
139
140 =head1 AUTHORS
141
142 Maintained by the LLVM Team (L<http://llvm.org>).
143
144 =cut