about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2023-11-16 17:48:23 +1100
committerZalathar <Zalathar@users.noreply.github.com>2024-03-14 17:19:02 +1100
commit31d0b5017857cef35031a7d4210bd045758dcae2 (patch)
tree141754a1483eed39d3c0919b3ab9d6bb93915a49 /compiler/rustc_codegen_llvm
parentc1bec0ce6b6eefabd153c315ccec4dfce3808885 (diff)
downloadrust-31d0b5017857cef35031a7d4210bd045758dcae2.tar.gz
rust-31d0b5017857cef35031a7d4210bd045758dcae2.zip
coverage: Include recorded branch info in coverage instrumentation
Diffstat (limited to 'compiler/rustc_codegen_llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs
index 017843c7e7d..2af28146a51 100644
--- a/compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs
+++ b/compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs
@@ -164,6 +164,15 @@ impl CounterMappingRegion {
                 end_line,
                 end_col,
             ),
+            MappingKind::Branch { true_term, false_term } => Self::branch_region(
+                Counter::from_term(true_term),
+                Counter::from_term(false_term),
+                local_file_id,
+                start_line,
+                start_col,
+                end_line,
+                end_col,
+            ),
         }
     }
 
@@ -188,9 +197,6 @@ impl CounterMappingRegion {
         }
     }
 
-    // This function might be used in the future; the LLVM API is still evolving, as is coverage
-    // support.
-    #[allow(dead_code)]
     pub(crate) fn branch_region(
         counter: Counter,
         false_counter: Counter,