@@ -189,12 +189,12 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
189
189
190
190
def doAdvanceUnit ()(using Context ): Unit =
191
191
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
193
193
progress.refreshProgress()
194
194
195
195
def doAdvanceLate ()(using Context ): Unit =
196
196
trackProgress : progress =>
197
- progress.latec += 1 // trace that we completed a late compilation
197
+ progress.currentLateUnitCount += 1 // trace that we completed a late compilation
198
198
progress.refreshProgress()
199
199
200
200
private def doEnterPhase (currentPhase : Phase )(using Context ): Unit =
@@ -210,22 +210,22 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
210
210
211
211
private def doAdvancePhase (currentPhase : Phase , wasRan : Boolean )(using Context ): Unit =
212
212
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
216
216
if wasRan then
217
217
// add an extra traversal now that we completed a (sub)phase
218
- progress.traversalc += 1
218
+ progress.completedTraversalCount += 1
219
219
else
220
220
// no subphases were ran, remove traversals from expected total
221
221
progress.totalTraversals -= currentPhase.traversals
222
222
223
223
private def doAdvanceSubPhase ()(using Context ): Unit =
224
224
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
229
229
if ! progress.isCancelled() then
230
230
progress.tickSubphase()
231
231
@@ -498,12 +498,12 @@ object Run {
498
498
private class Progress (cb : ProgressCallback , private val run : Run , val initialTraversals : Int ):
499
499
export cb .{cancel , isCancelled }
500
500
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
507
507
508
508
private var currPhase : Phase = uninitialized // initialized by enterPhase
509
509
private var subPhases : SubPhases = uninitialized // initialized by enterPhase
@@ -519,21 +519,21 @@ object Run {
519
519
520
520
/** Compute the current (sub)phase name and next (sub)phase name */
521
521
private [Run ] def tickSubphase ()(using Context ): Unit =
522
- val index = subtraversalc
522
+ val index = currentCompletedSubtraversalCount
523
523
val s = subPhases
524
524
currPhaseName = s.subPhase(index)
525
525
nextPhaseName =
526
526
if index + 1 < s.all.size then s.subPhase(index + 1 )
527
527
else s.next match
528
528
case None => " <end>"
529
529
case Some (next0) => next0.subPhase(0 )
530
- if seen > 0 then
530
+ if seenPhaseCount > 0 then
531
531
refreshProgress()
532
532
533
533
534
534
/** Counts the number of completed full traversals over files, plus the number of units in the current phase */
535
535
private def currentProgress (): Int =
536
- traversalc * work() + unitc + latec
536
+ completedTraversalCount * work() + currentUnitCount + currentLateUnitCount
537
537
538
538
/** Total progress is computed as the sum of
539
539
* - the number of traversals we expect to make over all files
0 commit comments