LLVM-EXTRACT(1)
π NAME π
okay bestie, meet llvm-extract β it extracts a function from an LLVM module. that's the whole gig. it's giving "surgical little scalpel" energy π₯
β¨ SYNOPSIS β¨
llvm-extract [options] --func function-name [filename]
π¦ DESCRIPTION π¦
so the way llvm-extract works is: you hand it a function name, and it pulls that function out of the LLVM bitcode file you point it at. that's it. slay. π
its main character purpose is being a debugging tool β specifically, shrinking big test cases from big programs down to the tiny bit that's actually triggering a bug. like taking a 4-hour video and trimming it to the 3 seconds where the chaos happens. iconic behavior honestly.
and it doesn't stop at just the function, no ma'am. in addition to extracting the bitcode of the specified function, llvm-extract will also remove unreachable global variables, prototypes, and unused types. so it's a whole spring cleaning, not just a pluck-and-go π§Ήβ¨
where does it read from? standard input, if filename is omitted or if filename is -. and the output always goes to standard output β unless you pass the -o option (peep below, it's right there) π
π OPTIONS π
--aliasalias-name β extract the alias named function-name from the LLVM bitcode. you can pass this multiple times to extract multiple aliases at once. yes queen, stack 'em π--raliasalias-regular-expr β extract the alias matching alias-regular-expr from the LLVM bitcode. all aliases matching the regular expression get extracted. may be specified multiple times.--bbbasic-block-specifier β extract the basic block(s) specified in basic-block-specifier. may be specified multiple times. each<function:bb[;bb]>specifier pair will create a function. lowkey important: 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.-fβ enable binary output on terminals. normallyllvm-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. it's giving "no thoughts, just vibes" and honestly? valid π--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 classic, the moment, the reason we're all here π--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 let them get deleted, they're precious π«Ά--recursiveβ recursively extract all called functions. it brings the whole friend group along π-helpβ print a summary of command line options. when in doubt, ask the tool itself, bestie π-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). human-readable era β¨
π EXIT STATUS π
if llvm-extract succeeds, it will exit with 0. otherwise, if an error occurs, it will exit with a non-zero value. no in-between, no "it's complicated", fr fr.
πΈ SEE ALSO πΈ
bugpoint(1) <bugpoint.html> β go read it, it's the cousin π¦
π AUTHOR π
maintained by the LLVM Team (https://llvm.org/). they're the blueprint, periodt.
β COPYRIGHT β
2003-2026, LLVM Project
and that's the whole page, bestie!! this was theLLVM-EXTRACT(1)manual from theLLVMmanual set, version22, dated2026-07-16. go extract something iconic πβ¨ππ¦π
π¦ where this page comes from
- fedora 44: llvm 22.1.8-4.fc44 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- fedora 44: llvm 22.1.8-4.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