LLVM-EXTRACT(1)

πŸ“¦
version 11.1.0 Β· 2 versions
, in fedora 43, fedora 44

✨ NAME ✨

llvm-extract β€” extract a function from an LLVM module πŸŽ€ (yes bestie, that's the whole vibe: one function, plucked out, iconic)


🌸 SYNOPSIS 🌸

llvm-extract [options] --func function-name [filename]

πŸ’… DESCRIPTION πŸ’…

okay so llvm-extract is that girl. you hand her the name of a function, and she extracts it from the LLVM bitcode file you point her at. she's mostly a debugging tool β€” her whole main character job is shrinking big messy test cases down from giant programs that are out here triggering a bug πŸ›πŸ”ͺ

and it's not just the function, bestie. alongside pulling out the bitcode of the function you asked for, llvm-extract also clears out the unreachable global variables, the prototypes, and the unused types. decluttering queen ✨

where does she read from? standard input if you skip filename, or if filename is literally -. and where does she write? always standard output β€” always, no discussion β€” unless you pass the -o option (more on her below πŸ‘‡).


πŸ¦‹ OPTIONS πŸ¦‹

  • --alias alias-name β€” extract the alias named function-name from the LLVM bitcode. (ngl the man page really does say function-name right there in the alias section β€” iykyk, we're keeping it fr fr πŸ’€) you can pass this more than once to extract multiple alias at once.
  • --ralias alias-regular-expr β€” extract the alias matching alias-regular-expr from the LLVM bitcode. every alias matching that regular expression gets extracted. may be specified multiple times.
  • --bb basic-block-specifier β€” extract basic blocks(s) specicified in basic-block-specifier. may be specified multiple times. each <function:bb[;bb]> specifier pair will create a function. if multiple basic blocks are specified in one pair, the first block in the sequence should dominate the rest πŸ‘‘
  • --delete β€” delete specified Globals from Module. periodt.
  • -f β€” enable binary output on terminals. normally llvm-extract will refuse to write raw bitcode output if the output stream is a terminal (she has boundaries 🫢). with this option she'll write raw bitcode regardless of the output device.
  • --func function-name β€” extract the function named function-name from the LLVM bitcode. may be specified multiple times to extract multiple functions at once. stack 'em up 🌈
  • --rfunc function-regular-expr β€” extract the function(s) matching function-regular-expr from the LLVM bitcode. all functions matching the regular expression will be extracted. may be specified multiple times.
  • --glob global-name β€” extract the global variable named global-name from the LLVM bitcode. may be specified multiple times to extract multiple global variables at once.
  • --rglob glob-regular-expr β€” extract the global variable(s) matching global-regular-expr from the LLVM bitcode. all global variables matching the regular expression will be extracted. may be specified multiple times.
  • --keep-const-init β€” preserve the values of constant globals. don't touch them, they're fine πŸ™ˆ
  • --recursive β€” recursively extract all called functions. it's giving "and her friends, and their friends, and their friends…" 🧚
  • -help β€” print a summary of command line options. a little menu, a little moment.
  • -o filename β€” specify the output filename. if filename is - (which is the default), then llvm-extract sends its output to standard output.
  • -S β€” write output in LLVM intermediate language (instead of bitcode). the readable version, slay πŸ’…

⭐ EXIT STATUS ⭐

if llvm-extract succeeds, she exits with 0 πŸ’–. otherwise, if an error occurs, she exits with a non-zero value. no in-between, no drama, just numbers.


πŸ”₯ SEE ALSO πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

maintained by the LLVM Team (https://llvm.org/). they're the ones keeping this whole thing alive, fr fr.


2003-2024, LLVM Project


and that's the whole page bestie 🫢 this was the LLVM man page for LLVM-EXTRACT(1), page 11, dated 2024-07-18 β€” go extract something iconic, ily, bye πŸ’œβœ¨

πŸ“¦ where this page comes from