Module rustc_mir_transform::coverage

source ยท



  • ExtractedHirInfo ๐Ÿ”’
    Function information extracted from HIR by the coverage instrumentor.
  • Inserts StatementKind::Coverage statements that either instrument the binary with injected counters, via intrinsic llvm.instrprof.increment, and/or inject metadata used during codegen to construct the coverage map.


  • check_code_region ๐Ÿ”’
    If llvm-cov sees a code region that is improperly ordered (end < start), it will immediately exit with a fatal error. To prevent that from happening, discard regions that are improperly ordered, or might be interpreted in a way that makes them improperly ordered.
  • create_mappings ๐Ÿ”’
    For each coverage span extracted from MIR, create a corresponding mapping.
  • extract_hir_info ๐Ÿ”’
  • hash_mir_source ๐Ÿ”’
  • For each BCB node or BCB edge that has an associated coverage counter, inject any necessary coverage statements into MIR.
  • Given two basic blocks that have a control-flow edge between them, creates and returns a new block that sits between those blocks.
  • For each conditions inject statements to update condition bitmap after it has been evaluated. For each decision inject statements to update test vector bitmap after it has been evaluated.
  • inject_statement ๐Ÿ”’
  • make_code_region ๐Ÿ”’
    Convert the Span into its file name, start line and column, and end line and column.