LLVM-EXTRACT(1)
β¨ 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 π¦
--aliasalias-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.--raliasalias-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.--bbbasic-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. normallyllvm-extractwill 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.--funcfunction-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 π--rfuncfunction-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.--globglobal-name β extract the global variable named global-name from the LLVM bitcode. may be specified multiple times to extract multiple global variables at once.--rglobglob-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.-ofilename β specify the output filename. if filename is-(which is the default), thenllvm-extractsends 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.
π COPYRIGHT π
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
- fedora 43: llvm11 11.1.0-14.fc41 Β· NCSA
- fedora 43: llvm11 11.1.0-14.fc41 Β· NCSA
- fedora 44: llvm11 11.1.0-14.fc41 Β· NCSA
- fedora 44: llvm11 11.1.0-14.fc41 Β· NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms