rustc_codegen_llvm::coverageinfo

Module mapgen

Source

Structs§

  • An index into the CGU’s overall list of file paths. The underlying paths will be embedded in the __llvm_covmap linker section.
  • Maps “global” (per-CGU) file ID numbers to their underlying filenames.
  • An index into a function’s list of global file IDs. That underlying list of local-to-global mappings will be embedded in the function’s record in the __llvm_covfun linker section.
  • UsageSets 🔒
  • Holds a mapping from “local” (per-function) file IDs to “global” (per-CGU) file IDs.

Functions§

  • Each CGU will normally only emit coverage metadata for the functions that it actually generates. But since we don’t want unused functions to disappear from coverage reports, we also scan for functions that were instrumented but are not participating in codegen.
  • Using the expressions and counter regions collected for a single function, generate the variable-sized payload of its corresponding __llvm_covfun entry. The payload is returned as a vector of bytes.
  • finalize 🔒
    Generates and exports the coverage map, which is embedded in special linker sections in the final binary.
  • Generates the contents of the covfun record for this function, which contains the function’s coverage mapping data. The record is then stored as a global variable in the __llvm_covfun section.
  • Generates the contents of the covmap record for this CGU, which mostly consists of a header and a list of filenames. The record is then stored as a global variable in the __llvm_covmap section.
  • Prepare sets of definitions that are relevant to deciding whether something is an “unused function” for coverage purposes.