blob: 02f38adf554e329b98673b590c8f36ab5f30dff6 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001=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
Dan Gohman87489cf2009-08-25 15:54:01 +000031Enable 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.
Dan Gohmanf17a25c2007-07-18 16:29:46 +000034
35=item B<--func> I<function-name>
36
Dan Gohman59aa5d42010-02-10 23:58:53 +000037Extract 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<--glob> I<global-name>
41
42Extract the global variable named I<global-name> from the LLVM bitcode. May be
43specified multiple times to extract multiple global variables at once.
Dan Gohmanf17a25c2007-07-18 16:29:46 +000044
45=item B<--help>
46
47Print a summary of command line options.
48
49=item B<-o> I<filename>
50
51Specify the output filename. If filename is "-" (the default), then
52B<llvm-extract> sends its output to standard output.
53
Dan Gohman31b20c72009-09-11 20:46:33 +000054=item B<-S>
55
56Write output in LLVM intermediate language (instead of bitcode).
57
Dan Gohmanf17a25c2007-07-18 16:29:46 +000058=back
59
60=head1 EXIT STATUS
61
62If B<llvm-extract> succeeds, it will exit with 0. Otherwise, if an error
63occurs, it will exit with a non-zero value.
64
65=head1 SEE ALSO
66
67L<bugpoint|bugpoint>
68
69=head1 AUTHORS
70
71Maintained by the LLVM Team (L<http://llvm.org>).
72
73=cut