GNATELIM(1)

πŸ“¦ version 2019, in ubuntu jammy

✨ gnatelim ✨

gnatelim β€” the ASIS Tools era girlie who literally goes through your Ada program and βœ‚οΈ eliminates dead code. bestie, she's an icon, she's a legend, and she's about to make your executable smaller. πŸ’…


πŸŽ€ NAME πŸŽ€

gnatelim β€” eliminate dead code from Ada programs πŸ¦‹


🌸 SYNOPSIS 🌸

gnatelim [OPTION]... name

πŸ’– DESCRIPTION πŸ’–

okay so picture this: you're working with a program that shares some set of Ada packages with other programs. and it may happen that your program only uses a part of the subprograms defined in those packages β€” meanwhile the code generated for all the unused subprograms is just... sitting there, making your executable bigger. not cute. 😭

gnatelim is a utility that tracks unused subprograms in an Ada program. its output is a list of Eliminate pragmas marking all the subprograms that are declared but never called</> in a given program. Eliminate is a GNAT-specific pragma. by recompiling your program with these pragmas, you may decrease the size of its executable, because the compiler will not create the code for unused subprograms. slay. πŸ’…βœ¨

gnatelim is an ASIS application developed on top of the ASIS implementation for GNAT. she needs a set of tree files representing a program to analyze, plus the bind file for its main subprogram, all created in the current directory. 🫢

heads up bestie: for the current version, it is the user's responsibility to maintain the consistency of the set of tree files processed by gnatelim, if the user also changes the sources of the Ada program to be processed. no cap, that one's on you. πŸ™ˆ

to produce a list of Eliminate pragmas, gnatelim has to do an extensive analysis and it may take some time. for example, to process itself, gnatelim takes 4 minutes of CPU time on a Pentium 200. she's thorough, she's committed, she's taking her time. ⏳


✨ OPTIONS ✨

  • -v β€” verbose mode: gnatelim version information is printed (in the form of Ada comments) in stdout; the names of the files being processed are printed to standard-error. she's telling you everything, bestie πŸ—£οΈ
  • -vf β€” same as -v, but in addition various debugging information and information reflecting some details of the analysis done by gnatelim are printed to standard-error. maximum yapping, maximum lore πŸ”
  • -a β€” process RTL components: by default, gnatelim does not analyze the units which are the components of the GNAT Run-Time Library (RTL), and it does not generate Eliminate pragmas for subprograms declared in the RTL. if '-a' option is set, RTL components are also analyzed (except some units, which contains subprograms implicitly called by the compiler). going where she normally doesn't go πŸ‘€
  • -m β€” check missed units: if this option is set, gnatelim checks that all the units which (according to the bind file) has to be analyzed by gnatelim are really represented by the set of tree files processed by gnatelim (depending on whether or not '-a' option is set). by default (that is, if '-m' option is not set), gnatelim analyzes a set of units represented by a given set of tree files "as is" (excluding library packages which require bodies, but for which bodies are not available). no missing pieces, we check 🧐

πŸ¦‹ SEE ALSO πŸ¦‹

gnat(1), asistant(1), gnat2xml(1), gnatcheck(1), gnatmetric(1), gnatpp(1), gnatstub(1), gnattest(1) β€” the whole friend group, honestly πŸ‘‘

documentation about the ASIS tools may be found in /usr/share/doc/asis-doc/ if the asis-doc package is installed. πŸ“ the reference documentation about ASIS is excluded due to license problems, but may be found in various formats at http://libre.adacore.com/developers/documentation. πŸ”—


and that's the whole page, bestie πŸ’– this one shipped with Debian GNU/Linux, dated 2014-08-09, and yes it's literally titled GNATELIM(1) β€” iconic name, iconic tool, periodt. πŸŽ€βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from