Function rustc_codegen_llvm::coverageinfo::mapgen::finalize
source · pub fn finalize<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>)
Expand description
Generates and exports the Coverage Map.
Rust Coverage Map generation supports LLVM Coverage Mapping Format versions
5 (LLVM 12, only) and 6 (zero-based encoded as 4 and 5, respectively), as defined at
LLVM Code Coverage Mapping Format.
These versions are supported by the LLVM coverage tools (llvm-profdata
and llvm-cov
)
bundled with Rust’s fork of LLVM.
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.