LLVM-EXTRACT(1)
π LLVM-EXTRACT β the manual page, bestie edition π
okay so this is llvm-extract from the LLVM manual set, and honestly? she's a little diva with one job and she does it flawlessly.
β¨ NAME β¨
llvm-extract β extract a function from an LLVM module
πΈ SYNOPSIS πΈ
llvm-extract [options] --func function-name [filename]
π¦ DESCRIPTION π¦
So here's the tea, bestie: llvm-extract takes the name of a function and extracts it out of the LLVM bitcode file you point it at. That's it. That's the whole vibe.
Her main character era is being a debugging tool β you use her to shrink a giant program down into a tiny little test case when something is triggering a bug. Think of it like β¨declutteringβ¨ but for bitcode. π₯
And she's not just grabbing the function and leaving, no no. She's thorough. On top of extracting the bitcode of the specified function, llvm-extract will also remove unreachable global variables, prototypes, and unused types. She cleans up after herself, periodt. π§Ήπ
Where does she read from? If you omit filename, or if filename is -, she reads from standard input. And where does the output go? always to standard output β unless you use the -o option (more on that below, don't worry).
π OPTIONS π
--aliasalias-name β extract the alias named function-name from the LLVM bitcode. You can pass this multiple times to extract multiple alias at once. (yes, multiple alias. she said what she said.)--raliasalias-regular-expr β extract the alias matching alias-regular-expr from the LLVM bitcode. All alias matching the regular expression will be extracted. May be specified multiple times.--bbbasic-block-specifier β extract basic blocks(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. (yes bestie, that's a rule, not a suggestion π)--deleteβ delete specified Globals from Module.-fβ enable binary output on terminals. Normally,llvm-extractwill refuse to write raw bitcode output if the output stream is a terminal. With this option,llvm-extractwill write raw bitcode regardless of the output device. She's being brave for you. π--funcfunction-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 girl the synopsis is talking about, iykyk)--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.--recursiveβ recursively extract all called functions. she goes deeper. π-helpβ print a summary of command line options.-ofilename β specify the output filename. If filename is-(the default), thenllvm-extractsends its output to standard output.-Sβ write output in LLVM intermediate language (instead of bitcode).
π EXIT STATUS π
If llvm-extract succeeds, she exits with 0. Otherwise, if an error occurs, she exits with a non-zero value. Slay when it works, sad girl hours when it doesn't. π
π₯ SEE ALSO π₯
π AUTHOR π
Maintained by the LLVM Team (<https://llvm.org/>). wait, no links allowed β okay, the address is literally just https://llvm.org/ bestie, go look it up. π«Ά
π COPYRIGHT π
2003-2025, LLVM Project
and that's the whole page!! β¨ this one came from the LLVM manual set, dated 2025-09-03, and it's page 20 of the LLVM-EXTRACT(1) lineup. go forth and extract, bestie, you've got this π ππ
π¦ where this page comes from
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 43: llvm20 20.1.8-2.fc43 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm20 20.1.8-2.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms