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