Shih-wei Liao | e264f62 | 2010-02-10 11:10:31 -0800 | [diff] [blame] | 1 | =pod |
| 2 | |
| 3 | =head1 NAME |
| 4 | |
| 5 | llvm-extract - extract a function from an LLVM module |
| 6 | |
| 7 | =head1 SYNOPSIS |
| 8 | |
| 9 | B<llvm-extract> [I<options>] B<--func> I<function-name> [I<filename>] |
| 10 | |
| 11 | =head1 DESCRIPTION |
| 12 | |
| 13 | The B<llvm-extract> command takes the name of a function and extracts it from |
| 14 | the specified LLVM bitcode file. It is primarily used as a debugging tool to |
| 15 | reduce test cases from larger programs that are triggering a bug. |
| 16 | |
| 17 | In addition to extracting the bitcode of the specified function, |
| 18 | B<llvm-extract> will also remove unreachable global variables, prototypes, and |
| 19 | unused types. |
| 20 | |
| 21 | The B<llvm-extract> command reads its input from standard input if filename is |
| 22 | omitted or if filename is -. The output is always written to standard output, |
| 23 | unless the B<-o> option is specified (see below). |
| 24 | |
| 25 | =head1 OPTIONS |
| 26 | |
| 27 | =over |
| 28 | |
| 29 | =item B<-f> |
| 30 | |
| 31 | Enable binary output on terminals. Normally, B<llvm-extract> will refuse to |
| 32 | write raw bitcode output if the output stream is a terminal. With this option, |
| 33 | B<llvm-extract> will write raw bitcode regardless of the output device. |
| 34 | |
| 35 | =item B<--func> I<function-name> |
| 36 | |
| 37 | Extract the function named I<function-name> from the LLVM bitcode. |
| 38 | |
| 39 | =item B<--help> |
| 40 | |
| 41 | Print a summary of command line options. |
| 42 | |
| 43 | =item B<-o> I<filename> |
| 44 | |
| 45 | Specify the output filename. If filename is "-" (the default), then |
| 46 | B<llvm-extract> sends its output to standard output. |
| 47 | |
| 48 | =item B<-S> |
| 49 | |
| 50 | Write output in LLVM intermediate language (instead of bitcode). |
| 51 | |
| 52 | =back |
| 53 | |
| 54 | =head1 EXIT STATUS |
| 55 | |
| 56 | If B<llvm-extract> succeeds, it will exit with 0. Otherwise, if an error |
| 57 | occurs, it will exit with a non-zero value. |
| 58 | |
| 59 | =head1 SEE ALSO |
| 60 | |
| 61 | L<bugpoint|bugpoint> |
| 62 | |
| 63 | =head1 AUTHORS |
| 64 | |
| 65 | Maintained by the LLVM Team (L<http://llvm.org>). |
| 66 | |
| 67 | =cut |