1LLVM-EXTRACT(1) LLVM LLVM-EXTRACT(1)
2
3
4
6 llvm-extract - extract a function from an LLVM module
7
9 llvm-extract [options] --func function-name [filename]
10
12 The llvm-extract command takes the name of a function and extracts it
13 from the specified LLVM bitcode file. It is primarily used as a debug‐
14 ging tool to reduce test cases from larger programs that are triggering
15 a bug.
16
17 In addition to extracting the bitcode of the specified function,
18 llvm-extract will also remove unreachable global variables, prototypes,
19 and unused types.
20
21 The llvm-extract command reads its input from standard input if file‐
22 name is omitted or if filename is -. The output is always written to
23 standard output, unless the -o option is specified (see below).
24
26 -f
27 Enable binary output on terminals. Normally, llvm-extract will
28 refuse to write raw bitcode output if the output stream is a termi‐
29 nal. With this option, llvm-extract will write raw bitcode regard‐
30 less of the output device.
31
32 --func function-name
33 Extract the function named function-name from the LLVM bitcode. May
34 be specified multiple times to extract multiple functions at once.
35
36 --rfunc function-regular-expr
37 Extract the function(s) matching function-regular-expr from the LLVM
38 bitcode. All functions matching the regular expression will be ex‐
39 tracted. May be specified multiple times.
40
41 --glob global-name
42 Extract the global variable named global-name from the LLVM bitcode.
43 May be specified multiple times to extract multiple global variables
44 at once.
45
46 --rglob glob-regular-expr
47 Extract the global variable(s) matching global-regular-expr from the
48 LLVM bitcode. All global variables matching the regular expression
49 will be extracted. May be specified multiple times.
50
51 -help
52 Print a summary of command line options.
53
54 -o filename
55 Specify the output filename. If filename is "-" (the default), then
56 llvm-extract sends its output to standard output.
57
58 -S
59 Write output in LLVM intermediate language (instead of bitcode).
60
62 If llvm-extract succeeds, it will exit with 0. Otherwise, if an error
63 occurs, it will exit with a non-zero value.
64
66 bugpoint(1)
67
69 Maintained by the LLVM Team (https://llvm.org/).
70
72 2003-2021, LLVM Project
73
74
75
76
7710 2021-07-22 LLVM-EXTRACT(1)