Skip to content

Commit

Permalink
coverage: Ignore functions that end up having no mappings
Browse files Browse the repository at this point in the history
A used function with no mappings has historically indicated a bug, but that
will no longer be the case after moving some fallible span-processing steps
into codegen.
  • Loading branch information
Zalathar committed Nov 24, 2024
1 parent 15b663e commit 619a272
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,8 @@ pub(crate) fn finalize(cx: &CodegenCx<'_, '_>) {
encode_mappings_for_function(tcx, &global_file_table, &function_coverage);

if coverage_mapping_buffer.is_empty() {
if function_coverage.is_used() {
bug!(
"A used function should have had coverage mapping data but did not: {}",
mangled_function_name
);
} else {
debug!("unused function had no coverage mapping data: {}", mangled_function_name);
continue;
}
debug!("function has no mappings to embed; skipping");
continue;
}

if !is_used {
Expand Down

0 comments on commit 619a272

Please sign in to comment.