Home | History | Annotate | Download | only in CommandGuide
      1 llvm-extract - extract a function from an LLVM module
      2 =====================================================
      3 
      4 
      5 SYNOPSIS
      6 --------
      7 
      8 
      9 **llvm-extract** [*options*] **--func** *function-name* [*filename*]
     10 
     11 
     12 DESCRIPTION
     13 -----------
     14 
     15 
     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.
     19 
     20 In addition to extracting the bitcode of the specified function,
     21 **llvm-extract** will also remove unreachable global variables, prototypes, and
     22 unused types.
     23 
     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).
     27 
     28 
     29 OPTIONS
     30 -------
     31 
     32 
     33 
     34 **-f**
     35 
     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.
     39 
     40 
     41 
     42 **--func** *function-name*
     43 
     44  Extract the function named *function-name* from the LLVM bitcode. May be
     45  specified multiple times to extract multiple functions at once.
     46 
     47 
     48 
     49 **--rfunc** *function-regular-expr*
     50 
     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.
     54 
     55 
     56 
     57 **--glob** *global-name*
     58 
     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.
     61 
     62 
     63 
     64 **--rglob** *glob-regular-expr*
     65 
     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.
     69 
     70 
     71 
     72 **-help**
     73 
     74  Print a summary of command line options.
     75 
     76 
     77 
     78 **-o** *filename*
     79 
     80  Specify the output filename.  If filename is "-" (the default), then
     81  **llvm-extract** sends its output to standard output.
     82 
     83 
     84 
     85 **-S**
     86 
     87  Write output in LLVM intermediate language (instead of bitcode).
     88 
     89 
     90 
     91 
     92 EXIT STATUS
     93 -----------
     94 
     95 
     96 If **llvm-extract** succeeds, it will exit with 0.  Otherwise, if an error
     97 occurs, it will exit with a non-zero value.
     98 
     99 
    100 SEE ALSO
    101 --------
    102 
    103 
    104 bugpoint|bugpoint
    105