diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-02-19 15:46:36 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-02-19 17:04:33 +0100 |
commit | 20c6ab2a586b1ea6184c873ef4afcc4258d989cf (patch) | |
tree | db14486ccbe35a1d0a97cb0c6a12913275ffd346 /src/dotty/tools/dotc/Run.scala | |
parent | 7aa65416ea09470ae24353c36a51f07c5fc1e8a6 (diff) | |
download | dotty-20c6ab2a586b1ea6184c873ef4afcc4258d989cf.tar.gz dotty-20c6ab2a586b1ea6184c873ef4afcc4258d989cf.tar.bz2 dotty-20c6ab2a586b1ea6184c873ef4afcc4258d989cf.zip |
Allow recomputing phase schedule per pun.
Diffstat (limited to 'src/dotty/tools/dotc/Run.scala')
-rw-r--r-- | src/dotty/tools/dotc/Run.scala | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/Run.scala b/src/dotty/tools/dotc/Run.scala index a182029e6..f7cf991da 100644 --- a/src/dotty/tools/dotc/Run.scala +++ b/src/dotty/tools/dotc/Run.scala @@ -40,14 +40,13 @@ class Run(comp: Compiler)(implicit ctx: Context) { */ def compileSources(sources: List[SourceFile]) = Stats.monitorHeartBeat { if (sources forall (_.exists)) { + val phases = ctx.squashPhases(ctx.phasePlan, ctx.settings.Yskip.value, ctx.settings.YstopAfter.value, ctx.settings.Ycheck.value) + ctx.usePhases(phases) units = sources map (new CompilationUnit(_)) def stoppedBefore(phase: Phase) = ctx.settings.YstopBefore.value.containsPhase(phase) || - ctx.settings.YstopAfter.value.containsPhase(phase.prev) - val phasesToRun = ctx.allPhases.init - .takeWhile(!stoppedBefore(_)) - .filterNot(ctx.settings.Yskip.value.containsPhase(_)) // TODO: skip only subphase - for (phase <- phasesToRun) + ctx.settings.YstopAfter.value.containsPhase(phase.prev) + for (phase <- ctx.allPhases) if (!ctx.reporter.hasErrors) { if (ctx.settings.verbose.value) println(s"[$phase]") units = phase.runOn(units) @@ -55,10 +54,7 @@ class Run(comp: Compiler)(implicit ctx: Context) { for (unit <- units) op(ctx.fresh.setPhase(phase.next).setCompilationUnit(unit)) if (ctx.settings.Xprint.value.containsPhase(phase)) foreachUnit(printTree) - if (ctx.settings.Ycheck.value.containsPhase(phase) && !ctx.reporter.hasErrors) { - assert(phase.isCheckable, s"phase $phase is not checkable") - foreachUnit(TreeChecker.check(phasesToRun, _)) - } + } } } |