rustc_codegen_ssa/traits/coverageinfo.rs
1use rustc_middle::mir::coverage::CoverageKind;
2use rustc_middle::ty::Instance;
3
4pub trait CoverageInfoBuilderMethods<'tcx> {
5 /// Performs any start-of-function codegen needed for coverage instrumentation.
6 ///
7 /// Can be a no-op in backends that don't support coverage instrumentation.
8 fn init_coverage(&mut self, _instance: Instance<'tcx>) {}
9
10 /// Handle the MIR coverage info in a backend-specific way.
11 ///
12 /// This can potentially be a no-op in backends that don't support
13 /// coverage instrumentation.
14 fn add_coverage(&mut self, instance: Instance<'tcx>, kind: &CoverageKind);
15}