Reid Spencer | e497ff1 | 2006-05-30 19:56:31 +0000 | [diff] [blame^] | 1 | =pod |
| 2 | |
| 3 | =head1 NAME |
| 4 | |
| 5 | llvm2xpp - LLVM assembler to LLVM C++ IR translator |
| 6 | |
| 7 | =head1 SYNOPSIS |
| 8 | |
| 9 | B<llvm2cpp> [I<options>] [I<filename>] |
| 10 | |
| 11 | =head1 DESCRIPTION |
| 12 | |
| 13 | B<llvm2cpp> translates from human readable LLVM assembly (.ll files) to a |
| 14 | corresponding C++ source file that will make calls against the LLVM C++ API to |
| 15 | build the same module as the input. By default, the C++ output is a complete |
| 16 | program that builds the module, verifies it and then emits the module as |
| 17 | LLVM assembly again. This technique assists with testing because the input to |
| 18 | B<llvm2cpp> and the output of the generated C++ program should be identical. |
| 19 | |
| 20 | If F<filename> is omitted or is C<->, then B<llvm2cpp> reads its input from |
| 21 | standard input. |
| 22 | |
| 23 | If an output file is not specified with the B<-o> option, then |
| 24 | B<llvm-as> sends its output to a file or standard output by following |
| 25 | these rules: |
| 26 | |
| 27 | =over |
| 28 | |
| 29 | =item * |
| 30 | |
| 31 | If the input is standard input, then the output is standard output. |
| 32 | |
| 33 | =item * |
| 34 | |
| 35 | If the input is a file that ends with C<.ll>, then the output file is of |
| 36 | the same name, except that the suffix is changed to C<.cpp>. |
| 37 | |
| 38 | =item * |
| 39 | |
| 40 | If the input is a file that does not end with the C<.ll> suffix, then the |
| 41 | output file has the same name as the input file, except that the C<.cpp> |
| 42 | suffix is appended. |
| 43 | |
| 44 | =back |
| 45 | |
| 46 | =head1 OPTIONS |
| 47 | |
| 48 | =over |
| 49 | |
| 50 | =item B<-f> |
| 51 | |
| 52 | Force overwrite. Normally, B<llvm2cpp> will refuse to overwrite an |
| 53 | output file that already exists. With this option, B<llvm2cpp> |
| 54 | will overwrite the output file and replace it with new C++ source code. |
| 55 | |
| 56 | =item B<--help> |
| 57 | |
| 58 | Print a summary of command line options. |
| 59 | |
| 60 | =item B<-o> F<filename> |
| 61 | |
| 62 | Specify the output file name. If F<filename> is C<->, then B<llvm2cpp> |
| 63 | sends its output to standard output. |
| 64 | |
| 65 | =item B<-modname> F<moduleName> |
| 66 | |
| 67 | Specify the name of the module to be generated. Normally the generated program |
| 68 | creates a module that has the same name as the input file. If the input file was |
| 69 | read from the standard input then the module name will be '<stdin>'. This option |
| 70 | overrides both these default actions and specifies that the module name used |
| 71 | must be F<moduleName>. |
| 72 | |
| 73 | =back |
| 74 | |
| 75 | =head1 EXIT STATUS |
| 76 | |
| 77 | If B<llvm2cpp> succeeds, it will exit with 0. Otherwise, if an error |
| 78 | occurs, it will exit with a non-zero value. |
| 79 | |
| 80 | =head1 SEE ALSO |
| 81 | |
| 82 | L<llvm-as|llvm-as> |
| 83 | |
| 84 | =head1 AUTHORS |
| 85 | |
| 86 | Maintained by the LLVM Team (L<http://llvm.org>). |
| 87 | |
| 88 | =cut |