From 1a014d42f45de1b829ca7916d8f639fda6e0770a Mon Sep 17 00:00:00 2001 From: Zalathar Date: Mon, 26 Jun 2023 22:28:48 +1000 Subject: Replace `ExpressionOperandId` with enum `Operand` Because the three kinds of operand are now distinguished explicitly, we no longer need fiddly code to disambiguate counter IDs and expression IDs based on the total number of counters/expressions in a function. This does increase the size of operands from 4 bytes to 8 bytes, but that shouldn't be a big deal since they are mostly stored inside boxed structures, and the current coverage code is not particularly size-optimized anyway. --- compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs') diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs index 60cbb3d3d9d..d6a32497f7f 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs @@ -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, ExpressionOperandId, InjectedExpressionId, Op, + CodeRegion, CounterValueReference, CoverageKind, InjectedExpressionId, Op, Operand, }; use rustc_middle::mir::Coverage; use rustc_middle::ty; @@ -203,9 +203,9 @@ impl<'tcx> Builder<'_, '_, 'tcx> { &mut self, instance: Instance<'tcx>, id: InjectedExpressionId, - lhs: ExpressionOperandId, + lhs: Operand, op: Op, - rhs: ExpressionOperandId, + rhs: Operand, region: Option, ) -> bool { if let Some(coverage_context) = self.coverage_context() { -- cgit 1.4.1-3-g733a5