[−][src]Struct rustc_mir::transform::coverage::Instrumentor
Fields
pass_name: &'a strtcx: TyCtxt<'tcx>mir_body: &'a mut Body<'tcx>body_span: Spanbasic_coverage_blocks: CoverageGraphcoverage_counters: CoverageCountersImplementations
impl<'a, 'tcx> Instrumentor<'a, 'tcx>[src]
pub(in transform::coverage) fn new(
pass_name: &'a str,
tcx: TyCtxt<'tcx>,
mir_body: &'a mut Body<'tcx>
) -> Self[src]
pass_name: &'a str,
tcx: TyCtxt<'tcx>,
mir_body: &'a mut Body<'tcx>
) -> Self
pub(in transform::coverage) fn inject_counters(
&'a mut self
)[src]
&'a mut self
)
pub(in transform::coverage) fn inject_coverage_span_counters(
&mut self,
coverage_spans: Vec<CoverageSpan>,
graphviz_data: &mut GraphvizData,
debug_used_expressions: &mut UsedExpressions
)[src]
&mut self,
coverage_spans: Vec<CoverageSpan>,
graphviz_data: &mut GraphvizData,
debug_used_expressions: &mut UsedExpressions
)
Inject a counter for each CoverageSpan. There can be multiple CoverageSpans for a given
BCB, but only one actual counter needs to be incremented per BCB. bb_counters maps each
bcb to its Counter, when injected. Subsequent CoverageSpans for a BCB that already has
a Counter will inject an Expression instead, and compute its value by adding ZERO to
the BCB Counter value.
If debugging, add every BCB Expression associated with a CoverageSpans to the
used_expression_operands map.
pub(in transform::coverage) fn is_code_region_redundant(
&self,
bcb: BasicCoverageBlock,
span: Span,
body_span: Span
) -> bool[src]
&self,
bcb: BasicCoverageBlock,
span: Span,
body_span: Span
) -> bool
Returns true if the type of BasicCoverageBlock (specifically, it's BasicBlocks
TerminatorKind) with the given Span (relative to the body_span) is known to produce
a redundant coverage count.
There is at least one case for this, and if it's not handled, the last line in a function will be double-counted.
If this method returns true, the counter (which other Expressions may depend on) is
still injected, but without an associated code region.
pub(in transform::coverage) fn inject_indirect_counters(
&mut self,
graphviz_data: &mut GraphvizData,
debug_used_expressions: &mut UsedExpressions
)[src]
&mut self,
graphviz_data: &mut GraphvizData,
debug_used_expressions: &mut UsedExpressions
)
inject_coverage_span_counters() looped through the CoverageSpans and injected the
counter from the CoverageSpans BasicCoverageBlock, removing it from the BCB in the
process (via take_counter()).
Any other counter associated with a BasicCoverageBlock, or its incoming edge, but not
associated with a CoverageSpan, should only exist if the counter is a Expression
dependency (one of the expression operands). Collect them, and inject the additional
counters into the MIR, without a reportable coverage span.
pub(in transform::coverage) fn bcb_leader_bb(
&self,
bcb: BasicCoverageBlock
) -> BasicBlock[src]
&self,
bcb: BasicCoverageBlock
) -> BasicBlock
pub(in transform::coverage) fn bcb_last_bb(
&self,
bcb: BasicCoverageBlock
) -> BasicBlock[src]
&self,
bcb: BasicCoverageBlock
) -> BasicBlock
pub(in transform::coverage) fn bcb_terminator(
&self,
bcb: BasicCoverageBlock
) -> &Terminator<'tcx>[src]
&self,
bcb: BasicCoverageBlock
) -> &Terminator<'tcx>
pub(in transform::coverage) fn bcb_data(
&self,
bcb: BasicCoverageBlock
) -> &BasicCoverageBlockData[src]
&self,
bcb: BasicCoverageBlock
) -> &BasicCoverageBlockData
pub(in transform::coverage) fn bcb_data_mut(
&mut self,
bcb: BasicCoverageBlock
) -> &mut BasicCoverageBlockData[src]
&mut self,
bcb: BasicCoverageBlock
) -> &mut BasicCoverageBlockData
pub(in transform::coverage) fn format_counter(
&self,
counter_kind: &CoverageKind
) -> String[src]
&self,
counter_kind: &CoverageKind
) -> String
Auto Trait Implementations
impl<'a, 'tcx> !RefUnwindSafe for Instrumentor<'a, 'tcx>
impl<'a, 'tcx> !Send for Instrumentor<'a, 'tcx>
impl<'a, 'tcx> !Sync for Instrumentor<'a, 'tcx>
impl<'a, 'tcx> Unpin for Instrumentor<'a, 'tcx> where
'tcx: 'a,
'tcx: 'a,
impl<'a, 'tcx> !UnwindSafe for Instrumentor<'a, 'tcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.