Skip to main content

Module llvm_json

Module llvm_json 

Source
Expand description

llvm-cov JSON export parser (cargo llvm-cov report --json).

The export records per-file segments rather than per-line counts. Each segment is [line, col, count, has_count, is_region_entry, is_gap_region] and marks a point where the active region count changes. Reducing segments to per-line hit counts reproduces llvm’s own LineCoverageStats algorithm: for each source line, take the region active at the line’s start (the “wrapped” segment) together with any region-entry segments on the line, and the line’s count is the maximum among them. A line is instrumented (“mapped”) when a counted region is active over it and it is not the start of a skipped region.

Functions§

parse
Parses llvm-cov JSON export text into a CoverageReport.