Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 1 | =pod |
| 2 | |
| 3 | =head1 NAME |
| 4 | |
Misha Brukman | 4e8458d | 2005-04-24 17:46:58 +0000 | [diff] [blame] | 5 | llvm-extract - extract a function from an LLVM module |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 6 | |
| 7 | =head1 SYNOPSIS |
| 8 | |
Misha Brukman | 4e8458d | 2005-04-24 17:46:58 +0000 | [diff] [blame] | 9 | B<llvm-extract> [I<options>] B<--func> I<function-name> [I<filename>] |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 10 | |
| 11 | =head1 DESCRIPTION |
| 12 | |
Misha Brukman | 4e8458d | 2005-04-24 17:46:58 +0000 | [diff] [blame] | 13 | The B<llvm-extract> command takes the name of a function and extracts it from |
Gabor Greif | 3bd6e0d | 2007-07-09 11:24:05 +0000 | [diff] [blame] | 14 | the specified LLVM bitcode file. It is primarily used as a debugging tool to |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 15 | reduce test cases from larger programs that are triggering a bug. |
| 16 | |
Gabor Greif | 3bd6e0d | 2007-07-09 11:24:05 +0000 | [diff] [blame] | 17 | In addition to extracting the bitcode of the specified function, |
Misha Brukman | 4e8458d | 2005-04-24 17:46:58 +0000 | [diff] [blame] | 18 | B<llvm-extract> will also remove unreachable global variables, prototypes, and |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 19 | unused types. |
| 20 | |
Misha Brukman | 4e8458d | 2005-04-24 17:46:58 +0000 | [diff] [blame] | 21 | The B<llvm-extract> command reads its input from standard input if filename is |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 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 | |
Dan Gohman | 0cabaa5 | 2009-08-25 15:54:01 +0000 | [diff] [blame] | 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. |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 34 | |
| 35 | =item B<--func> I<function-name> |
| 36 | |
Dan Gohman | a499d20 | 2010-02-10 23:58:53 +0000 | [diff] [blame] | 37 | Extract the function named I<function-name> from the LLVM bitcode. May be |
| 38 | specified multiple times to extract multiple functions at once. |
| 39 | |
Chad Rosier | 4e0a55d | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 40 | =item B<--rfunc> I<function-regular-expr> |
| 41 | |
| 42 | Extract the function(s) matching I<function-regular-expr> from the LLVM bitcode. |
| 43 | All functions matching the regular expression will be extracted. May be |
| 44 | specified multiple times. |
| 45 | |
Dan Gohman | a499d20 | 2010-02-10 23:58:53 +0000 | [diff] [blame] | 46 | =item B<--glob> I<global-name> |
| 47 | |
| 48 | Extract the global variable named I<global-name> from the LLVM bitcode. May be |
| 49 | specified multiple times to extract multiple global variables at once. |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 50 | |
Chad Rosier | 4e0a55d | 2011-09-16 21:09:17 +0000 | [diff] [blame] | 51 | =item B<--rglob> I<glob-regular-expr> |
| 52 | |
| 53 | Extract the global variable(s) matching I<global-regular-expr> from the LLVM |
| 54 | bitcode. All global variables matching the regular expression will be extracted. |
| 55 | May be specified multiple times. |
| 56 | |
Duncan Sands | 7e7ae5a | 2010-02-18 14:08:13 +0000 | [diff] [blame] | 57 | =item B<-help> |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 58 | |
| 59 | Print a summary of command line options. |
| 60 | |
| 61 | =item B<-o> I<filename> |
| 62 | |
| 63 | Specify the output filename. If filename is "-" (the default), then |
Misha Brukman | 4e8458d | 2005-04-24 17:46:58 +0000 | [diff] [blame] | 64 | B<llvm-extract> sends its output to standard output. |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 65 | |
Dan Gohman | ec08046 | 2009-09-11 20:46:33 +0000 | [diff] [blame] | 66 | =item B<-S> |
| 67 | |
| 68 | Write output in LLVM intermediate language (instead of bitcode). |
| 69 | |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 70 | =back |
| 71 | |
| 72 | =head1 EXIT STATUS |
| 73 | |
Misha Brukman | 4e8458d | 2005-04-24 17:46:58 +0000 | [diff] [blame] | 74 | If B<llvm-extract> succeeds, it will exit with 0. Otherwise, if an error |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 75 | occurs, it will exit with a non-zero value. |
| 76 | |
| 77 | =head1 SEE ALSO |
| 78 | |
Misha Brukman | c08937a | 2004-07-02 16:06:19 +0000 | [diff] [blame] | 79 | L<bugpoint|bugpoint> |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 80 | |
| 81 | =head1 AUTHORS |
| 82 | |
NAKAMURA Takumi | b9a3363 | 2011-04-09 02:13:37 +0000 | [diff] [blame] | 83 | Maintained by the LLVM Team (L<http://llvm.org/>). |
Brian Gaeke | 8172d53 | 2004-06-02 19:21:26 +0000 | [diff] [blame] | 84 | |
| 85 | =cut |