@@ -12,7 +12,7 @@ import typer.Typer
12
12
import typer .ImportInfo .withRootImports
13
13
import Decorators .*
14
14
import io .AbstractFile
15
- import Phases .{unfusedPhases , Phase }
15
+ import Phases .{assemblePhases , unfusedPhases , Phase }
16
16
17
17
import sbt .interfaces .ProgressCallback
18
18
@@ -295,19 +295,12 @@ extends ImplicitRunInfo, ConstraintRunInfo, cc.CaptureRunInfo {
295
295
report.echo(this .enrichErrorMessage(s " exception occurred while compiling ${files1.map(_.path)}" ))
296
296
throw ex
297
297
298
- /** TODO: There's a fundamental design problem here: We assemble phases using `fusePhases`
299
- * when we first build the compiler. But we modify them with -Yskip, -Ystop
300
- * on each run. That modification needs to either transform the tree structure,
301
- * or we need to assemble phases on each run, and take -Yskip, -Ystop into
302
- * account. I think the latter would be preferable.
303
- */
304
298
def compileSources (sources : List [SourceFile ]): Unit =
305
299
if (sources forall (_.exists)) {
306
300
units = sources.map(CompilationUnit (_))
307
301
compileUnits()
308
302
}
309
303
310
-
311
304
def compileUnits (us : List [CompilationUnit ]): Unit = {
312
305
units = us
313
306
compileUnits()
@@ -333,23 +326,9 @@ extends ImplicitRunInfo, ConstraintRunInfo, cc.CaptureRunInfo {
333
326
then ActiveProfile (ctx.settings.VprofileDetails .value.max(0 ).min(1000 ))
334
327
else NoProfile
335
328
336
- // If testing pickler, make sure to stop after pickling phase:
337
- val stopAfter =
338
- if (ctx.settings.YtestPickler .value) List (" pickler" )
339
- else ctx.settings.YstopAfter .value
340
-
341
- val runCtx = ctx.fresh
329
+ val runCtx = assemblePhases()
342
330
runCtx.setProfiler(Profiler ())
343
331
344
- val pluginPlan = ctx.base.addPluginPhases(ctx.base.phasePlan)
345
- val phases = ctx.base.fusePhases(pluginPlan,
346
- ctx.settings.Yskip .value, ctx.settings.YstopBefore .value, stopAfter, ctx.settings.Ycheck .value)
347
- ctx.base.usePhases(phases, runCtx)
348
- val phasesSettings = List (" -Vphases" , " -Vprint" )
349
- for phasesSetting <- ctx.settings.allSettings if phasesSettings.contains(phasesSetting.name) do
350
- for case vs : List [String ] <- phasesSetting.userValue; p <- vs do
351
- if ! phases.exists(List (p).containsPhase) then report.warning(s " ' $p' specifies no phase " )
352
-
353
332
if ctx.settings.YnoDoubleBindings .value then
354
333
ctx.base.checkNoDoubleBindings = true
355
334
@@ -359,7 +338,7 @@ extends ImplicitRunInfo, ConstraintRunInfo, cc.CaptureRunInfo {
359
338
var phasesWereAdjusted = false
360
339
361
340
var forceReachPhaseMaybe =
362
- if (ctx.isBestEffort && phases .exists(_.phaseName == " typer" )) Some (" typer" )
341
+ if (ctx.isBestEffort && allPhases .exists(_.phaseName == " typer" )) Some (" typer" )
363
342
else None
364
343
365
344
for phase <- allPhases do
0 commit comments