@@ -19,18 +19,18 @@ const NESTED_INDENT: &str = " ";
1919#[ derive( Clone ) ]
2020pub ( super ) enum BcbCounter {
2121 Counter { id : CounterId } ,
22- Expression { id : ExpressionId , lhs : Operand , op : Op , rhs : Operand } ,
22+ Expression { id : ExpressionId , lhs : CovTerm , op : Op , rhs : CovTerm } ,
2323}
2424
2525impl BcbCounter {
2626 fn is_expression ( & self ) -> bool {
2727 matches ! ( self , Self :: Expression { .. } )
2828 }
2929
30- pub ( super ) fn as_operand ( & self ) -> Operand {
30+ pub ( super ) fn as_term ( & self ) -> CovTerm {
3131 match * self {
32- BcbCounter :: Counter { id, .. } => Operand :: Counter ( id) ,
33- BcbCounter :: Expression { id, .. } => Operand :: Expression ( id) ,
32+ BcbCounter :: Counter { id, .. } => CovTerm :: Counter ( id) ,
33+ BcbCounter :: Expression { id, .. } => CovTerm :: Expression ( id) ,
3434 }
3535 }
3636}
@@ -106,7 +106,7 @@ impl CoverageCounters {
106106 BcbCounter :: Counter { id }
107107 }
108108
109- fn make_expression ( & mut self , lhs : Operand , op : Op , rhs : Operand ) -> BcbCounter {
109+ fn make_expression ( & mut self , lhs : CovTerm , op : Op , rhs : CovTerm ) -> BcbCounter {
110110 let id = self . next_expression ( ) ;
111111 BcbCounter :: Expression { id, lhs, op, rhs }
112112 }
@@ -138,22 +138,22 @@ impl CoverageCounters {
138138 & mut self ,
139139 bcb : BasicCoverageBlock ,
140140 counter_kind : BcbCounter ,
141- ) -> Result < Operand , Error > {
141+ ) -> Result < CovTerm , Error > {
142142 debug_assert ! (
143143 // If the BCB has an edge counter (to be injected into a new `BasicBlock`), it can also
144144 // have an expression (to be injected into an existing `BasicBlock` represented by this
145145 // `BasicCoverageBlock`).
146146 counter_kind. is_expression( ) || !self . bcb_has_incoming_edge_counters. contains( bcb) ,
147147 "attempt to add a `Counter` to a BCB target with existing incoming edge counters"
148148 ) ;
149- let operand = counter_kind. as_operand ( ) ;
149+ let term = counter_kind. as_term ( ) ;
150150 if let Some ( replaced) = self . bcb_counters [ bcb] . replace ( counter_kind) {
151151 Error :: from_string ( format ! (
152152 "attempt to set a BasicCoverageBlock coverage counter more than once; \
153153 {bcb:?} already had counter {replaced:?}",
154154 ) )
155155 } else {
156- Ok ( operand )
156+ Ok ( term )
157157 }
158158 }
159159
@@ -162,7 +162,7 @@ impl CoverageCounters {
162162 from_bcb : BasicCoverageBlock ,
163163 to_bcb : BasicCoverageBlock ,
164164 counter_kind : BcbCounter ,
165- ) -> Result < Operand , Error > {
165+ ) -> Result < CovTerm , Error > {
166166 if level_enabled ! ( tracing:: Level :: DEBUG ) {
167167 // If the BCB has an edge counter (to be injected into a new `BasicBlock`), it can also
168168 // have an expression (to be injected into an existing `BasicBlock` represented by this
@@ -175,14 +175,14 @@ impl CoverageCounters {
175175 }
176176 }
177177 self . bcb_has_incoming_edge_counters . insert ( to_bcb) ;
178- let operand = counter_kind. as_operand ( ) ;
178+ let term = counter_kind. as_term ( ) ;
179179 if let Some ( replaced) = self . bcb_edge_counters . insert ( ( from_bcb, to_bcb) , counter_kind) {
180180 Error :: from_string ( format ! (
181181 "attempt to set an edge counter more than once; from_bcb: \
182182 {from_bcb:?} already had counter {replaced:?}",
183183 ) )
184184 } else {
185- Ok ( operand )
185+ Ok ( term )
186186 }
187187 }
188188
@@ -284,7 +284,7 @@ impl<'a> MakeBcbCounters<'a> {
284284 & mut self ,
285285 traversal : & mut TraverseCoverageGraphWithLoops ,
286286 branching_bcb : BasicCoverageBlock ,
287- branching_counter_operand : Operand ,
287+ branching_counter_operand : CovTerm ,
288288 ) -> Result < ( ) , Error > {
289289 let branches = self . bcb_branches ( branching_bcb) ;
290290 debug ! (
@@ -332,7 +332,7 @@ impl<'a> MakeBcbCounters<'a> {
332332 sumup_counter_operand,
333333 ) ;
334334 debug ! ( " [new intermediate expression: {:?}]" , intermediate_expression) ;
335- let intermediate_expression_operand = intermediate_expression. as_operand ( ) ;
335+ let intermediate_expression_operand = intermediate_expression. as_term ( ) ;
336336 self . coverage_counters . intermediate_expressions . push ( intermediate_expression) ;
337337 some_sumup_counter_operand. replace ( intermediate_expression_operand) ;
338338 }
@@ -364,15 +364,15 @@ impl<'a> MakeBcbCounters<'a> {
364364 Ok ( ( ) )
365365 }
366366
367- fn get_or_make_counter_operand ( & mut self , bcb : BasicCoverageBlock ) -> Result < Operand , Error > {
367+ fn get_or_make_counter_operand ( & mut self , bcb : BasicCoverageBlock ) -> Result < CovTerm , Error > {
368368 self . recursive_get_or_make_counter_operand ( bcb, 1 )
369369 }
370370
371371 fn recursive_get_or_make_counter_operand (
372372 & mut self ,
373373 bcb : BasicCoverageBlock ,
374374 debug_indent_level : usize ,
375- ) -> Result < Operand , Error > {
375+ ) -> Result < CovTerm , Error > {
376376 // If the BCB already has a counter, return it.
377377 if let Some ( counter_kind) = & self . coverage_counters . bcb_counters [ bcb] {
378378 debug ! (
@@ -381,7 +381,7 @@ impl<'a> MakeBcbCounters<'a> {
381381 bcb,
382382 counter_kind,
383383 ) ;
384- return Ok ( counter_kind. as_operand ( ) ) ;
384+ return Ok ( counter_kind. as_term ( ) ) ;
385385 }
386386
387387 // A BCB with only one incoming edge gets a simple `Counter` (via `make_counter()`).
@@ -445,7 +445,7 @@ impl<'a> MakeBcbCounters<'a> {
445445 NESTED_INDENT . repeat( debug_indent_level) ,
446446 intermediate_expression
447447 ) ;
448- let intermediate_expression_operand = intermediate_expression. as_operand ( ) ;
448+ let intermediate_expression_operand = intermediate_expression. as_term ( ) ;
449449 self . coverage_counters . intermediate_expressions . push ( intermediate_expression) ;
450450 some_sumup_edge_counter_operand. replace ( intermediate_expression_operand) ;
451451 }
@@ -468,7 +468,7 @@ impl<'a> MakeBcbCounters<'a> {
468468 & mut self ,
469469 from_bcb : BasicCoverageBlock ,
470470 to_bcb : BasicCoverageBlock ,
471- ) -> Result < Operand , Error > {
471+ ) -> Result < CovTerm , Error > {
472472 self . recursive_get_or_make_edge_counter_operand ( from_bcb, to_bcb, 1 )
473473 }
474474
@@ -477,7 +477,7 @@ impl<'a> MakeBcbCounters<'a> {
477477 from_bcb : BasicCoverageBlock ,
478478 to_bcb : BasicCoverageBlock ,
479479 debug_indent_level : usize ,
480- ) -> Result < Operand , Error > {
480+ ) -> Result < CovTerm , Error > {
481481 // If the source BCB has only one successor (assumed to be the given target), an edge
482482 // counter is unnecessary. Just get or make a counter for the source BCB.
483483 let successors = self . bcb_successors ( from_bcb) . iter ( ) ;
@@ -496,7 +496,7 @@ impl<'a> MakeBcbCounters<'a> {
496496 to_bcb,
497497 counter_kind
498498 ) ;
499- return Ok ( counter_kind. as_operand ( ) ) ;
499+ return Ok ( counter_kind. as_term ( ) ) ;
500500 }
501501
502502 // Make a new counter to count this edge.
0 commit comments