Make coverage expression IDs count up from 0, not down from u32::MAX

Operand types are now tracked explicitly, so there is no need for expression
IDs to avoid counter IDs by descending from `u32::MAX`. Instead they can just
count up from 0, and can be used directly as indices when necessary.
This commit is contained in:
Zalathar 2023-06-29 12:14:04 +10:00
parent 1a014d42f4
commit f103db894f
9 changed files with 49 additions and 71 deletions

View file

@ -17,7 +17,7 @@ use rustc_hir::def_id::DefId;
use rustc_llvm::RustString;
use rustc_middle::bug;
use rustc_middle::mir::coverage::{
CodeRegion, CounterValueReference, CoverageKind, InjectedExpressionId, Op, Operand,
CodeRegion, CounterValueReference, CoverageKind, ExpressionId, Op, Operand,
};
use rustc_middle::mir::Coverage;
use rustc_middle::ty;
@ -202,7 +202,7 @@ impl<'tcx> Builder<'_, '_, 'tcx> {
fn add_coverage_counter_expression(
&mut self,
instance: Instance<'tcx>,
id: InjectedExpressionId,
id: ExpressionId,
lhs: Operand,
op: Op,
rhs: Operand,