File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ class Run(comp: Compiler)(implicit ctx: Context) {
46
46
.filterNot(ctx.settings.Yskip .value.containsPhase(_)) // TODO: skip only subphase
47
47
for (phase <- phasesToRun)
48
48
if (! ctx.reporter.hasErrors) {
49
- phase.runOn(units)
49
+ units = phase.runOn(units)
50
50
def foreachUnit (op : Context => Unit )(implicit ctx : Context ): Unit =
51
51
for (unit <- units) op(ctx.fresh.setPhase(phase.next).setCompilationUnit(unit))
52
52
if (ctx.settings.Xprint .value.containsPhase(phase))
Original file line number Diff line number Diff line change @@ -192,8 +192,12 @@ object Phases {
192
192
193
193
def run (implicit ctx : Context ): Unit
194
194
195
- def runOn (units : List [CompilationUnit ])(implicit ctx : Context ): Unit =
196
- for (unit <- units) run(ctx.fresh.setPhase(this ).setCompilationUnit(unit))
195
+ def runOn (units : List [CompilationUnit ])(implicit ctx : Context ): List [CompilationUnit ] =
196
+ units.map { unit =>
197
+ val unitCtx = ctx.fresh.setPhase(this ).setCompilationUnit(unit)
198
+ run(unitCtx)
199
+ unitCtx.compilationUnit
200
+ }
197
201
198
202
def description : String = phaseName
199
203
Original file line number Diff line number Diff line change @@ -40,13 +40,14 @@ class FrontEnd extends Phase {
40
40
record(" retainedTypedTrees" , unit.tpdTree.treeSize)
41
41
}
42
42
43
- override def runOn (units : List [CompilationUnit ])(implicit ctx : Context ): Unit = {
43
+ override def runOn (units : List [CompilationUnit ])(implicit ctx : Context ): List [ CompilationUnit ] = {
44
44
val unitContexts = units map (unit => ctx.fresh.setCompilationUnit(unit))
45
45
unitContexts foreach (parse(_))
46
46
record(" parsedTrees" , ast.Trees .ntrees)
47
47
unitContexts foreach (enterSyms(_))
48
48
unitContexts foreach (typeCheck(_))
49
49
record(" totalTrees" , ast.Trees .ntrees)
50
+ unitContexts.map(_.compilationUnit)
50
51
}
51
52
52
53
override def run (implicit ctx : Context ): Unit = {
You can’t perform that action at this time.
0 commit comments