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