LLVM-EXTRACT(1)

πŸ“¦
version 12.0.1 Β· 4 versions
, in fedora 43, fedora 44

✨ LLVM-EXTRACT ✨

okay bestie, so this is llvm-extract, part of the LLVM fam, and honestly? it's giving surgical πŸ’… she takes one (1) function and yoinks it out of a whole LLVM bitcode file. iconic behavior.


πŸŽ€ SYNOPSIS πŸŽ€

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

🌸 DESCRIPTION 🌸

So here's the vibe: llvm-extract takes the name of a function and extracts it from the LLVM bitcode file you point at. That's it, that's the whole thing. 🫢

It's mainly a debugging tool β€” like, its whole purpose in life is helping you shrink down big test cases from larger programs that are out here triggering a bug. little sis ate that.

And not only does it pull out the bitcode of the function you asked for β€” it also removes unreachable global variables, prototypes, and unused types. she's tidy fr fr ✨

Input tea: llvm-extract reads its input from standard input if filename is omitted, OR if filename is -.

Output is always written to standard output, unless you pass the -o option (peep below πŸ‘‡).


πŸ’– OPTIONS πŸ’–

  • --alias alias-name β€” extract the alias named function-name from the LLVM bitcode. yes the manpage really says "function-name" for an alias, no I'm not fixing it, we report the tea as it is πŸ“. You can pass this multiple times to extract multiple aliases at once.
  • --ralias alias-regular-expr β€” extract the alias matching alias-regular-expr from the LLVM bitcode. Every alias matching the regular expression gets extracted. May be specified multiple times.
  • --bb basic-block-specifier β€” extract basic block(s) specified 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. lowkey powerful πŸ‘‘
  • --delete β€” delete specified Globals from Module. that's it. no thoughts, just deletion πŸ’€
  • -f β€” enable binary output on terminals. Normally, llvm-extract will refuse to write raw bitcode output if the output stream is a terminal. With this option, she'll write raw bitcode regardless of the output device. (chaos mode unlocked, bestie)
  • --func function-name β€” extract the function named function-name from the LLVM bitcode. May be specified multiple times to extract multiple functions at once. this is the main character option tbh ⭐
  • --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. protecting the constants, we love to see it πŸ›‘οΈ
  • --recursive β€” recursively extract all called functions. she goes deep. no cap.
  • -help β€” print a summary of command line options. when in doubt, ask for help bestie πŸ™ˆ
  • -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). human-readable era 🌈

πŸ¦‹ EXIT STATUS πŸ¦‹

If llvm-extract succeeds, she exits with 0. ✨

Otherwise, if an error occurs, she exits with a non-zero value. 😭 (as she should)


🌟 SEE ALSO 🌟


πŸ’œ AUTHOR πŸ’œ

Maintained by the LLVM Team (https://llvm.org/). periodt.


2003-2024, LLVM Project


and that's the whole page bestie!! πŸŽ€πŸ¦‹πŸ’– this lil angel comes to you from the LLVM manual, dated 2024-07-18 β€” mwah, go extract something iconic πŸ’…βœ¨

πŸ“¦ where this page comes from