[llvm-jitlink] Generalize statistics gathering / reporting.
authorLang Hames <lhames@gmail.com>
Thu, 20 Jul 2023 02:16:21 +0000 (19:16 -0700)
committerLang Hames <lhames@gmail.com>
Thu, 20 Jul 2023 02:22:38 +0000 (19:22 -0700)
commite1be36c649937ea2ad487b0122ecc140f1972baf
treef3b09d7a053cefe9cbcc1b5703a04b5fc0c0ff96
parent1a16072f982a7fee580fafa0123fce631f0f2e44
[llvm-jitlink] Generalize statistics gathering / reporting.

Moves the llvm-jitlink tool statistics out of the Session struct and into a new
LLVMJITLinkStatistics class.

Also removes the `-show-sizes` option. Each statistic added will now have its
own option. The two previous stats (total size of all blocks before pruning and
after fixups) are now available as -pre-prune-total-block-size and
-post-fixup-total-block-size.

This change should make it easier to add new statistics.
llvm/tools/llvm-jitlink/llvm-jitlink.cpp
llvm/tools/llvm-jitlink/llvm-jitlink.h