1 llvm-extract - extract a function from an LLVM module
2 =====================================================
9 **llvm-extract** [*options*] **--func** *function-name* [*filename*]
16 The **llvm-extract** command takes the name of a function and extracts it from
17 the specified LLVM bitcode file. It is primarily used as a debugging tool to
18 reduce test cases from larger programs that are triggering a bug.
20 In addition to extracting the bitcode of the specified function,
21 **llvm-extract** will also remove unreachable global variables, prototypes, and
24 The **llvm-extract** command reads its input from standard input if filename is
25 omitted or if filename is -. The output is always written to standard output,
26 unless the **-o** option is specified (see below).
36 Enable binary output on terminals. Normally, **llvm-extract** will refuse to
37 write raw bitcode output if the output stream is a terminal. With this option,
38 **llvm-extract** will write raw bitcode regardless of the output device.
42 **--func** *function-name*
44 Extract the function named *function-name* from the LLVM bitcode. May be
45 specified multiple times to extract multiple functions at once.
49 **--rfunc** *function-regular-expr*
51 Extract the function(s) matching *function-regular-expr* from the LLVM bitcode.
52 All functions matching the regular expression will be extracted. May be
53 specified multiple times.
57 **--glob** *global-name*
59 Extract the global variable named *global-name* from the LLVM bitcode. May be
60 specified multiple times to extract multiple global variables at once.
64 **--rglob** *glob-regular-expr*
66 Extract the global variable(s) matching *global-regular-expr* from the LLVM
67 bitcode. All global variables matching the regular expression will be extracted.
68 May be specified multiple times.
74 Print a summary of command line options.
80 Specify the output filename. If filename is "-" (the default), then
81 **llvm-extract** sends its output to standard output.
87 Write output in LLVM intermediate language (instead of bitcode).
96 If **llvm-extract** succeeds, it will exit with 0. Otherwise, if an error
97 occurs, it will exit with a non-zero value.