@@ -17,15 +17,15 @@ class StageRunner(using co: CompilerOptions, po: PrinterOptions) extends LogSupp
17
17
logger.setLogLevel(LogLevel .INFO )
18
18
def logWarn (): Unit =
19
19
logger.setLogLevel(LogLevel .WARN )
20
- private def runSingleStage (stage : Stage )(designDB : DB ): DB =
20
+ private def runSingleStage (stage : Stage , done : Set [ Stage ] )(designDB : DB ): DB =
21
21
info(s " Running stage ${stage.typeName}.... " )
22
22
val ret = stage.transform(designDB)(using designDB.getSet)
23
23
info(s " Finished stage ${stage.typeName}" )
24
24
if (
25
25
logger.getLogLevel >= LogLevel .DEBUG && stage != SanityCheck &&
26
26
! stage.isInstanceOf [NoCheckStage ]
27
27
)
28
- if (stage.nullifies .contains(DropUnreferencedAnons ))
28
+ if (! done .contains(DropUnreferencedAnons ))
29
29
ret.dropUnreferencedAnons.sanityCheck
30
30
else
31
31
ret.sanityCheck
@@ -52,10 +52,12 @@ class StageRunner(using co: CompilerOptions, po: PrinterOptions) extends LogSupp
52
52
else if (done.contains(head)) run(next, done)(designDB)
53
53
// all the dependencies of head are done, so we can run the head stage
54
54
else if ((head.depSet -- done).isEmpty)
55
- // running the stage
56
- val resultDB = runSingleStage(head)(designDB)
57
55
// the stage is done, so we add it to the done set and remove the nullified stages
58
- run(next, done + head -- head.nullifies)(resultDB)
56
+ val updatedDone = done + head -- head.nullifies
57
+ // running the stage (updatedDone set is given only for tracing purposes)
58
+ val resultDB = runSingleStage(head, updatedDone)(designDB)
59
+ // running the next stage
60
+ run(next, updatedDone)(resultDB)
59
61
// still need to wait for dependencies, so we add them to the deps queue in a sorted order
60
62
// (this is just to preserve consistency in compilation order).
61
63
else run(head.dependencies ++ deps, done)(designDB)
0 commit comments