Skip to content

Commit

Permalink
Update compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Wesley Wiser <wwiser@gmail.com>
  • Loading branch information
richkadel and wesleywiser authored Oct 23, 2020
1 parent a7bc1a2 commit f75a236
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ use tracing::debug;
/// undocumented details in Clang's implementation (that may or may not be important) were also
/// replicated for Rust's Coverage Map.
pub fn finalize<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {
if cx.coverage_context().is_none() {
return;
}
let function_coverage_map = cx.coverage_context().unwrap().take_function_coverage_map();
let function_coverage_map = match cx.coverage_context() {
Some(ctx) => ctx.take_function_coverage_map(),
None => return,
};
if function_coverage_map.is_empty() {
// This module has no functions with coverage instrumentation
return;
Expand Down

0 comments on commit f75a236

Please sign in to comment.