1
Fork 0

coverage: Don't bother renumbering expressions on the Rust side

The LLVM API that we use to encode coverage mappings already has its own code
for removing unused coverage expressions and renumbering the rest.

This lets us get rid of our own complex renumbering code, making it easier to
change our coverage code in other ways.
This commit is contained in:
Zalathar 2023-07-23 11:48:31 +10:00
parent 527c629cd9
commit 041a232b62
4 changed files with 64 additions and 167 deletions

View file

@ -45,16 +45,6 @@ impl ExpressionId {
}
}
rustc_index::newtype_index! {
/// MappedExpressionIndex values ascend from zero, and are recalculated indexes based on their
/// array position in the LLVM coverage map "Expressions" array, which is assembled during the
/// "mapgen" process. They cannot be computed algorithmically, from the other `newtype_index`s.
#[derive(HashStable)]
#[max = 0xFFFF_FFFF]
#[debug_format = "MappedExpressionIndex({})"]
pub struct MappedExpressionIndex {}
}
/// Operand of a coverage-counter expression.
///
/// Operands can be a constant zero value, an actual coverage counter, or another

View file

@ -479,7 +479,6 @@ TrivialTypeTraversalImpls! {
::rustc_target::asm::InlineAsmRegOrRegClass,
crate::mir::coverage::CounterId,
crate::mir::coverage::ExpressionId,
crate::mir::coverage::MappedExpressionIndex,
crate::mir::Local,
crate::mir::Promoted,
crate::traits::Reveal,