coverage: Give the instrumentor its own counter type, separate from MIR
This splits off `BcbCounter` from MIR's `CoverageKind`, allowing the two types to evolve in different directions as necessary.
This commit is contained in:
parent
629437eec7
commit
fbab055e77
5 changed files with 129 additions and 85 deletions
|
@ -96,21 +96,6 @@ pub enum CoverageKind {
|
|||
Unreachable,
|
||||
}
|
||||
|
||||
impl CoverageKind {
|
||||
pub fn as_operand(&self) -> Operand {
|
||||
use CoverageKind::*;
|
||||
match *self {
|
||||
Counter { id, .. } => Operand::Counter(id),
|
||||
Expression { id, .. } => Operand::Expression(id),
|
||||
Unreachable => bug!("Unreachable coverage cannot be part of an expression"),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_expression(&self) -> bool {
|
||||
matches!(self, Self::Expression { .. })
|
||||
}
|
||||
}
|
||||
|
||||
impl Debug for CoverageKind {
|
||||
fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
|
||||
use CoverageKind::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue