Function rustc_codegen_llvm::coverageinfo::mapgen::finalize

source ·
pub fn finalize(cx: &CodegenCx<'_, '_>)
Expand description

Generates and exports the Coverage Map.

Rust Coverage Map generation supports LLVM Coverage Mapping Format versions 6 and 7 (encoded as 5 and 6 respectively), as described at LLVM Code Coverage Mapping Format. These versions are supported by the LLVM coverage tools (llvm-profdata and llvm-cov) distributed in the llvm-tools-preview rustup component.

Consequently, Rust’s bundled version of Clang also generates Coverage Maps compliant with the same version. Clang’s implementation of Coverage Map generation was referenced when implementing this Rust version, and though the format documentation is very explicit and detailed, some undocumented details in Clang’s implementation (that may or may not be important) were also replicated for Rust’s Coverage Map.