blob: 77f5ee8153fb3b7e501e2f45d9ae2f5a8a125618 [file] [log] [blame]
Brian Gaeke8172d532004-06-02 19:21:26 +00001=pod
2
3=head1 NAME
4
Misha Brukman4e8458d2005-04-24 17:46:58 +00005llvm-extract - extract a function from an LLVM module
Brian Gaeke8172d532004-06-02 19:21:26 +00006
7=head1 SYNOPSIS
8
Misha Brukman4e8458d2005-04-24 17:46:58 +00009B<llvm-extract> [I<options>] B<--func> I<function-name> [I<filename>]
Brian Gaeke8172d532004-06-02 19:21:26 +000010
11=head1 DESCRIPTION
12
Misha Brukman4e8458d2005-04-24 17:46:58 +000013The B<llvm-extract> command takes the name of a function and extracts it from
Brian Gaeke8172d532004-06-02 19:21:26 +000014the specified LLVM bytecode 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 bytecode of the specified function,
Misha Brukman4e8458d2005-04-24 17:46:58 +000018B<llvm-extract> will also remove unreachable global variables, prototypes, and
Brian Gaeke8172d532004-06-02 19:21:26 +000019unused types.
20
Misha Brukman4e8458d2005-04-24 17:46:58 +000021The B<llvm-extract> command reads its input from standard input if filename is
Brian Gaeke8172d532004-06-02 19:21:26 +000022omitted 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
Misha Brukman4e8458d2005-04-24 17:46:58 +000031Force overwrite. Normally, B<llvm-extract> will refuse to overwrite an
32output file that already exists. With this option, B<llvm-extract>
Brian Gaeke8172d532004-06-02 19:21:26 +000033will overwrite the output file and replace it with new bytecode.
34
35=item B<--func> I<function-name>
36
37Extract the function named I<function-name> from the LLVM bytecode.
38
39=item B<--help>
40
41Print a summary of command line options.
42
43=item B<-o> I<filename>
44
45Specify the output filename. If filename is "-" (the default), then
Misha Brukman4e8458d2005-04-24 17:46:58 +000046B<llvm-extract> sends its output to standard output.
Brian Gaeke8172d532004-06-02 19:21:26 +000047
Brian Gaeke8172d532004-06-02 19:21:26 +000048=back
49
50=head1 EXIT STATUS
51
Misha Brukman4e8458d2005-04-24 17:46:58 +000052If B<llvm-extract> succeeds, it will exit with 0. Otherwise, if an error
Brian Gaeke8172d532004-06-02 19:21:26 +000053occurs, it will exit with a non-zero value.
54
55=head1 SEE ALSO
56
Misha Brukmanc08937a2004-07-02 16:06:19 +000057L<bugpoint|bugpoint>
Brian Gaeke8172d532004-06-02 19:21:26 +000058
59=head1 AUTHORS
60
Reid Spencercd143fc2006-03-14 05:42:07 +000061Maintained by the LLVM Team (L<http://llvm.org>).
Brian Gaeke8172d532004-06-02 19:21:26 +000062
63=cut