about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2023-10-06 23:53:23 +1100
committerZalathar <Zalathar@users.noreply.github.com>2023-10-22 23:17:15 +1100
commit6af9fef08590fd499370a2f6cbbae9ceacf15336 (patch)
tree1dfd7054f65f892d1864acfd2785ad567c259ceb /compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs
parentde4cfbca2ebec9c91037370146c518c069ece033 (diff)
downloadrust-6af9fef08590fd499370a2f6cbbae9ceacf15336.tar.gz
rust-6af9fef08590fd499370a2f6cbbae9ceacf15336.zip
coverage: Emit the filenames section before encoding per-function mappings
Most coverage metadata is encoded into two sections in the final executable.
The `__llvm_covmap` section mostly just contains a list of filenames, while the
`__llvm_covfun` section contains encoded coverage maps for each instrumented
function.

The catch is that each per-function record also needs to contain a hash of the
filenames list that it refers to. Historically this was handled by assembling
most of the per-function data into a temporary list, then assembling the
filenames buffer, then using the filenames hash to emit the per-function data,
and then finally emitting the filenames table itself.

However, now that we build the filenames table up-front (via a separate
traversal of the per-function data), we can hash and emit that part first, and
then emit each of the per-function records immediately after building. This
removes the awkwardness of having to temporarily store nearly-complete
per-function records.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs')
0 files changed, 0 insertions, 0 deletions