Structs§

  • Maps “global” (per-CGU) file ID numbers to their underlying filenames.
  • Holds a mapping from “local” (per-function) file IDs to “global” (per-CGU) file IDs.

Functions§

  • When finalizing the coverage map, FunctionCoverage only has the CodeRegions and counters for the functions that went through codegen; such as public functions and “used” functions (functions referenced by other “used” or public items). Any other functions considered unused, or “Unreachable”, were still parsed and processed through the MIR stage, but were not codegenned. (Note that -Clink-dead-code can force some unused code to be codegenned, but that flag is known to cause other errors, when combined with -C instrument-coverage; and -Clink-dead-code will not generate code for unused generic functions.)
  • All items participating in code generation together with (instrumented) items inlined into them.
  • 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.
  • Generates and exports the Coverage Map.
  • Construct coverage map header and the array of function records, and combine them into the coverage map. Save the coverage map data into the LLVM IR as a static global using a specific, well-known section and name.
  • Construct a function record and combine it with the function’s coverage mapping data. Save the function record into the LLVM IR as a static global using a specific, well-known section and name.