Mikhail Glushenkov | a606d1f | 2008-11-25 21:38:38 +0000 | [diff] [blame] | 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 | |
Mikhail Glushenkov | dbb61d1 | 2008-11-26 13:40:08 +0000 | [diff] [blame] | 20 | =head2 Built-in Options |
| 21 | |
| 22 | LLVMC has some built-in options that can't be overridden in the |
| 23 | configuration libraries. |
| 24 | |
Mikhail Glushenkov | a606d1f | 2008-11-25 21:38:38 +0000 | [diff] [blame] | 25 | =over |
| 26 | |
Mikhail Glushenkov | a606d1f | 2008-11-25 21:38:38 +0000 | [diff] [blame] | 27 | =item B<-o> I<filename> |
| 28 | |
Mikhail Glushenkov | dbb61d1 | 2008-11-26 13:40:08 +0000 | [diff] [blame] | 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 | |
Mikhail Glushenkov | f8c430b | 2009-01-09 16:16:27 +0000 | [diff] [blame] | 45 | =item B<--check-graph> |
| 46 | |
Mikhail Glushenkov | 4ad0d57 | 2009-03-27 12:58:29 +0000 | [diff] [blame] | 47 | Check the compilation for common errors like mismatched output/input language |
| 48 | names, multiple default edges and cycles. Because of plugins, these checks can't |
| 49 | be performed at compile-time. Exit with code zero if no errors were found, and |
| 50 | return the number of found errors otherwise. Hidden option, useful for debugging |
| 51 | LLVMC plugins. |
Mikhail Glushenkov | f8c430b | 2009-01-09 16:16:27 +0000 | [diff] [blame] | 52 | |
Mikhail Glushenkov | dbb61d1 | 2008-11-26 13:40:08 +0000 | [diff] [blame] | 53 | =item B<--view-graph> |
| 54 | |
Mikhail Glushenkov | 4ad0d57 | 2009-03-27 12:58:29 +0000 | [diff] [blame] | 55 | Show a graphical representation of the compilation graph and exit. Requires that |
| 56 | you have I<dot> and I<gv> programs installed. Hidden option, useful for |
| 57 | debugging LLVMC plugins. |
Mikhail Glushenkov | dbb61d1 | 2008-11-26 13:40:08 +0000 | [diff] [blame] | 58 | |
| 59 | =item B<--write-graph> |
| 60 | |
Mikhail Glushenkov | 4ad0d57 | 2009-03-27 12:58:29 +0000 | [diff] [blame] | 61 | Write a I<compilation-graph.dot> file in the current directory with the |
| 62 | compilation graph description in Graphviz format (identical to the file used by |
| 63 | the B<--view-graph> option). The B<-o> option can be used to set the output file |
| 64 | name. Hidden option, useful for debugging LLVMC plugins. |
Mikhail Glushenkov | dbb61d1 | 2008-11-26 13:40:08 +0000 | [diff] [blame] | 65 | |
| 66 | =item B<--save-temps> |
| 67 | |
Mikhail Glushenkov | 294f507 | 2009-06-25 18:20:44 +0000 | [diff] [blame^] | 68 | Write temporary files to the current directory and do not delete them on |
| 69 | exit. This option can also take an argument: the I<--save-temps=obj> switch will |
| 70 | write files into the directory specified with the I<-o> option. The |
| 71 | I<--save-temps=cwd> and I<--save-temps> switches are both synonyms for the |
| 72 | default behaviour. |
Mikhail Glushenkov | dbb61d1 | 2008-11-26 13:40:08 +0000 | [diff] [blame] | 73 | |
| 74 | =item B<--help> |
| 75 | |
| 76 | Print a summary of command-line options and exit. |
| 77 | |
| 78 | =item B<--help-hidden> |
| 79 | |
| 80 | Print a summary of command-line options and exit. Print help even for |
| 81 | options intended for developers. |
| 82 | |
| 83 | =item B<--version> |
| 84 | |
| 85 | Print version information and exit. |
| 86 | |
Mikhail Glushenkov | 1421b7b | 2009-01-21 13:14:02 +0000 | [diff] [blame] | 87 | =item B<@>I<file> |
| 88 | |
| 89 | Read command-line options from I<file>. The options read are inserted |
| 90 | in place of the original @I<file> option. If I<file> does not exist, or |
| 91 | cannot be read, then the option will be treated literally, and not |
| 92 | removed. |
| 93 | |
| 94 | Options in I<file> are separated by whitespace. A whitespace character |
| 95 | may be included in an option by surrounding the entire option in |
| 96 | either single or double quotes. Any character (including a backslash) |
| 97 | may be included by prefixing the character to be included with a |
| 98 | backslash. The file may itself contain additional @I<file> options; |
| 99 | any such options will be processed recursively. |
| 100 | |
| 101 | |
Mikhail Glushenkov | dbb61d1 | 2008-11-26 13:40:08 +0000 | [diff] [blame] | 102 | =back |
| 103 | |
Mikhail Glushenkov | 1421b7b | 2009-01-21 13:14:02 +0000 | [diff] [blame] | 104 | |
Mikhail Glushenkov | dbb61d1 | 2008-11-26 13:40:08 +0000 | [diff] [blame] | 105 | =head2 Control Options |
| 106 | |
| 107 | By default, LLVMC is built with some standard configuration libraries |
| 108 | that define the following options: |
| 109 | |
| 110 | =over |
Mikhail Glushenkov | a606d1f | 2008-11-25 21:38:38 +0000 | [diff] [blame] | 111 | |
Mikhail Glushenkov | 24dc52d | 2008-12-07 16:48:07 +0000 | [diff] [blame] | 112 | =item B<-clang> |
| 113 | |
| 114 | Use Clang instead of llvm-gcc. |
| 115 | |
Mikhail Glushenkov | daae124 | 2008-12-12 02:34:56 +0000 | [diff] [blame] | 116 | =item B<-opt> |
| 117 | |
Mikhail Glushenkov | 4ad0d57 | 2009-03-27 12:58:29 +0000 | [diff] [blame] | 118 | Enable optimization passes with B<opt>. To pass options to the B<opt> program |
| 119 | use the B<-Wo,> option. |
Mikhail Glushenkov | daae124 | 2008-12-12 02:34:56 +0000 | [diff] [blame] | 120 | |
Mikhail Glushenkov | a606d1f | 2008-11-25 21:38:38 +0000 | [diff] [blame] | 121 | =item B<-I> I<directory> |
| 122 | |
| 123 | Add a directory to the header file search path. This option can be |
| 124 | repeated. |
| 125 | |
| 126 | =item B<-L> I<directory> |
| 127 | |
| 128 | Add I<directory> to the library search path. This option can be |
| 129 | repeated. |
| 130 | |
| 131 | =item B<-l>I<name> |
| 132 | |
| 133 | Link in the library libI<name>.[bc | a | so]. This library should |
| 134 | be a bitcode library. |
| 135 | |
| 136 | =item B<-emit-llvm> |
| 137 | |
Mikhail Glushenkov | efc5c31 | 2008-12-09 14:41:00 +0000 | [diff] [blame] | 138 | Make the output be LLVM bitcode (with B<-c>) or assembly (with B<-S>) instead |
Mikhail Glushenkov | a606d1f | 2008-11-25 21:38:38 +0000 | [diff] [blame] | 139 | of native object (or assembly). If B<-emit-llvm> is given without either B<-c> |
| 140 | or B<-S> it has no effect. |
| 141 | |
Mikhail Glushenkov | 24dc52d | 2008-12-07 16:48:07 +0000 | [diff] [blame] | 142 | =item B<-Wa> |
| 143 | |
| 144 | Pass options to assembler. |
| 145 | |
| 146 | =item B<-Wl> |
| 147 | |
| 148 | Pass options to linker. |
| 149 | |
Mikhail Glushenkov | daae124 | 2008-12-12 02:34:56 +0000 | [diff] [blame] | 150 | =item B<-Wo> |
| 151 | |
| 152 | Pass options to opt. |
| 153 | |
Mikhail Glushenkov | a606d1f | 2008-11-25 21:38:38 +0000 | [diff] [blame] | 154 | =back |
| 155 | |
| 156 | =head1 EXIT STATUS |
| 157 | |
Mikhail Glushenkov | dbb61d1 | 2008-11-26 13:40:08 +0000 | [diff] [blame] | 158 | If B<llvmc> succeeds, it will exit with code 0. Otherwise, if an |
| 159 | error occurs, it will exit with a non-zero value. If one of the |
| 160 | compilation tools returns a non-zero status, pending actions will be |
| 161 | discarded and B<llvmc> will return the same result code as the failing |
| 162 | compilation tool. |
Mikhail Glushenkov | a606d1f | 2008-11-25 21:38:38 +0000 | [diff] [blame] | 163 | |
| 164 | =head1 SEE ALSO |
| 165 | |
| 166 | L<llvm-gcc|llvmgcc>, L<llvm-g++|llvmgxx>, L<llvm-as|llvm-as>, |
| 167 | L<llvm-dis|llvm-dis>, L<llc|llc>, L<llvm-link|llvm-link> |
| 168 | |
| 169 | =head1 AUTHORS |
| 170 | |
| 171 | Maintained by the LLVM Team (L<http://llvm.org>). |
| 172 | |
| 173 | =cut |