@@ -189,12 +189,12 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
189189
190190 def doAdvanceUnit ()(using Context ): Unit =
191191 trackProgress : progress =>
192- progress.unitc += 1 // trace that we completed a unit in the current (sub)phase
192+ progress.currentUnitCount += 1 // trace that we completed a unit in the current (sub)phase
193193 progress.refreshProgress()
194194
195195 def doAdvanceLate ()(using Context ): Unit =
196196 trackProgress : progress =>
197- progress.latec += 1 // trace that we completed a late compilation
197+ progress.currentLateUnitCount += 1 // trace that we completed a late compilation
198198 progress.refreshProgress()
199199
200200 private def doEnterPhase (currentPhase : Phase )(using Context ): Unit =
@@ -210,22 +210,22 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
210210
211211 private def doAdvancePhase (currentPhase : Phase , wasRan : Boolean )(using Context ): Unit =
212212 trackProgress : progress =>
213- progress.unitc = 0 // reset unit count in current (sub)phase
214- progress.subtraversalc = 0 // reset subphase index to initial
215- progress.seen += 1 // trace that we've seen a (sub)phase
213+ progress.currentUnitCount = 0 // reset unit count in current (sub)phase
214+ progress.currentCompletedSubtraversalCount = 0 // reset subphase index to initial
215+ progress.seenPhaseCount += 1 // trace that we've seen a (sub)phase
216216 if wasRan then
217217 // add an extra traversal now that we completed a (sub)phase
218- progress.traversalc += 1
218+ progress.completedTraversalCount += 1
219219 else
220220 // no subphases were ran, remove traversals from expected total
221221 progress.totalTraversals -= currentPhase.traversals
222222
223223 private def doAdvanceSubPhase ()(using Context ): Unit =
224224 trackProgress : progress =>
225- progress.unitc = 0 // reset unit count in current (sub)phase
226- progress.seen += 1 // trace that we've seen a (sub)phase
227- progress.traversalc += 1 // add an extra traversal now that we completed a (sub)phase
228- progress.subtraversalc += 1 // record that we've seen a subphase
225+ progress.currentUnitCount = 0 // reset unit count in current (sub)phase
226+ progress.seenPhaseCount += 1 // trace that we've seen a (sub)phase
227+ progress.completedTraversalCount += 1 // add an extra traversal now that we completed a (sub)phase
228+ progress.currentCompletedSubtraversalCount += 1 // record that we've seen a subphase
229229 if ! progress.isCancelled() then
230230 progress.tickSubphase()
231231
@@ -498,12 +498,12 @@ object Run {
498498 private class Progress (cb : ProgressCallback , private val run : Run , val initialTraversals : Int ):
499499 export cb .{cancel , isCancelled }
500500
501- private [ Run ] var totalTraversals : Int = initialTraversals // track how many phases we expect to run
502- private [ Run ] var unitc : Int = 0 // current unit count in the current (sub)phase
503- private [ Run ] var latec : Int = 0 // current late unit count
504- private [ Run ] var traversalc : Int = 0 // completed traversals over all files
505- private [ Run ] var subtraversalc : Int = 0 // completed subphases in the current phase
506- private [ Run ] var seen : Int = 0 // how many phases we've seen so far
501+ var totalTraversals : Int = initialTraversals // track how many phases we expect to run
502+ var currentUnitCount : Int = 0 // current unit count in the current (sub)phase
503+ var currentLateUnitCount : Int = 0 // current late unit count
504+ var completedTraversalCount : Int = 0 // completed traversals over all files
505+ var currentCompletedSubtraversalCount : Int = 0 // completed subphases in the current phase
506+ var seenPhaseCount : Int = 0 // how many phases we've seen so far
507507
508508 private var currPhase : Phase = uninitialized // initialized by enterPhase
509509 private var subPhases : SubPhases = uninitialized // initialized by enterPhase
@@ -519,21 +519,21 @@ object Run {
519519
520520 /** Compute the current (sub)phase name and next (sub)phase name */
521521 private [Run ] def tickSubphase ()(using Context ): Unit =
522- val index = subtraversalc
522+ val index = currentCompletedSubtraversalCount
523523 val s = subPhases
524524 currPhaseName = s.subPhase(index)
525525 nextPhaseName =
526526 if index + 1 < s.all.size then s.subPhase(index + 1 )
527527 else s.next match
528528 case None => " <end>"
529529 case Some (next0) => next0.subPhase(0 )
530- if seen > 0 then
530+ if seenPhaseCount > 0 then
531531 refreshProgress()
532532
533533
534534 /** Counts the number of completed full traversals over files, plus the number of units in the current phase */
535535 private def currentProgress (): Int =
536- traversalc * work() + unitc + latec
536+ completedTraversalCount * work() + currentUnitCount + currentLateUnitCount
537537
538538 /** Total progress is computed as the sum of
539539 * - the number of traversals we expect to make over all files
0 commit comments