[−][src]Struct rustc_mir::transform::instrument_coverage::Instrumentor
Fields
pass_name: &'a strtcx: TyCtxt<'tcx>mir_body: &'a mut Body<'tcx>hir_body: &'tcx Body<'tcx>dominators: Option<Dominators<BasicBlock>>basic_coverage_blocks: Option<BasicCoverageBlocks>function_source_hash: Option<u64>next_counter_id: u32num_expressions: u32Implementations
impl<'a, 'tcx> Instrumentor<'a, 'tcx>[src]
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
fn next_counter(&mut self) -> CounterValueReference[src]
Counter IDs start from one and go up.
fn next_expression(&mut self) -> InjectedExpressionIndex[src]
Expression IDs start from u32::MAX and go down because a CounterExpression can reference (add or subtract counts) of both Counter regions and CounterExpression regions. The counter expression operand IDs must be unique across both types.
fn dominators(&self) -> &Dominators<BasicBlock>[src]
fn basic_coverage_blocks(&self) -> &BasicCoverageBlocks[src]
fn function_source_hash(&mut self) -> u64[src]
fn inject_counters(&mut self)[src]
fn make_counter(&mut self) -> CoverageKind[src]
fn make_expression(
&mut self,
lhs: ExpressionOperandId,
op: Op,
rhs: ExpressionOperandId
) -> CoverageKind[src]
&mut self,
lhs: ExpressionOperandId,
op: Op,
rhs: ExpressionOperandId
) -> CoverageKind
fn inject_statement(
&mut self,
file_name: Symbol,
source_file: &Lrc<SourceFile>,
coverage_kind: CoverageKind,
span: Span,
block: BasicBlock
)[src]
&mut self,
file_name: Symbol,
source_file: &Lrc<SourceFile>,
coverage_kind: CoverageKind,
span: Span,
block: BasicBlock
)
fn span_viewables(
&self,
coverage_spans: &Vec<CoverageSpan>
) -> Vec<SpanViewable>[src]
&self,
coverage_spans: &Vec<CoverageSpan>
) -> Vec<SpanViewable>
Converts the computed BasicCoverageBlocks into SpanViewables.
fn bcb_from_coverage_span(
&self,
coverage_span: &CoverageSpan
) -> &BasicCoverageBlock[src]
&self,
coverage_span: &CoverageSpan
) -> &BasicCoverageBlock
fn body_span(&self) -> Span[src]
fn extract_spans(&self, bcb: &'a BasicCoverageBlock) -> Vec<CoverageSpan>[src]
fn coverage_spans(&self) -> Vec<CoverageSpan>[src]
Generate a minimal set of CoverageSpans, each representing a contiguous code region to be
counted.
The basic steps are:
-
Extract an initial set of spans from the
Statements andTerminators of eachBasicCoverageBlock. -
Sort the spans by span.lo() (starting position). Spans that start at the same position are sorted with longer spans before shorter spans; and equal spans are sorted (deterministically) based on "dominator" relationship (if any).
-
Traverse the spans in sorted order to identify spans that can be dropped (for instance, if another span or spans are already counting the same code region), or should be merged into a broader combined span (because it represents a contiguous, non-branching, and uninterrupted region of source code).
Closures are exposed in their enclosing functions as
AssignRvalues, and since closures have their own MIR, theirSpanin their enclosing function should be left "uncovered".
Note the resulting vector of CoverageSpans does may not be fully sorted (and does not need
to be).
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.